teleren/devto huggingface dataset:
Does the college degree matter nowadays?
Tags: programming, interview, career, resume
Published: 2018-05-26 13:24:51

---
title: Does the college degree matter nowadays?
published: true
description: 
tags: programming, interview, career, resume
---


This question is frequently asked nowadays as evidences show that many people dropped the college and they are now famous such as Mark Zuckerberg and Bill Gates.

For me, I always believe in Mathematics which says that 1+1=2 and it never going to be 0 or 3; and every rule has exception or abnormal state. Mark and Bill are the exception case not the default case. There are lots of factors in the equation that brought to us people like them. Imagine if Bill failed to build Microsoft, what would he do then? Imagine if Mark failed to market Facebook, what would he be?...etc. The intelligence only is not enough to make you a success person. You need many many things such as luck, circle around you, initial budget, on time right decisions, vision, suitable environment, conscious people and well study to the market need.

I know that world is not like before. Now, Internet and communication tools are everywhere. You can learn anything anytime. But, let me give you an example that I live. Mike sent his CV to me that shows he built many good applications that might bring good income to him. He works with Java or React-Native to build mobile Apps. Another one called Stephan, his CV says that he works with Java too, HTML5 and JavaScript. Both are good candidates (according to the screening). However, I noticed that Mike dropped the college and studied online courses while Stephan graduated from faculty of Computer Science.

I called both for interview. I asked both the same questions such as:

    1- Describe how garbage collection works in Java?
    2- Does Java use pointer? If yes, how does it work?
    3- What are the 3 sections of RAM? How your application variables get allocated?
    4- You use tools to check the memory utilization, explain it?
    5- How debugger works?

You can imagine the answers of both. Some people says such questions do not matter as such knowledge are not important to build applications. I disagree. Knowing such science and knowledge gives you the ability to build very strong application that can adapt and live for long time. It also let you use the development tools in the best way. It reduces the number of bugs and prohibits repeating of such bugs. It gives you the power of building enterprise critical applications such as Telecom where millions of users are in charge of your system.

Science is important whatever happened. To be good software engineer, you need to study the science of the development tool and technologies you use.
Whack-A-Frump
Tags: javascript
Published: 2018-05-26 10:18:13

---
title: Whack-A-Frump
published: true
description: Play Whack-A-Frump
tags: javascript
---

![image](https://thepracticaldev.s3.amazonaws.com/i/tbmqbxfng3r45cuymjo1.png)


Ronald Frump, the infamous president of Beaver Land, has finally had a game made in his honor. The JavaScript used here is very minimal. Specifically, animejs is utilized for simple positioning animation. 

Play the game here:

<p data-height="265" data-theme-id="dark" data-slug-hash="OZKRWb" data-default-tab="html,result" data-user="howtocodejs" data-embed-version="2" data-pen-title="whack-a-frump" class="codepen">See the Pen <a href="https://codepen.io/howtocodejs/pen/OZKRWb/">whack-a-frump</a> by Howtocodejs (<a href="https://codepen.io/howtocodejs">@howtocodejs</a>) on <a href="https://codepen.io">CodePen</a>.</p>

<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

>Challenge: Improve on the game by increasing the difficulty.
.gitattributes templates
Tags: git, showdev, gitignore, gitattributes
Published: 2018-05-26 10:01:10

---
title: .gitattributes templates
published: true
canonical_url: https://izsak.net/weblog/900/gitattributes-templates/
description: Create .gitattributes file for your project with https://gitattributes.io/ service
tags: git, showdev, gitignore, gitattributes
---


[gitattributes.io](https://gitattributes.io) is a service for generating `.gitattribute` files from templates. The service is inspired by [gitignore.io](https://www.gitignore.io) where you can quickly bootstrap your `.gitignore` files.

Choose templates on web interface, or use the very simple API to list template names and generate new `.gitattribute` file content.

To generate `.gitattributes` file for you web project, just call:

```
https://gitattributes.io/api/web
```

Working on a C++ project in Visual Studio? Separate multiple template names with a comma:

```
https://gitattributes.io/api/c++,visualstudio
```

The list of all template names is available at `api/list` endpoint:

```
https://gitattributes.io/api/list
```

This service was made possible by the project from **alexkaratarakis** who created the original [alexkaratarakis/gitattributes](https://github.com/alexkaratarakis/gitattributes) repository with `.gitattributes` templates. You can contribute to **gitattributes.io** project at [github.com/gitattributes](https://github.com/gitattributes)
... Or how I learned to stop worrying and love the magic
Tags: design, productivity
Published: 2018-05-26 09:25:30

---
title: ... Or how I learned to stop worrying and love the magic
published: true
description: 
tags: design, productivity
---
There was a time in my career when I'd want to do everything myself. I'd rationalise it away as learning how to do things, but I'd be much happier if I was doing things myself rather than depending on others to have already done it.

This ranged from small things - 3d maths libraries, for example - up to huge things - I once wrote a fully compliant websockets server using only Java NIO!

Over time I got less attached to this and more embraced existing libraries. After all, they were written by very clever people, and already did everything that I needed. For example, using the websockets support in Spring instead. This, obviously enough, made me significantly more productive - reinventing everything is a slow process, and a relatively pointless.

However, I still shied away from "magic" if I didn't write it myself. 

> Side note: what is magic? It's anything where the exact outcome works but you can't immediately see *why* or *how* it works.

This meant I was happy to use Spring, but stayed away from Spring Boot - preferring to wire everything up by hand so I could see it all.

And, over time, even this has changed. I recently wrote a mock server for work, using Spring Boot, Spring Starter, Spring Shell. Heck, I even used component scanning. (That still does make me feel dirty, but for what I feel are very good reasons - it's very difficult to scale up to medium or large systems and still know how it works...)

And you know what? The magic isn't scary. It works. It does exactly what it's meant to, and it lets you do everything else.

That mock server, from start to end, too about 3 hours. Old me would have spent a week on it! How's that for productive...
How would you rewrite this Python code?
Tags: python, codereview, refactoring, discuss
Published: 2018-05-26 08:40:09

---
title: How would you rewrite this Python code?
published: true
description: Every way I can think of is either too messy, too verbose, or overkill.  Can you think of a better way?
tags: python, codereview, refactoring, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ye3g6y7a7locj63h4tqi.jpg
---

I ran across this problem while [writing some code for a challenge](https://dev.to/r0f1/write-a-simple-but-impactful-script-7ba).

I have some [code](https://gist.github.com/dmoney/1de8f451f58b899ce5650d37c22da2be) that I want to write to a particular file if a filename is provided, or standard output if not:

```python
with (open(filename, 'w') if filename else sys.stdout) as file:
    do_something(file)
```

That `with` line is a bit long, and doesn't seem readable at a glance.  I could put the `open` outside the `with`:

```python
f = open(filename, 'w') if filename else sys.stdout
with f as file:
    do_something(file)
```

The file should be closed when the `with` is exited.  I'm done with `stdout` in this case, but I could just have well have wanted to use it for other things later on in the program.  But the worst thing about this way of doing it seems to be that making a habit of using `open` outside a `with` expression could lead to forgetting to close files.

I could go the try/finally route:

```python
try:
    f = open(filename, 'w') if filename else sys.stdout
    do_something(f)
finally:
    if f is not sys.stdout:
        f.close()
```

But this seems a bit verbose and reminds me too much of Java, which, as a rule of thumb, probably means it's not [Pythonic](http://docs.python-guide.org/en/latest/writing/style/).

I could write a [context manager](https://docs.python.org/3/library/contextlib.html) to hide the "check if it's stdout and close it" logic:

```python
from contextlib import contextmanager

@contextmanager
def file_or_stdout(fname):
    if fname:
        f = open(fname, 'w')
        yield f
        f.close()
    else:
        yield sys.stdout

with file_or_stdout(filename) as file:
    do_something(file)
```

This seems pretty clear, but it also might be overkill.  I'm leaning toward this though, as it leaves the `do_something` block plenty of room for clarity, and I could extract the `file_or_stdout` function into a utility library so it's not cluttering up the file.

Any thoughts?
Paging Github
Tags: githubpages, reading, bookmark
Published: 2018-05-26 08:12:37

---
title: Paging Github
published: true
description: Tutorial link on Github pages and Jekyll
tags: #githubpages #reading #bookmark
---

Bookmark this [tutorial] (http://jmcglone.com/guides/github-pages/) to get up and running in the span of an afternoon! 😍
Quick hack for using google translate (or other services) in Nuxt/Vue.js
Tags: beginners, javascript, vue, nuxt
Published: 2018-05-26 07:37:48

---
title: Quick hack for using google translate (or other services) in Nuxt/Vue.js
published: true
description: Quick hack for using google translate (or other services) in Nuxt/Vue.js
tags: beginner, javascript, vuejs, nuxtjs
---

Hey guys, here's a quick way of making google translate play nice using setInterval. 

```js
export default {
    mounted: function()
    {
        this.$nextTick(() => {
            this.googleTranslateInit();
        });

    },

    methods: {

        googleTranslateInit: function() {

            let checkIfGoogleLoaded = setInterval(() => {

                if (google.translate.TranslateElement != null) {
                    clearInterval(checkIfGoogleLoaded);

                    this.googleTranslateElement('google_translate_element');
                }

            }, 100);

        },

        googleTranslateElement: function(id) {
            new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, id);
        }

    },
};
```
It's not always easy to have a nice callback available for google translate, especially if you're nested into a component. I'm only using NUXT's [external resources](https://nuxtjs.org/faq/) setup for directly loading the library, and ignored creating a plugin for this (although I think that's still valid, to [create a script and use an onLoad function](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement)
How to Run Ecto Migrations on Production
Tags: elixir, ecto
Published: 2018-04-27 03:15:42

---
title: How to Run Ecto Migrations on Production
published: true
description: How to Run Ecto Migrations on Production.
tags: Elixir, Ecto
---

You'd think the answer to this question would be a simple Google search away. Unfortunately, that wasn't the case for me this afternoon, working on a [Phoenix](http://phoenixframework.org/) project with a newly-added [Ecto](https://hexdocs.pm/ecto/getting-started.html) backend. In an effort to save others (and let's be honest, future me) the same frustration, here's the most straight-forward solutions I found.

## What Doesn't Work

[`Mix`](https://elixirschool.com/lessons/basics/mix/). `Mix` tasks aren't compiled into your deployed release, and as evidenced in [this exciting discussion](https://github.com/bitwalker/exrm/issues/67), there's no plans to change this any time soon.

So don't try using your trusty local `mix ecto.migrate` task on production. Not gonna help you here.

## What Does Work

### 1. [Ecto.Migrator](https://hexdocs.pm/ecto/Ecto.Migrator.html)

Ecto ships with [Ecto.Migrator](https://hexdocs.pm/ecto/Ecto.Migrator.html), a first-class module for Ecto's migration API.

Run it manually by ssh'ing onto your app server, attaching to your Phoenix app, and running the following:

```
path = Application.app_dir(:my_app, "priv/repo/migrations")

Ecto.Migrator.run(MyApp.Repo, path, :up, all: true)
```

Ideally, you'd wrap up the above in its own task that can be called during your build and deployment process. Check out Plataformatec's blog for a [nice example](http://blog.plataformatec.com.br/2016/04/running-migration-in-an-exrm-release/).


### 2. eDeliver

Our app uses [`edeliver`](https://github.com/edeliver/edeliver) for deployments, and it has a super handy command for manually running migrations:

```
mix edeliver migrate production
```

If we peek at the source, turns out this command actually just [wraps up `Ecto.Migrator` for you](https://github.com/edeliver/edeliver/blob/963610a90f67fc3671127e64df37a67ec365ef5b/lib/edeliver.ex#L124), saving some precious keystrokes.

To run successfully, you'll need to add `ECTO_REPOSITORY="MyApp.Repo"` to your `.deliver/config` file.

Again, Plataformatec has a nice blog post on [deploying your Elixir app with eDeliver](http://blog.plataformatec.com.br/2016/06/deploying-elixir-applications-with-edeliver/).


## Summary

Hi future me! Hope this post was still helpful the nth time around.

### References:

- [Phoenix Ecto Integration](https://github.com/phoenixframework/phoenix_ecto)
- [Ecto.Migrator](https://hexdocs.pm/ecto/Ecto.Migrator.html)
- [eDeliver](https://github.com/edeliver/edeliver)
How much code coverage is enough?
Tags: testing, coverage, discuss
Published: 2018-05-26 01:35:48

---
title: How much code coverage is enough?
published: true
description: 
tags: testing, coverage, discuss
cover_image: http://i.stack.imgur.com/A7gNf.png
---
I have always thought that code coverage can be looked at in a similar way as availability According to the SRE handbook, a system should be as available as it needs to be anything more is wasted effort for the value returned. In a similar way it may be possible to test 100% of your code but does it really return value for the effort it takes to implement? Google even aims for 85%. It is also worth noting language plays a big part in how practical and easy it is to implement tests. So I leave it to you how do you decide what coverage may be appropriate for a certain project?
[WIP] Makker: An platform for real-time online games, written in Go.
Published: 2018-05-26 00:55:57

---
title: [WIP] Makker: An platform for real-time online games, written in Go.
published: true
description: Makker is an online platform for playing games in real time with people from anywhere in the world.
---

# What I built

To be frank, this project for me has been a lesson in time and scope management. I spent too long thinking about the idea and too little time building. I was hoping to at least have something demo-ale by today, but I don't. It's nearly 3AM, and I value my sleep, so que sera sera, I'm just submitting the code I have right now.

I'll write a more elaborate post-mortem when I wake up tomorrow morning, although I don't really want to call this a postmortem, since I don't consider the project dead. I'll definitely continue working on this.


## Demo Link

[coming soon](https://www.youtube.com/watch?v=rTyN-vvFIkE)

## Link to Code

[Github Repo](https://github.com/bigblind/makker)

# How I built it 

I'll expand on this, but:

- Go on the back end
- ReactJS on the front end
- Google App Engine for serving the app.
ActionChat to spread positive energy and motivation!
Tags: pushercontest, reactnative, expo, javascript
Published: 2018-05-25 23:58:56

---
title: ActionChat to spread positive energy and motivation!
published: true
description: A mobile app that fosters motivational conversations to help people take action for a productive day. An entry to #pushercontest.
tags: pushercontest, react-native, expo, javascript
---

# What I built

ActionChat is an iOS and Android chat app that specializes in spreading positive energy!  Its easy to use.  Simply select a time to chat and at that time your chat window will open for five minutes.  Spread and receive as many positive messages as possible in those five minutes.

The intended use for this app is to set it for a time in the morning just after you wake up.  Then you get access to the chat for five minutes and get flooded with positive energy to help you start your day off right!  So what are you waiting for?  Download ActionChat today!  Special shoutout to [Pusher](https://pusher.com/) for powering the chat functionality with their awesome [Channels API](https://pusher.com/channels)!

## Demo Link

This app is published on [Expo](https://expo.io/).  Download their [client app](https://expo.io/tools#client) to run any expo app on your phone.  The link to ActiveChat is: https://expo.io/@andrewsverdrup/active-chat

## Link to Code

The code is located on GitHub here: https://github.com/AndrewSverdrup/ActionChat

# Tech stack

* [Pusher Channels API](https://pusher.com/channels)
 - Powers the chat functionality
* [React-Native](https://facebook.github.io/react-native/)
 - Mobile app framework
* [Expo](https://expo.io/)
 - Mobile app SDK to simplify cross-platform app creation
* [Create React Native App](https://github.com/react-community/create-react-native-app)
 - Boilerplate to get started with React-Native and Expo
* [Google Cloud Functions](https://cloud.google.com/functions/)
 - For Pusher Channels Authentication endpoint (b/c serverless is cool)
 - My cloud function code can be found here: https://github.com/AndrewSverdrup/ActionChatCloudFunction
The MONSTER at the end of this Book
Tags: productivity, leadership, career, funny
Published: 2018-05-25 22:32:13

---
title: The MONSTER at the end of this Book
published: true
description: 
tags: productivity, leadership, career, funny
---

![](https://thepracticaldev.s3.amazonaws.com/i/rr827u7xctyn5bthp4qy.jpeg)

![](https://thepracticaldev.s3.amazonaws.com/i/qhe1ha7v1rfjamfws2ba.jpeg)
Afraid of writing codes in JavaScript
Tags: javascript, php, discuss
Published: 2018-05-16 06:43:20

---
title: Afraid of writing codes in JavaScript
published: true
description: 
tags: javascript, php, discuss
---

I started out my career in PHP. I have developed quit a few websites aswell and love to write codes and currently trying to get comfortable with PHP OOP. But one thing I see around is Javascript and TBH it just scares me.

I tried to overcome this fear by following few tuts developing just the basic operations. But I didn't get over it. And moreover I love to develop application more in PHP as comapred to JavaScript maybe due to the fact that am not familier with any JavaScript framework like Vue React Node.

As I said I tried learning Javascript but each tut I follow makes me sleep, as am just getting bored of reading those basics all over again, but the fact I want to accept is that I still unaware of many basic facts in Javascript and moreover what I personally think is learning on live project is way more fun then just applying few basic operations, may be just the test app. But for that I need to have basic knowledge of the syntax and all.

And many devs suggests to learn JavaScript and farmeworks and start developing apps in it rather then sticking with PHP. 

And now am thinking of learning Javascript a resource like Laracasts.com, the way Jeff teaches, a teacher who won't put you to sleep with examples and all.

And one more thing should I learn and continue with Javascript mainly or just basics are enough and I should learn a framework.

Your advice and guidance is really appreciated.

Thanks
[AskDev] How do You get Started?
Tags: discuss, career, beginners
Published: 2018-05-25 20:08:46

---
title: [AskDev] How do You get Started?
published: true
description: What are the best techniques when starting on a new team?
tags: discuss, career, beginners
cover_image: https://www.twincities.com/wp-content/uploads/2017/10/mooseb1.jpg
---
As of today, I'm completing my first week of a summer internship, and I've spent ~90% of my time just getting "set up". This means installing personal and company dev tools, understanding relevant codebases, and most importantly, troubleshooting when setup isn't working.

It's been pretty difficult, and I'm sure there's ways to improve my experience.

![alt text](https://i.imgur.com/t4Fbq7j.gif "Time to Break out Emacs and modify that perl script!")

###**What are some things you suggest someone do when joining a new company, a new team, or even a new project?**
Changelog: Badges!
Tags: meta, changelog
Published: 2018-05-25 19:48:10

---
title: Changelog: Badges!
published: true
description: They will be unique and funky designs that add character to your DEV Profile
tags: meta, changelog
---

[dev.to](/) members can now receive badges for being awesome. We have rolled out a couple so far: one for having had a post appear in the weekly must-read roundup, and another for longevity.

![](https://cl.ly/2h2Y2s1A2u3s/Image%202018-05-25%20at%203.34.29%20PM.png)

They'll appear on folks' profiles as a collage of sorts, with different tilts depending on the database ID of the awarded badge instance.

We've wanted to do something like this for a while, but we wanted it to actually be fun — not just "Internet Points".

## Our goals for the badges:

- They will be unique and funky designs that add character to your DEV Profile.
- They will reward things that align with good community values. Some will be based on objective achievements and some will be individually awarded by other community members based on taste and quality.
- They will be fairly rare. While some will be for everyone, they aren't going to be something you just get for doing every little action.

Carry on with your days. The badges probably will not affect your lives in any major way, but they will hopefully add a bit of extra character to our community platform.

Happy coding. ❤️