teleren/devto huggingface dataset:
Rage Against the Routine
Tags: remote, freelance, routine, schedule
Published: 2018-06-30 23:19:27

---
title: Rage Against the Routine
published: true
description: Routine issues with remote working/ freelancing
tags: #remote #freelance #routine #schedule
---

If you are a remote worker, and a freelancer. You may have found yourself struggling with finding the perfect routine that works for you. This is not a post that will lay out the magic ingredients for a healthy work life balance and the meaning of life. After almost 8 years of freelancing I still struggle with getting in a routine! 

I have found as a developer my most productive hours start after 2 am. When there is no noise or distraction, which is a price for working from home, that is not always mentioned as a side note, with the 'Work from Home' label. If you do not have an isolated workplace at home, then probably like me you struggle for privacy during the day and try your best to concentrate in a client's meeting with all the background noise.

Human body is not meant to be awake late night, catching up on sleep in the day does not mean a good night's sleep. It takes toll. After trying numerous times to start a morning routine, I have still fallen back to a night routine. Which makes me curious to know about other work from home freelancers like myself, who have young kids at home, What works for you and what doesn't. What does routine really mean for you? Please post in comments your tips, thoughts.
What each sorting algorithm is good for
Tags: computerscience, algorithms, sort, programming
Published: 2018-06-30 22:37:56

---
title: What each sorting algorithm is good for
published: true
description: Some nice properties of sorting algorithms many don't aware of
tags: computer science, algorithms, sort, programming
---

Anyone who has been through a CS school or into learning sorting algorithms should be well aware that today's most accepted algorithm is [quicksort](https://en.wikipedia.org/wiki/Quicksort), since it boasts an average case of `O(n log n)` run times. Some algorithms with much less efficiency, such as [insertion sort](https://en.wikipedia.org/wiki/Insertion_sort), which incurs on average `O(n * n)` time might be less favorable. However, there are many edge cases in which each may surprisingly shine brighter than the others.

## Quicksort
The go-to sorting algorithm, quicksort's efficiency relies on two factors--its pivot or partitioned element and the [entropy](https://en.wikipedia.org/wiki/Entropy_(order_and_disorder)) of the source array. If the array is partially or substantially sorted, and/or the pivot element is chosen in a way that it is closer to the start or end of the array, it can easily degrade to `O(n * n)`.

## Insertion Sort
Although insertion sort seems slow, when used on a small array of data, is quite efficient. Its `O(n * n)` quadratic run time can upgrade to a respectable `O(n * k)`, where `k` is the steps it needs to tread back up the array to swap the previous element with the current one. Also, if the array is partially or already substantially sorted, insertion sort will shine even brighter than quick sort, which will perform quite poorly in such case. The reason being the mentioned `k` is very little because it does not need to go back up the array often.

## Selection Sort
A pretty simple algorithm with a pretty neat `O(1)` constant space complexity. Although its run time is quadratic, it has a magical property of retaining the first N-sorted elements when run N times on an array. What does this mean? It means that if your sorted data is to be paginated and ordered i.e. search results, you only need to run selection sort algorithm that many times. Once you need the next set of results, you can resume where you left off and so on.
Great github threads
Tags: github, discuss, softwaredevelopment
Published: 2018-06-30 22:26:44

---
title: Great github threads
published: true
description: Interesting github threads where you can learn about software development
tags: github, discussion, software development
---

My favourite part about Github are the discussions. Like Twitter, Github allows you to watch the comments and code of well known software developers and have a pick of their way of thinking. The code is interesting, but a lot of times the code lacks the *WHY*. Why the team or the developer chose to use a pattern or a design or why a feature made it to a language or not.

You can see how big projects evolved thanks to issues, commits and PRs, and you can even participate in the debates and of course in the code. Before Github, all this information was in projects' newsletters, forums, chats... The information was more difficult to find and it would last less.

Below there are a list of some Github threads that I considered interesting and worth of bookmarking. All of them, except for the last one, are about JavaScript, because it is my main language right now. Do you know any other great Github threads? Issues, PRs or maybe a gist that created an good discussion? Please leave it in the comments, I really love learning from others' points of views and their arguments. 

+ [Promises are not monads](https://github.com/promises-aplus/promises-spec/issues/94) Promises could have been very different if it wasn't for some opinionated developers that really wanted them to be like they are. 

+ [Promisify/awaitable in node](https://github.com/nodejs/CTC/issues/12) Another one about promises and why the *promisify* function was added to node.

+ [Immutable issue about typescript](https://github.com/facebook/immutable-js/issues/341) Discussion of ways of creating immutable data structures that work with typescript.

+ [About ngrx/store and immutable.js](https://github.com/ngrx/store/issues/23) Immutable.js has trade offs as any other library. Immutability is great, but in JavaScript it is not idiomatic and it creates some friction...

+ [Browserify and webpack](https://gist.github.com/substack/68f8d502be42d5cd4942#gistcomment-1365101) Browserify can do most of what webpack does, and even more in some cases, great gist and good discussion about the two tools.

+ [One line modules](https://github.com/sindresorhus/ama/issues/10#issuecomment-117766328) Sindre Sorhus about one line modules and why npm made the *"utils scripts"* folders irrelevant.

+ [Node-chakracore](https://github.com/nodejs/node/pull/4765) About adding the Microsoft core for JavaScript into Node.

+ [Linus Torvalds being... Linus Torvalds](https://github.com/torvalds/linux/pull/17#issuecomment-5654674) The last pearl in the list is not about JavaScript and not about a great discussion. Sometimes github allows you to see the bad parts of software development too. Linus is famous for being rude and coarse, this is just one of the multiple examples.
BxJS Weekly Ep. 17 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-06-30 21:31:33

---
title: BxJS Weekly Ep. 17 - javascript news podcast
published: true
description: Listen to the best javascript news of the week in a podcast form
tags: javascript, node, podcast, news
---

Hey dev.to community!

BxJS Weekly Episode 17 is now out! 🚀
Listen to the best javascript news of the week in a podcast form right here.
You can find all the mentioned links [here on github](https://github.com/BuildingXwithJS/bxjs-weekly/blob/master/episodes/Episode-17-2018-06-30.md).

You can also watch [this episode on youtube](https://youtu.be/mD_2Kdgngtc).

Any feedback is appreciated 😁

Additional stuff:
- [Twitch channel](https://www.twitch.tv/yamalight)
- [Discord server](https://discord.gg/hnKCXqQ)
- [BxJS Weekly github repo](https://github.com/BuildingXwithJS/bxjs-weekly)
It’s Hard To Keep A New Team Doing Continuous Delivery
Tags: culture, devops, database, career
Published: 2018-06-30 21:17:06

---
title: It’s Hard To Keep A New Team Doing Continuous Delivery
published: true
description: The framework I used earned trust at first...but was eventually abandoned.
tags: #culture #devops #databases #career
---

Sometimes I get an opportunity to use a technology that not only solves a business problem, _but that I really like_!

When a client was burned by a prior vendor that couldn't deliver their software project, they needed to see progress made quickly.

The product was supposed to be a set of complicated visual dashboards that pulled in data from a bunch of different healthcare systems.

At the time of this project, deploying these types of software systems was a manual, error prone process.

So I wanted to _introduce a framework I'd built and used on other projects before_.

It could be used to automatically "promote" software releases between dev/test/production environments (like many of us do today with other tools).

But **I'd never used it to deploy data warehouses and their dashboards**.

The lead on the project was resistant at first.

Though he understood the concept, _he just hadn't seen it done before_.

And the client was concerned about the implications of releasing to production early in the project.

In this video, I share how the framework I used earned trust at first...but was eventually abandoned.

I still had many things to learn about how to support my own software frameworks!

Visit my site to watch the full video (or listen as a podcast):

# [📺 Watch or 🎧 Listen](https://jaymeedwards.com/2018/06/26/its-hard-to-keep-a-new-team-doing-continuous-delivery/)

<hr />[🔔 Subscribe for over 100 videos on healthy software development](https://YouTube.com/c/JaymeEdwardsmedia?sub_confirmation=1)
PWA vs. native app
Tags: discuss
Published: 2018-06-30 19:06:49

---
title: PWA vs. native app
published: true
tags: discuss
---

I recently browsed the webs looking for an iPhone app for dev.to, but did not find any. On the other hand, I think the mobile site is excellent. All it would have saved me is a few clicks.

I started wondering: what benefits does a native app really have, compared to a well designed progressive web app (PWA)? Which way(s) did you pick, and why?
Prefer Ruby Class Method or Mix-In Instance Method?
Tags: discuss, ruby, programming
Published: 2018-06-30 17:10:20

---
title: Prefer Ruby Class Method or Mix-In Instance Method?
published: true
description: 
tags: discuss, ruby, programming
---

Assume that a certain functionality is available in Ruby both as a class method and as an instance method (via a module).

Class method:

    require 'foo'  
    Foo.foo()  

Instance method (via module):

    require 'bar'    
    include Bar    
    bar()    

Assuming that the two methods behave identically, which would you prefer using, and why?

(Note that the question is not about which to implement, but instead about which to use if both available.)
Outstanding Morning Developer Track at WordCamp Grand Rapids 2018
Tags: featured, geek, developers, speakers
Published: 2019-08-07 16:11:05

---
title: Outstanding Morning Developer Track at WordCamp Grand Rapids 2018
published: true
tags: Featured,Geek,developers,speakers
canonical_url: https://www.timnolte.com/2018/06/30/outstanding-morning-developer-track-at-wordcamp-grand-rapids/
---

![](https://i0.wp.com/www.timnolte.com/wp-content/uploads/sites/4/2018/06/IMG_20180630_090734813.jpg?resize=720%2C405&ssl=1)

What an outstanding group of talks on the Developer track at #WordCamp Grand Rapids this morning. Been/RJ/Michelle did an outstanding job. #WCGR #WordPress

![](https://i2.wp.com/www.timnolte.com/wp-content/uploads/sites/4/2018/06/IMG_20180630_102214412.jpg?resize=720%2C405&ssl=1)

The post [Outstanding Morning Developer Track at WordCamp Grand Rapids 2018](https://www.ndigitals.com/articles/outstanding-morning-developer-track-at-wordcamp-grand-rapids/) appeared first on [Nolte Digital Solutions](https://www.ndigitals.com).
What does it mean to commit responsibly?
Tags: devdiscuss, programming
Published: 2018-06-30 15:39:44

---
title: What does it mean to commit responsibly?
published: true
description: In the pursuit of a loose-ish definition.
tags: ["devdiscuss","programming"]
---

I'm working on a list of what it means to "commit responsibly." What would you change/add to this?

 __Committing responsibly__
 
 1. Using meaningful variables
 1. Not committing bugs or broken builds
 1. Not leaving in dead code or print statements
 1. Formatting code to style specifications
 1. Using descriptive commit messages
 1. Only committing code related to the change described in the message (one change per commit)
 1. Providing documentation where necessary
 1. Providing tests where necessary
Switch aws-cli's profile
Tags: awscli
Published: 2018-06-30 15:32:02

---
title: Switch aws-cli's profile
published: true
description: 
tags: aws-cli
---

If you have a multiple aws account, you should want to switch these accounts.

Aws-cli provides `AWS_DEFAULT_PROFILE` environment variable. When you use aws-cli, use profile in this variable.

You can easily switch profile with using the following code.

```bash
awsc () {
  export AWS_DEFAULT_PROFILE=$(grep -oE "(\[).+(\])" ~/.aws/credentials | tr -d [] | peco)
}
```

Please put this code to .bash_profile.

You can select a profile in your credential.

Note: Dependency
- [peco](https://github.com/peco/peco)
Did you know CSS has over 400 unique properties
Tags: css, showdev, javascript
Published: 2018-06-30 15:27:50

---
title: Did you know CSS has over 400 unique properties
published: true
description: css knowledge
tags: css, showdev, javascript
---

I didn't know either until I did this.

```javascript
var element = document.createElement("div");
var count = 0;
for (var index in element.style) count++;
console.log(count); // 413
```
ターミナルにカレントリポジトリを表示させる方法
Tags: git, japanese
Published: 2018-06-30 07:26:03

---
title: ターミナルにカレントリポジトリを表示させる方法
published: true
description: 
tags: git, japanese
---

https://qiita.com/varmil/items/9b0aeafa85975474e9b6

Unix環境であればこちらの記事が参考になります。

Windowｓ環境下のGit Bashにも表示させたかったのでwgetの代わりにbitsadminを使用しました。

```
bitsadmin /TRANSFER 適当なジョブ名 https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh ダウンロードしたい場所のフルパス/.git-prompt.sh

```

でファイルを落として後はUnix系と同じく.bashrcに
```
if [ -f $HOME/.git-prompt.sh ]; then
  source $HOME/.git-prompt.sh
fi
GIT_PS1_SHOWDIRTYSTATE=1
export PS1='[\w$(__git_ps1 " (%s)")]\$ '
```

こんな感じに書いた後```$ source ~/.bashrc```で表示できました。
Terraform becomes a programming language (2018)
Tags: ngs, rant, systemadministratio
Published: 2020-04-01 06:47:31

---
title: Terraform becomes a programming language (2018)
published: true
date: 2018-06-30 06:00:57 UTC
tags: NGS,Rant,System administratio
canonical_url: https://ilya-sher.org/2018/06/30/terraform-becomes-a-programming-language/
---

# Declarative languages failure

Approach that in my eyes failed, again and again, is to start with your own declarative language and then with time grow the language. (SQL being among notable exceptions)

Puppet is the best example. [map](https://puppet.com/docs/puppet/4.10/function.html#map) and [each](https://puppet.com/docs/puppet/4.10/function.html#each), added in Puppet 4.0.0 are, in my opinion, just two in a sea of evidence that the envisioned simple format has failed to handle the needs of the real world.

Ansible’s [loop](https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html) looks bad as the whole idea of making top levels of programs in YAML based syntax (and the rest in Python).

In my opinion, it makes more sense to create a language first and then libraries for it, not a library and then a language around it.

# My hope for Terraform

I think Terraform guys are smart. Among other things, it manifests in implementing [data sources](https://www.terraform.io/docs/configuration/data-sources.html). Data sources make Terraform much more flexible. I think it’s very clever.

Terraform, which started declarative, are now [inventing their own programming language](https://www.hashicorp.com/blog/terraform-0-1-2-preview). They are going the way of Puppet and Ansible. **I hope they can do better** , in this awkward situation: there are quite a lot of constraints on the programming language because of the existing syntax and semantics.

Happy coding, everyone!
Setting up a server in express.js 
Tags: expressjs, javascript
Published: 2018-06-30 04:30:25

---
title: Setting up a server in express.js 
published: true
description: summary sheet
tags: express.js, JavaScript 
---

Does anyone else like writing/drawing out their notes?

![express.js notes](https://thepracticaldev.s3.amazonaws.com/i/d4azo5krfdv0gxux7h8x.png)
Google Summer of Code - can any organizations help me contribute?
Tags: discuss, opensource, gsoc
Published: 2018-06-30 04:25:14

---
title: Google Summer of Code - can any organizations help me contribute?
published: true
description: 
tags: discuss,open-source,gsoc
---

I'm still an undergrad, and the GSoC program has fascinated me. I've browsed a lot of organizations, and just wanted to know if there are any people on Dev.to who could guide me to contribute more to their open source projects featured on GSoC. 
I can work with Python, C/C++, JavaScript, and Golang.

Do let me know if you can help!
Wait for MongoDB, Postgres or MySql to start on Docker
Tags: mongodb, docker, node, postgres
Published: 2018-06-30 01:20:46

---
title: Wait for MongoDB, Postgres or MySql to start on Docker
published: true
description: This script makes it possible to wait for MongoDB to be up before using it.
tags: mongodb, docker, nodejs, postgres
cover_image: https://thepracticaldev.s3.amazonaws.com/i/x7jizm44m4d6g50yx5xx.jpg
---
[Originally posted in my blog](https://blog.hdias.dev/wait-mongodb-mysql-on-docker)

_Quick tip here_. 

I was struggling to get this thing working so I need to share with you guys.

Assuming that you have an app depending on a **MongoDB** container:

```yml
version: "3.3"
services:
  web:
    build: .
    volumes:
      - "./app:/src/app"
    ports:
      - "3030:3000"
    links:
      - mongo
    depends_on:
      - mongo
  mongo:
    container_name: mongo
    image: mongo
    volumes:
      - ./data:/data/db
    ports:
      - "27017:27017"
volumes:
  mongo_data:
```

In my case it's a **NodeJS** app. 

The MongoDB is quite slow to get up, so when the app starts, the linked container is ready but not the database itself.

To solve this problem you can use a script to explicitly wait for MongoDB service to be up.

Add this to your `Dockerfile`

```sh
FROM node:latest

RUN mkdir /src


WORKDIR /src
ADD app/package.json /src/package.json
RUN npm install

EXPOSE 3000

## THE LIFE SAVER
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait

## Launch the wait tool and then your application
CMD /wait && npm start
```

And now change your `docker-compose.yml` file and adds a `WAIT_HOSTS` section

```yml
version: "3.3"
services:
  web:
    build: .
    volumes:
      - "./app:/src/app"
    ports:
      - "3030:3000"
    links:
      - mongo
    depends_on:
      - mongo
    environment:
      WAIT_HOSTS: mongo:27017
  mongo:
    container_name: mongo
    image: mongo
    volumes:
      - ./data:/data/db
    ports:
      - "27017:27017"
volumes:
  mongo_data:
```

And that's it.

You can use it for any other service such as `Postgres`, `MySQL`, etc ...

To do this you just need to use commas:

```yml
version: "3"

services:

  mongo:
    image: mongo:3.4
    hostname: mongo
    ports:
      - "27017:27017"
  
  postgres:
    image: "postgres:9.4"
    hostname: postgres
    ports:
      - "5432:5432"

  mysql:
    image: "mysql:5.7"
    hostname: mysql
    ports:
      - "3306:3306"
      
  mySuperApp:
    image: "mySuperApp:latest"
    hostname: mySuperApp
    environment:
      WAIT_HOSTS: postgres:5432, mysql:3306, mongo:27017
```

Hope it helps
passport.js deserializeUser working for webapp but not for android app
Tags: help
Published: 2018-06-29 23:07:24

---
title: passport.js deserializeUser working for webapp but not for android app
published: true
tags: help
---


Heyy I am using passport.js local strategy for authentication.The code is working accordingly for webapp or from any browser but when i send a POST request from mobile app then it is not able to deserilize the user .What could be possible issues with this?
Ruby Segmentation Fault When Running RSpec
Tags: help, ruby, rspec, rails
Published: 2018-06-29 21:12:56

---
title: Ruby Segmentation Fault When Running RSpec
published: true
tags: help, ruby, rspec, rails
---

So I've been getting this `segmentation fault` error, which from what I've been hearing and reading it's a low-level Ruby error. It happens when I run all specs via a bin command: `bin/rspec`. I've run into this error a few times now, and for whatever reason it's resolved itself in an hour or two. I'm not running any super memory-consuming tests, and given that our CI runs it just fine 100% of the time, I don't think it's the tests.

Here's a snippet of the log:
```
............................................................................................../Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/2.5.0/open-uri.rb:408: [BUG] Segmentation fault at 0x000070000dfbf4b0
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0080 p:---- s:0452 e:000451 CFUNC  :write
c:0079 p:---- s:0449 e:000448 CFUNC  :<<
c:0078 p:0011 s:0444 e:000443 METHOD /Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/2.5.0/open-uri.rb:408
c:0077 p:0012 s:0438 e:000437 BLOCK  /Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/2.5.0/open-uri.rb:353
c:0076 p:0007 s:0434 e:000433 METHOD /Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/2.5.0/net/protocol.rb:433
c:0075 p:0018 s:0429 e:000428 METHOD /Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/2.5.0/net/protocol.rb:424
c:0074 p:0166 s:0424 e:000423 METHOD /Users/andyzhao/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/webmock-3.3.0/lib/webmock/http_lib_adapters/net_http_response.rb
```

I'm running macOS High Sierra 10.13.5 with 8 GB of RAM.

Here's are links to the last three crash report files via Google Drive if anyone's interested:
https://drive.google.com/file/d/1G7sPOquIDTHUTh-qhwJ7AKIgtaw7MNNh/view?usp=sharing

https://drive.google.com/file/d/1OIAhfZAtclNd2YZ6FG_zRYDYBd2eHG6p/view?usp=sharing

https://drive.google.com/file/d/1qeGIhKYAp1HlxK7LaijuB26AQt8NGjpL/view?usp=sharing