teleren/devto huggingface dataset:
Suggestion to improve dev.to user feed
Tags: devto, suggestion
Published: 2018-07-12 19:52:38

---
title: Suggestion to improve dev.to user feed
published: true
description: Suggestion to improve dev.to user feed to get more relevant posts based on the users interessts
tags: dev.to, suggestion
---

Hi all,

this is my first post and so far I was just playing silent reader, giving out hearts for great posts and saving the good stuff for late nights 😄
This portal is so great and I'm really happy to have found it!

Something that I noticed and that somewhat bothers me a bit is the <b>User Feed</b>, initially, I thought it's based on <b>my tags</b> but this is not the case.

Don't get me wrong, I love to explore new things but I think it would make more sense to have the <b>Feed</b> only show posts based on my followed tags so that I get all relevant posts based on my interests without distraction of other big topics, I'm looking at you "Web development".
Don't freak out web dev lovers 😛 but in my case, most of the time I'm not too interested in most web dev topics. 
Because this is obviously very popular, my feed is always flooded with those posts.

What I have in mind would be, rename "Feed" >> "TOP"/"Top Posts" and have a new "Feed" based on the users followed tags.

It would even make sense to have cross-references of top posts based on tags, the user currently would not see in his feed. 
It could show up like a "promoted" post in the user feed, something like "This could be interesting for you based on 'tag', 'tag'"

Not sure if this was ever considered or discussed, wasn't in the first search results, but I thought I bring it up as I feel this would be something not only I would appreciate.
Let me know if I didn't yet had have enough coffee and simply oversaw the option to set this up my self 😜

Thanks again for this great portal and of course for all the great people creating awesome posts!

Cheers,
Michael
Virus in eslint-scope 3.7.2
Tags: javascript, security, news, discuss
Published: 2018-07-12 18:04:30

---
title: Virus in eslint-scope 3.7.2
published: true
description: 
tags: javascript, security, news, discuss
---

I came across this issue and figured I shared it here. 
{% github https://github.com/eslint/eslint-scope/issues/39#issue-340594914 %}

package managers are a surprising medium to spread viruses, especially when the virus is latched onto a dependency of `babel-eslint` 😱
Guido van Rossum steps down as Python's BDFL, thoughts?
Tags: python, discuss
Published: 2018-07-12 17:02:29

---
title: Guido van Rossum steps down as Python's BDFL, thoughts?
published: true
description: 
tags: python, discuss
---

## [Announcement here](https://mail.python.org/pipermail/python-committers/2018-July/005664.html)

Lots of quotable items, but it's a short letter so you should just click through and read. Very notable for the software community, what are your thoughts on the matter?
Ways to enhance your DEV posts! Useful embeds.
Tags: meta, embeds
Published: 2018-07-12 16:46:23

---
title: Ways to enhance your DEV posts! Useful embeds.
published: true
description: Ways to embed content from Speaker Decks to GitHub, Codepen, Glitch, Runkit, and more!
tags: meta, embeds
---

In alphabetical order, here are our current liquid tag embed options, with the syntax you'll need to include them in your posts :) 

# 1. Codepen

You'll need the full link of the pen:

`{% codepen https://codepen.io/cassidoo/pen/NbOzKg %}`
{% codepen https://codepen.io/cassidoo/pen/NbOzKg %}


# 2. DEV

### a) Comment
You'll need the id at the end of the comment url/permalink:
`{% devcomment 40fh %}`
{% devcomment 40fh %}

### b) Podcast Episode
Only available for podcasts found on [https://dev.to/pod](https://dev.to/pod), you'll need the full link. Email us (yo@dev.to) if you'd like your podcast included. 
`{% podcast https://dev.to/basecspodcast/s2e2--queues-irl %}`
{% podcast https://dev.to/basecspodcast/s2e2--queues-irl %}

### c) Post
You'll need the full link of the post: 
`{% link https://dev.to/kazz/boost-your-productivity-using-markdown-1be %}`
{% link https://dev.to/kazz/boost-your-productivity-using-markdown-1be %}

### d) User
You'll only need a username:
`{% user ben %}`
{% user ben %}

# 3. GitHub

### a) Gist
You'll need the full link of the gist: 
`{% gist https://gist.github.com/QuincyLarson/4bb1682ce590dc42402b2edddbca7aaa %}`
{% gist https://gist.github.com/QuincyLarson/4bb1682ce590dc42402b2edddbca7aaa %}

### b) Issue
You'll need the full link of the issue or comment: 
`{% github https://github.com/thepracticaldev/dev.to/issues/242 %}`
{% github https://github.com/thepracticaldev/dev.to/issues/242 %}

### c) Repository
You'll only need the username / repo name: 
`{% github thepracticaldev/dev.to %}`
{% github thepracticaldev/dev.to %}

# 4. Glitch
You'll only need the project slug: 
`{% glitch beautiful-cubes %}`
{% glitch beautiful-cubes %}

# 5. Instagram
You'll only need the post id: 
`{% instagram BXgGcAUjM39 %}`
{% instagram BXgGcAUjM39 %}

# 6. Twitter
Using the Twitter Liquid tag will allow the tweet to pre-render from the server, providing your reader with a better experience. All you need is the tweet id from the url.
`{% twitter 733908215021199360 %}`
{% twitter 733908215021199360 %}

# 7. repl.it 
All you need is the URL after the domain name:
`{% replit @WigWog/PositiveFineOpensource %}`
{% replit @WigWog/PositiveFineOpensource %}

# 8. Runkit Embed
Put executable code within a runkit liquid block, as follows:
```
{% runkit %}
console.log("Place javascript here!"); 
{% endrunkit %} 
```
{% runkit %}
console.log("Place javascript here!"); 
{% endrunkit %} 

# 9. Speaker Deck
This is a little more complicated. You'll want to pull the embed code for the slides on Speaker Deck, and then pull the id from that code: 
`{% speakerdeck 28cc127475184084ab94fb05a4ed8f4d %}`
{% speakerdeck 28cc127475184084ab94fb05a4ed8f4d %}

# 10. YouTube 
You'll only need the video id: 
`{% youtube 9z-Pdfxxdyo %}`
{% youtube 9z-Pdfxxdyo %}
Bootstrap alternatives, which one do you prefer and why?
Tags: bootstrap, frontend, webdesign, html
Published: 2018-07-12 14:26:58

---
title: Bootstrap alternatives, which one do you prefer and why?
published: true
description: 
tags: bootstrap, front-end, web design, html
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/tyqdiniizxu2d4v9ivjh.png">
Angular SEO Done Right with Server-Side Rendering [Live Demo]
Tags: javascript, webdev, showdev, angular
Published: 2018-07-13 14:02:45

---
title: Angular SEO Done Right with Server-Side Rendering [Live Demo]
published: true
tags: javascript, webdev, showdev, angular, 
canonical_url: https://snipcart.com/blog/angular-seo-universal-server-side-rendering
---

![SEO-Friendly Angular SPA: Universal Server-Side Rendering Tutorial](https://snipcart.com/media/203638/devdensm-2x.png)

Google's JavaScript crawling & rendering is still a somewhat obscure issue.

Contradictory statements and experiments are found all over the web.

So what does this mean?

*As a developer, you NEED to optimize sites built with popular JS frameworks for SEO.*

With that in mind, here's the third part of our ongoing JavaScript Frameworks SEO issues series:

1. [Building a prerendered Vue.js app](https://snipcart.com/blog/vuejs-tutorial-seo-example)
2. [Applying React SEO with Next.js](https://snipcart.com/blog/react-seo-nextjs-tutorial).
3.  Here, I'll be tackling Angular SEO.

More precisely, we'll be crafting **a server-rendered Angular e-commerce SPA using Universal**.

Here are the steps we'll use to achieve this:

 1. Setting up an Angular project.
 2. Creating Angular components.
 3. Enabling e-commerce functionality on our SPA.
 4. Using Universal to make our Angular app SEO-friendly
 
This should be fun!

## Why bother with Angular SEO? Isn't Angular Google-backed?

![angular-seo](https://snipcart.com/media/203693/angular-logo.png)

[Angular](https://angular.io/) is an open source JS framework developed by Google engineers in 2010.

It's great to complete your [headless stack](https://snipcart.com/blog/headless-angular-ecommerce-app) or any [JAMstack](https://snipcart.com/blog/jamstack-clients-static-site-cms)  for that matter. But it still shares common SEO issues known to JavaScript frameworks.

JS single-page apps add content to pages dynamically with JavaScript. This isn't optimal for SEO: crawlers most likely won't run the JS code, thus not encountering the  actual content of the page.

  

→ Read the full post & technical tutorial [here](https://snipcart.com/blog/angular-seo-universal-server-side-rendering)
Recommendation Shopping
Tags: php, framework, googleapi
Published: 2018-07-12 13:29:43

---
title: Recommendation Shopping
published: true
description: like trivago
tags: php,framework,google api
---

# web online shopping recommendation system

Ini adalah Sistem berkenaan tentang recommended barang di website ecommerce.

Ia terdiri dari 4 bahagian utama.
* utama
* admin
* kerani
* user

### paparan utama
___
* "index/register" **Sign Up**
* "login/enter" **Log In**


### paparan admin
___
* "homeadmin/website/list" **Website**
* "homeadmin/item/list" **Item**
* "homeadmin/category/list" **Category**
* "homeadmin/rating/list" **Rating**


### paparan kerani
___
* "homeadmin2/rating" **Rating**
* "homeadmin2/website" **Website**


### paparan user
___
* "homeuser/search" **Search**
* "homeuser/trend" **Trend**
* "homeuser/logout" **Logout**



# Standard
http://www.php-fig.org/psr/psr-4/

# Sumber ilham dari 
http://jream.com/lab
https://github.com/amin007/mvc-melayu

# pautan untuk muat turun
https://github.com/amieraahza/recommended-system
Minimum Viable Product Rollout with ReactJS and Serverless Architecture
Tags: react, serverless, aws, mvp
Published: 2018-07-12 12:28:37

---
title: Minimum Viable Product Rollout with ReactJS and Serverless Architecture
published: true
description: 
tags: react, serverless, aws, mvp
cover_image: https://thepracticaldev.s3.amazonaws.com/i/tf0m3mbp4h3v451ktpbm.png
---

Recently, I joined a new organisation, [Supahands](http://supahands.com)!
As my first assignment, I was supposed to assess a few front-end frameworks for one of our products. It was a challenging task for me and I learned a lot through the process.

![yaay](https://thepracticaldev.s3.amazonaws.com/i/e0gii478k3kyj8oc0cnf.gif)

---

<b>Story</b> - For our new product, we had four frameworks in our mind. <b>React / Vue / Angular / Ember.</b> 
After a few days of evaluation, we came to a conclusion that <b>ReactJS</b> is a perfect fit.

The product's goal was pretty simple to achieve. It was a simple CRUD operations app, with a few more service-calls to retrieve some data.
We already had a running product with Ruby On Rails + PostgreSQL stack.
After inspecting our objectives, we realised that we needed to adapt to better technologies and architecture.

<b>We were trying to achieve the following things:</b>
* Move our business logic to independent services (AWS Lambda).
* Introduce new UI design and Template System for the application.
* Write a Client-Side application in React.
* Restructure our current database and migrate to DynamoDB.
* Automate CI processes and current deployment strategies with the help of AWS CloudFormation. Our business logic is tightly-coupled with the deployment stack.

<b>And why were we doing this?</b>
* To minimize the cost.
* To re-use services in other products.
* To have a Client-Side single-page application.
* To maintain and share a common database with multiple applications.

---

###And... did we achieve our targets? <b>YES!</b>

![woohoo](https://thepracticaldev.s3.amazonaws.com/i/pzj1qescolcc7pb0zm2h.gif)

---

<b>What did I do in the process?</b>
* I participated in the app's UI design process. I converted those designs into JSX templates with the help of Bootstrap. 
* I successfully wrote code with React for our Client-Side application (from scratch).
* I deployed our React app to AWS. 
* Adapted myself to Serverless architecture. And, still learning...
* I wrote backend services in Python 3.6 for AWS Lambda.
* I designed a better structure of the database in AWS DynamoDB.


<b>Why was it challenging?</b>
* I was working with React and AWS for the first time.
* I had no idea how Serverless technologies work.
* I have never worked on a front-end framework on my own from scratch to go-live.

<b>So, what's next?</b>
* Improve the app's code base.
* Add test cases for front-end app.
* Add Redux for state management.
* Make the app mobile-friendly.

---

Special thanks to <b>dev.to</b> and <b>the community</b>. I have referred a lot of threads for React and Serverless development!

![Thank you](https://thepracticaldev.s3.amazonaws.com/i/s7ndt66xxefe0nhkauld.gif)

---
Find Greatest Number Using Ternary Operator
Tags: javascript, math, c, ternaryoperator
Published: 2018-07-12 09:45:22

---
title: Find Greatest Number Using Ternary Operator
published: true
description: Find Greatest Number Using ternary Operator
tags: javascript, math,C,Ternary Operator
---


```

 
var a=62;
var b=200;
var c=8;
var largestnumber = (a>b&&a>c?a:(b>a&&b>c?b:c));
alert(largestnumber);


```
3 tools for your Linux shell that can change your life
Tags: linux, opensource
Published: 2018-07-13 12:58:38

---
title: 3 tools for your Linux shell that can change your life
published: true
tags: Linux,Open Source
canonical_url: https://daniele.tech/2018/07/3-tools-for-your-linux-shell-that-can-change-you-life/
---

It is since a lot that I want to write something about my VIm configuration but I think that is too soon, so I chosen to talk about something that can be useful to everyone.

The post [3 tools for your Linux shell that can change you life](https://daniele.tech/2018/07/3-tools-for-your-linux-shell-that-can-change-you-life/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Add text on image in ReactNative
Tags: reactnative
Published: 2018-07-12 05:20:45

---
title: Add text on image in ReactNative
published: true
description: 
tags: reactnative
---
If you want to put a simple text(like status or category) on an image, using `ImageBackground` is very useful.

```react
<ImageBackground
  source={{ uri: hoge }}
  style={{
    height: 100,
    width: 100,
    position: 'relative', // because it's parent
    top: 2,
    left: 2
  }}
>
  <Text
    style={{
      fontWeight: 'bold',
      color: 'white',
      position: 'absolute', // child
      bottom: 0, // position where you want
      left: 0
    }}
  >
    Hello World
  </Text>
</ImageBackground>
```

Put the <Text> component as a child of `<ImageBackground>` and tweak the position as you want.
¿Hay personas de México o América Latina posteando aquí en Dev.To?
Tags: mexico, latam, startup, español
Published: 2018-07-12 01:01:40

---
title: ¿Hay personas de México o América Latina posteando aquí en Dev.To?
published: true
description: El objetivo es conectar con latinos en esta plataforma.
tags: mexico, latam, startups, español
---

Hola a todos los devs latinos que están en esta plataforma, soy parte de una startup mexicana llamada Pixcomp donde desarrollamos videojuegos, apps y proyectos creativos en general.

¿Cuantos latinos mas hay por aquí?
Python: unicode characters by name
Tags: python, beginners
Published: 2018-07-12 00:57:18

---
title: Python: unicode characters by name
published: true
description: 
tags: python, beginners
---
Hey all 🤘!
Did you know you can display unicode characters in python by their name? Like this:

```python
>>> '\N{SIGN OF THE HORNS}'
'🤘'
>>> '\N{KANGXI RADICAL HAND}'
'⼿'
>>> '\N{VICTORY HAND}'
'✌'
```
I didn't.
[Docs](https://docs.python.org/3/howto/unicode.html#the-string-type)
Twitter, stop annoying me with "In case you missed it" notifications
Tags: twitter, greasemonkey, workaround
Published: 2018-07-11 22:38:51

---
title: Twitter, stop annoying me with "In case you missed it" notifications
published: true
description: greasemonkey script to at least hide this notifications
tags: #twitter #greasemonkey #workaround
cover_image: https://thepracticaldev.s3.amazonaws.com/i/zodkrf89m3xqtyu30sx3.jpg
---
not long ago i noticed many notifications i got on twitter (yeah i don't really use twitter). logged in and looked into my notifications: no retweets, no liked your tweet, no new follower, ... only all these "in case you missed" notifications with no way to disable them.

googled a little bit and only found people who asked how to disable them but didn't find solutions. thank you twitter *not*

it annoyed me so much, that i wrote a small [greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) script:

```
$('ol#stream-items-id > li[data-component-context="generic_activity"]').hide();
```
this breaks the continuous loading of older notifications. the workaround is to resize the browser window, then the loading is triggered.

of course the notification dot indicator still shows such notifications as new but at least they don't clutter everything.

- link: https://www.reddit.com/r/Twitter/comments/8c2dtv/how_to_remove_in_case_you_missed_it_notifications/

- cover image by Pexels: https://pixabay.com/en/girl-grass-nature-summer-cute-1839623/
Grails: Mocking domain objects/criteria that reference Joda Time objects
Tags: grails, gorm, spock, todayilearned
Published: 2018-07-11 21:12:41

---
title: Grails: Mocking domain objects/criteria that reference Joda Time objects
published: true
description: How to setup your unit tests with Grails and Spock when your domain objects have fields that are not primitive or domain objects, for example Joda's DateTime object
tags: grails, gorm, spock, todayIlearned
---

I can rant about the difficulties of handling time correctly when programming like anyone else who has ever tried. I can also criticize the default date and time objects in Java, but I will just say this: Just use Joda Time. You can also take a peek at an article I wrote a while back for [more details](https://smartbear.com/blog/develop/date-and-time-manipulation-in-java-using-jodatime/). I even use Joda Time in my domain objects in Grails.  It requires a small amount of configuration, but it is well worth it.  See the [plugin](https://grails.org/plugin/joda-time?skipRedirect=true) for more details.

Where things get a bit more complicated is when I want to test my GORM criteria when the criteria involves an `org.joda.time.DateTime`.  For example:


    /** My domain object */
    class Membership {
      User user
      DateTime memberSince
    }

    /** My service */
    class MembershipService {
      boolean transactional = true

      /** Return users who have been around for at least 5 years */
      List<User> findOldUsers() {
        Membership.createCriteria().list() {
          user {
            eq('deleted', false)
          }
          lte('memberSince', new DateTime().minusYears(5))
        }
      }
    }


Now, the test:

    @Mock([Membership, User])
    @TestFor(MembershipService)
    class MembershipServiceSpec extends Specification {
      def "findOldUsers does not return anything if all the users have been around less than a year"() {
        given:
          User u1 = new User().save() 
          // or save(false) if there are constraints we want to ignore for the time being)
          new Membership(user: user, memberSince: new DateTime().minusMonths(4)).save();

        expect:
          service.findOldUsers().isEmpty()
      }
    }

What happens? well....

    java.lang.IllegalArgumentException: Property [memberSince] is not a valid property of class [com.mycompany.Membership]

Of course, the GORM mocking framework doesn't know about DateTime, so it didn't register it as a property of Membership.  To fix this, all we need to do is, first tell the mocking framework about Joda Time classes, and second, we have to mock our domain objects **after** we mock the Joda Time classes.  

    import grails.plugin.jodatime.simpledatastore.SimpleMapJodaTimeMarshaller
    @Mock(User)
    @TestFor(MembershipService)
    class MembershipServiceSpec extends Specification {
      setup() {
        SimpleMapJodaTimeMarshaller.initialize()
        mockDomain(Membership)
      }

      // [...]
    }
Rails: increment counter cache and return value
Tags: rails, hack, activerecord, ruby
Published: 2018-07-11 20:46:53

---
title: Rails: increment counter cache and return value
published: true
description: Small ActiveRecord hack that you can use everyday.
tags: rails, hack, activerecord, ruby 
---

What will you do if you have to in/decrement counter cache column and get it actual value via single query?. Learn how to hack ActiveRecord to do this in easy and pretty cool way.

http://jetrockets.pro/blog/rails-increment-counter-cache-and-return-value
Modifying url with laravel 
Tags: laravel
Published: 2018-07-11 20:18:07

---
title: Modifying url with laravel 
published: true

  Hello everyone.I am trying to modify my blog url in laravel. but it says 500 Internal Server Error.Trying to get property id of non object. Can someone explain it for me please. what exactly is the problem. If you need more info about this pleas reply--
tags: Laravel
---
Github Discovery feed Tutorial
Tags: machinelearning, deeplearning, ai, github
Published: 2018-07-11 20:02:20

---
title: Github Discovery feed Tutorial
published: true
description: 
tags: machine learning, deep learning, AI, Github
---

We've been playing around with deep learning on the public Github datasets. It's been fun, let me know if the recommendations are any good:

https://github.getstream.io/

It’s not 100% perfect yet, but working on it :) Tutorial about the deep learning is available here: https://getstream.io/blog/building-an-end-to-end-deep-learning-github-discovery-feed/
Python Requests with retries
Tags: python, requests, retry
Published: 2018-07-11 18:19:15

---
title: Python Requests with retries
published: true
description: 
tags: python, requests, retry
---

###Note to self

*Thanks a ton to [Peter Bengtsson](https://www.peterbe.com/)*


This will setup up a function which as a drop-in replacement to the `requests.get` call can let you make requests with retries. 

```
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry


def requests_retry_session(
    retries=3,
    backoff_factor=0.3,
    status_forcelist=(500, 502, 504),
    session=None,
):
    session = session or requests.Session()
    retry = Retry(
        total=retries,
        read=retries,
        connect=retries,
        backoff_factor=backoff_factor,
        status_forcelist=status_forcelist,
    )
    adapter = HTTPAdapter(max_retries=retry)
    session.mount('http://', adapter)
    session.mount('https://', adapter)
    return session

```

Some testing is always good. 

```
t0 = time.time()
try:
    response = requests_retry_session().get(
        'http://httpbin.org/status/500',
    )
except Exception as x:
    print('It failed :(', x.__class__.__name__)
else:
    print('It eventually worked', response.status_code)
finally:
    t1 = time.time()
    print('Took', t1 - t0, 'seconds')
```

###Intuition
The algorithm for that backoff is documented [here](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#module-urllib3.util.retry):
A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). urllib3 will sleep for: {backoff factor} * (2 ^ ({number of total retries} - 1)) seconds. If the backoff_factor is 0.1, then sleep() will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer than Retry.BACKOFF_MAX. By default, backoff is disabled (set to 0).