teleren/devto huggingface dataset:
How to connect Datagrip (or any intellij IDE) with Heroku Postgres
Tags: postgres, heroku, intellij, datagrip
Published: 2019-05-30 00:25:10

---
title: How to connect Datagrip (or any intellij IDE) with Heroku Postgres
published: true
tags: postgres,heroku,intellij,datagrip
canonical_url: 
---

[UPDATE Sept 2020]:

Extra `sslmode=require` needed for it to work.

[ORIGINAL]:

> Heroku Postgres forces you to use SSL, but the connection isn’t signed with a well-known CA. To get this to work in DataGrip, you have to mess around with some JDBC settings. Here’s how to do it:

> In the add connections dialog, enter the username, password, hostname, port, and database name. You’ll have to enter these manually, because DataGrip’s URL support only works with JDBC database URLs, not the more common Postgres URLs used by Heroku.

> Next, click on the Advanced tab. Then find the ssl property and set it to true. Then find the sslfactory property and set it to org.postgresql.ssl.NonValidatingFactory.

> You should be good to go!

[Getting Jetbrains DataGrip to work with Heroku Postgres · Andy Fiedler](http://andyfiedler.com/2016/02/getting-jetbrains-datagrip-to-work-with-heroku-postgres)
A Guide to Developer Productivity: 5 Healthy Habits & Tools
Published: 2018-05-17 18:49:06

---
title: A Guide to Developer Productivity: 5 Healthy Habits & Tools
published: true
tags: 
canonical_url: https://snipcart.com/blog/guide-developer-productivity-tools
---

![A Guide to Developer Productivity: 5 Healthy Habits & Tools](https://snipcart.com/media/203621/developer-productivity-habits.jpg)

On paper, software and web development is a structured, orderly process.

But **developing IRL?** It's mostly chaos:

[Technical decisions](https://snipcart.com/blog/guide-choosing-tech-stack-client-work), [new stacks](https://snipcart.com/blog/jamstack-clients-static-site-cms), social notifications, shoulder taps, calls, meetings, family duty, GIFs... SLACK!

```JS
try{
    Work();
}
catch(ChaosOverloadException ex){
    Logger.LogFatal("(╯°□°）╯︵ ┻━┻ ", ex);
    Tables.FlipAllOfThem();    
}
```

No wonder maintaining developer productivity is an everyday struggle.

Believe me, I know: it's a major pain point in our dev team's day-to-day. 

So I decided to try and 
do
 write *something* about it.

Hopefully that something&mdash;let's get fancy and call it a "Guide to Developer Productivity"&mdash;will help us and other devs strive towards healthy productivity.

This post will cover **5 dev productivity habits with relevant tools for developers to help you follow each one**.

There's money, energy and maybe tears to be saved in what follows.

Shall we?

## 5 developer productivity habits + useful tools

#### Quick links

+ 1. [Tailoring a strict schedule](#schedule)
+ 2. [Writing testable code](#testing)
+ 3. [Eliminating distractions](#distractions)
+ 4. [Asking for help](#help)
+ 5. [Preserving mental health](#health)

Unproductive development time is costly to 1) yourself and 2) your clients.

Stack up too much of it and it might jeopardize self-esteem, motivation, professional relationships and your own money.

So, how to fix?

***

→ Read the full guide [here](https://snipcart.com/blog/guide-developer-productivity-tools)
Explain RPC like I'm Five
Tags: explainlikeimfive
Published: 2018-05-17 09:14:43

---
title: Explain RPC like I'm Five
published: true
description: Explain RPC like I'm Five
tags: Explain Like I'm Five 
---

I'm having a little trouble understanding RPC, especially compared to say Rest API's or using protobufs to send and receive data, so please explain RPC like I'm Five?
Dave explains it all
Tags: beginners
Published: 2018-05-17 07:52:10

---
title: Dave explains it all 
published: true
description: Just a quick hello
tags: beginner
---

# Saying Hello!

I'm here, I normally blog over at medium, but I think it's a good idea to branch out all over and see what the communities bring you.

Find me @

 [Gram](https://www.instagram.com/debug_dave/)

 [Twit](https://twitter.com/DavidJamesMitt1)

 [Medium](https://medium.com/@davidjamesmitten)


Happy coding :)

debug_dave
Vowpal Wabbit Docker Image
Tags: docker, linux, machinelearning
Published: 2023-04-29 21:21:44

---
title: Vowpal Wabbit Docker Image
published: true
date: 2018-05-17 07:33:43 UTC
tags: docker,linux,machinelearning,ml
canonical_url: https://mikestaszel.com/2018/05/17/vowpal-wabbit-docker-image/
---

[Vowpal Wabbit](https://github.com/JohnLangford/vowpal_wabbit) is a really fast machine learning system.

A few months ago I put together a Docker image of Vowpal Wabbit, making it easy to run on any platform. It’s been sitting up on Github and the [Docker Hub](https://hub.docker.com/r/crimsonredmk/vw/), but I forgot to write a blog post! So here it is:

[https://github.com/mikestaszel/vowpal\_wabbit\_docker](https://github.com/mikestaszel/vowpal_wabbit_docker)

You can download and run Vowpal Wabbit with one command – here is an example:

```
docker run --rm --volume=$(pwd):/data -t crimsonredmk/vw /data/click.train.vw -f /data/click.model.vw --loss_function logistic --link logistic --passes 1 --cache_file /data/click.cache.vw
```

Enjoy!

<!--kg-card-end: html-->
Looking for Open Source Projects to contribute
Published: 2018-05-17 06:26:37

---
title: Looking for Open Source Projects to contribute
published: true
---
Hey Folks,I'm an experience Software Developer with below experience level - Java, J2EE, Python(beginner, but I have worked on some django-web project and automating some daily stuffs), JS(not frequent user but I have used many of the times, many frameworks), ML(very much beginner, in learning stage). Please reach me out. I would love to contribute on any open source project and also ready to experiment with new frameworks too. Thanks!

tags: #OpenSource #Contribution
---
Count the number of identical objects in List[_]
Tags: scala, newbie, 30secondstoread
Published: 2018-05-17 06:10:18

---
title: Count the number of identical objects in List[_]
published: true
description: 
tags: scala, newbie, 30SecondsToRead
---

Let's assume we have a list of objects

```scala

case class Cake(id: Int, name: String, expired: Long)

val l = List(Cake(1,"keks"), Cake(1,"keks"), Cake(1,"keks"), Cake(4,"pie"))
```

start to count

```scala
l.groupBy(_.id).map(pair => (pair._1, pair._2.length))

// res0: scala.collection.immutable.Map[Int,Int] = Map(4 -> 1, 1 -> 3)
```
good, but what if we wanna get all object as a key

```scala
l.groupBy(_.id)
  .map({
    case (_, items) => items.head -> items.length
  })

// res1: scala.collection.immutable.Map[Cake,Int] = Map(Cake(4,pie) -> 1, Cake(1,keks) -> 3)
```

Match better. When pull request with this code come to review I get comment from my colleague

`head` is not safety so it's bad

So, we need to change it
```scala
l.groupBy(_.id)
  .map({
    case (_, items) => items.headOption.map(_ -> items.length)
  })
// res2: scala.collection.immutable.Iterable[Option[(Cake, Int)]] = List(Some((Cake(4,pie),1)), Some((Cake(1,keks),3)))
```
And then beautiful trick with `List[Option[_]]`
```scala
l.groupBy(_.id)
  .map({
    case (_, items) => items.headOption.map(_ -> items.length)
  }).flatten

//res3: scala.collection.immutable.Iterable[(Cake, Int)] = List((Cake(4,pie),1), (Cake(1,keks),3))
```

finishing touch

```scala
l.groupBy(_.id)
  .flatMap({
    case (_, items) => items.headOption.map(_ -> items.length)
  })

//res4: scala.collection.immutable.Iterable[(Cake, Int)] = List((Cake(4,pie),1), (Cake(1,keks),3))
```

Question:  *Do you agree with my colleague opinion?*
Assembly Lines are the next wave of DevOps
Tags: devops, ci, cd
Published: 2018-05-17 05:41:13

---
title: Assembly Lines are the next wave of DevOps
published: true
description: Take your DevOps game to the next level with DevOps Assembly Lines.
tags: DevOps, ci, cd
---

Assembly Lines are the next wave of DevOps. Hope you all agree.
You can compare this to a mechanical engineering approach of a car assembly lines which transformed from highly custom cars created manually, to automated parts production with manual assembly, to fully automated assembly lines.

We call this approach “Assembly Lines (AL) for DevOps”.

An Assembly Line approach has the following characteristics:

> Connect "Islands of automation" into an end to end workflows that enable toolchain collaboration.

> Define workflows as code with a common, declarative specification language that is easy to learn and templatize, and versioned.

> Gain end-to-end visibility with rich logistics that support management, insights, and audit capability.

> Integrate with technical stacks and application architectures of today and the future with a simple plug-and-play model.

It's time to take your DevOps game to the next level. I want you to know and learn more about the 'DevOps Assembly Lines' approach so here is a free whitepaper to download: http://bit.ly/devopswhitepaper
why can't we use multiple types on input fields?
Tags: css, frontend
Published: 2018-05-17 04:57:37

---
title: why can't we use multiple types on input fields?
published: true
description: 
tags: #css #frontend
---

I have tried and failed to find a pure CSS way of making a password-styled input field also pull up a numeric keypad on mobile on Firefox. (Deprecated support of `text-security: disc` on `type=number` inputs, for one failed example.)

It seems like this problem would be solved if we could say an input had types of both `password` and `number` or `tel`. 

What is it about how how `input` works makes us unable to design browsers this way?
Should you reply to recruiters?
Tags: career, recruiters, jobhunting
Published: 2018-05-17 03:49:53

---
title: Should you reply to recruiters?
published: true
description: What have people's experiences with recruiters been like?  What should I watch out for?
tags: career, recruiters, jobhunting
---

I got an e-mail from a recruiter today, off my LinkedIn profile, about a potential job opportunity.  I do like the idea of someone finding me jobs without having to do as much legwork myself, but I haven't tried to get a job through a recruiter before.

I did reply, but I'm wondering what people's experiences with recruiters have been like?  I've heard people complain about them, but is there anything I should watch out for?
Renderless EventBus component for Vue.js
Tags: vue, eventbus
Published: 2018-05-17 03:37:37

---
title: Renderless EventBus component for Vue.js
published: true
description: Component interface to subscribe to events through the EventBus singleton.
tags: Vue.js,EventBus
---

# Assumptions:

This article assumes you know about the neat little trick to use Vue as an event bus to communicate between your components. If not, read the article [Creating a Global Event Bus with Vue.js](https://alligator.io/vuejs/global-event-bus/) by [Joshua Bemenderfer](https://twitter.com/@tribex_).

# Why?

I started off using the EventBus in my components and the implementation looked like this,

```js
  mounted() {
    EventBus.$on('some-event', this.handleEvent)
  },
  destroyed() {
    EventBus.$off('some-event', this.handleEvent)
  }

```

This got a little cluttered as the number of events increased and the worse part? you can forget turning off the events.

# Solution

The two solutions the came up to my mind were,
1. Mixin to auto destroy events
2. A dummy component that handles the `mounted` and `destroyed` logic.

Personally, I don't like mixins which is why I didn't even think twice about the point 1.

The dummy component seemed more fun to write. Additionally, event listeners in html templates looked a lot better than their JS counterpart (and it conforms to the idea behind https://vuejs.org/v2/guide/events.html#Why-Listeners-in-HTML).

This is how the component for EventBus looks like,

```js
import _ from 'lodash'
import { EventBus } from '../common/eventBus.js'

export default {
  data() {
    return {
      events: Object.keys(this.$listeners),
      methods: _.mapValues(this.$listeners, (value, key) => this.handleEvent.bind(this, key))
    }
  },
  mounted() {
    this.events.forEach(event => {
      this.methods[event].SOMETHING = event
      EventBus.$on(event, this.methods[event])
    })
  },
  destroyed() {
    this.events.forEach(event => {
      EventBus.$off(event, this.methods[event])
    })
  },
  methods: {
    handleEvent(name, ...args) {
      this.$emit(name, ...args)
    }
  }
}

```


The demo is up at https://codesandbox.io/s/k5v2owk8v7.

# Footnotes

This is my first ever post on any platform so looking forward to your comments.
What Makes Ghost.org So Successful?
Tags: startup, businessmodels, indiehackers, ghostblog
Published: 2019-11-14 03:57:59

---
title: What Makes Ghost.org So Successful?
published: true
date: 2018-05-17 00:00:00 UTC
tags: startup,business-models,indiehackers,ghost-blog
canonical_url: https://www.zakmiller.com/posts/ghost-org/
---

Ghost.org, the markdown blogging non-profit, released a [blog post](https://blog.ghost.org/5/) covering its five-year journey to $82,000 in monthly recurring revenue and a customer list that includes Apple, Mozilla, and Cloudflare.

The post itself is great, especially if you’re interested in open-source software, but the most insightful bit wasn’t in the post itself. John O’Nolan (of Ghost) did a sort of AMA on [Indie Hackers](https://www.indiehackers.com/forum/5-years-3m-no-investors-everything-we-learned-building-the-1-cms-on-github-ama-0ac99b72d7), after writing the article.

The Ghost Foundation is a non-profit that works on the open-source technology Ghost. They make their money through a paid solution called Ghost(Pro), where **they host and manage blogs written in Ghost**.

A commenter noted that he saw complaints all over the internet about Ghost(Pro)’s high price, and asked why the price was higher than people would expect (~20 dollars rather than ~10).

John responded with a detailed answer that I recommend you read in full. The gist is that they price their product very deliberately. **Their goal is to have ~4000 customers, and they just charge the amount of money necessary to keep the number of customers constant**. If demand increased sharply, they would increase their prices until they got about 4000 customers again. If demand fell, and the number of customers fell below 4000, they would decrease their prices.

That blew me away. Yes, of course, if you increase your prices you will get fewer customers, and if you decrease your prices you will get more customers (depending on elastic vs inelastic demand, and all that).

I never considered that a business model would center around keeping the number of customers constant. You suddenly look at customer acquisition and pricing differently.

His method wouldn’t make much sense for an app that scales well, but when your business model is hosting websites it makes sense to be extremely conscious of how many websites you’re hosting.

I’m tempted to say that it’s unusual that a non-profit would come up with such an interesting approach to pricing, but maybe it’s not strange. Maybe when you’re a little distanced from the profits you’re also more likely to innovate. Regardless, John’s thoughtfulness will serve the Ghost Foundation well in the future, and I look forward to his next blog post.

_Originally published at_ [_https://www.zakmiller.com_](https://www.zakmiller.com/posts/ghost-org/) _on May 17, 2018._
Stoicism & Coding
Tags: webdev
Published: 2018-05-16 22:01:00

---
title: Stoicism & Coding
published: true
description: For the past several months I've been studying a philosophy known as Stoicism and I think a lot of developers could benefit from it.
tags: webdev
cover_image: http://developmentmatt.com/wp-content/uploads/2018/05/marcus-aurelius-2721715_1280.jpg
---

For the past several months I've been studying a philosophy known as [Stoicism](https://dailystoic.com/what-is-stoicism-a-definition-3-stoic-exercises-to-get-you-started/). I became interested in the subject after reading [Meditations](https://en.wikipedia.org/wiki/Meditations) by Marcus Aurelius. I took a handful of philosophy courses in college and I've always enjoyed the subject, but Stoicism is different.

I'm by-no-means an expert – I'm not an expert at anything – but if I were to define Stoicism, at least as it is to me, I would define it as such:

Stoicism is a philosophy that teaches us that current moment is all we have, nothing is permanent, and to concern ourselves only with things that are within our control.

So what does this have to do with web development or coding? Good question, Internet person. The answer is: I've come across a lot of wise words that I thought paired nicely with web development and its culture. I wanted to share these words with the hope that it might help or inspire someone.

I considered explaining my interpretation to each quote and how it relates to coding, but after writing a few I worried that I could be limiting the quotes to only my experience. That said, I'd love to discuss them with you. Feel free to hit me up on [Twitter](https://twitter.com/DevelopmentMatt).

Note: all of the following quotes were gathered from [Daily Stoic](https://dailystoic.com/stoic-quotes/), which is an amazing resource (more on that at the end).

> “It never ceases to amaze me: we all love ourselves more than other people, but care more about their opinion than our own.” – Marcus Aurelius

> “I begin to speak only when I’m certain what I’ll say isn’t better left unsaid.” – Cato

> “When we are no longer able to change a situation, we are challenged to change ourselves.” – Viktor Frankl

> “If a man knows not which port he sails, no wind is favorable.” – Seneca

> “How does it help…to make troubles heavier by bemoaning them?” – Seneca

> “First say to yourself what you would be; and then do what you have to do.” – Epictetus

> “If anyone tells you that a certain person speaks ill of you, do not make excuses about what is said of you but answer, ‘He was ignorant of my other faults, else he would have not mentioned these alone.'” – Epictetus

## Further Reading

[Daily Stoic](https://dailystoic.com/)
As mentioned above this site is a great resource for all things Stoicism. Ryan Holiday is arguably at the center of modern Stoicism. I can't recommend his books enough. I give The Obstacle is the Way a read.

Meditations by Marcus Aurelius

Letters from a Stoic by Seneca

Discourses and Selected Writing by Epictetus

[Originally Posted on DevelopmentMatt.com](https://developmentmatt.com/stoicism-coding/)
Hitting refresh
Tags: learning, empathy, startup, communication
Published: 2018-05-18 11:51:10

---
title: Hitting refresh
published: true
tags: learning,empathy,startup,communication
canonical_url: https://medium.com/dolittle/hitting-refresh-9d5961370f1d
---

![](https://cdn-images-1.medium.com/max/1024/1*8sQWAJE-NnO6TMMGgxk4HQ.png)

Unlearning is one of the hardest parts with any transition. You bring with you many years of experiences, expectations and biases. These have built up over time through different work situations you have adapted to. Past experiences allow you to hit the ground running when it comes to work and communication. They can also be heavy baggage, slowing you down. In a startup this baggage could be the very thing that’s holding you back. You’re looking at completely new problems with views that don’t match your situation.

Here at Dolittle, we’re hitting refresh on many of our previous assumptions. Looking at old problems with fresh eyes. How we approach our coding practices. How we are working with customers. How we are approaching contracts. How we are building products. We’re re-learning, and allowing our culture to grow.

> “If your mind is empty, it is always ready for anything, it is open to everything. In the beginner’s mind there are many possibilities, but in the expert’s mind there are few. ” -[Shunryu Suzuki](https://www.goodreads.com/quotes/17022-if-your-mind-is-empty-it-is-always-ready-for)

An example is communication. Coming from a very distributed team, a few of us wanted a more formal process. More documentation, more written communication. This is important down the line as we grow, but not so much in the beginning when priorities change almost daily.

Hitting refresh is an important part of starting anything new. Making it explicit that you need to take a step back and reconsider your expectations. You’re going to have new problems and you can’t deal with them if your focusing on solving the problems you had in the past. At the same time, it’s importatnt to leverage universal learnings and principles. It’s also important to recognise the context in which those are valid.

Are they **really** valid to you now?

_Photo by [rawpixel](https://unsplash.com/photos/qsCGtoDHNoM?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/reload?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

* * *

_This post appeared originally on the [Dolittle blog](https://medium.com/dolittle/hitting-refresh-9d5961370f1d)_
Rest in peace, grep!
Tags: cli, linux, rust, tools
Published: 2018-05-16 21:16:00

---
title: Rest in peace, grep!
published: true
tags: [cli, linux, rust, tools]
canonical_url: https://abhnv.com/blog/2018/05/16/rip-grep.html
---
I'm not saying that `grep` is slow or flawed in any way but it can be definitely faster (and better). And GNU grep is not the only player out there.

Let me introduce [`ripgrep`](https://github.com/BurntSushi/ripgrep), a grep/ag/ack alternative written in Rust.

So why should you use `ripgrep`? Because it's fast. Very fast! It has saner defaults. And it's written in Rust. (Topic for another time:)

> Also, I just learnt that ripgrep powers Visual Studio Code's search.

## Benefits
* Did I tell you that it's crazy fast?
* It searches recursively by default.
* It ignores hidden and binary files by default.
* It respects .gitignore. It will skip listed files and directories by default.
* You can restrict your search to specific filetypes.
* It prints pretty.
* It supports file encodings other than UTF-8.
* It's crazy fast.

## Gotchas
* Doesn't have multiline search.
* Since it uses threads heavily to do work, ripgrep's output is not deterministic. Tip: Pipe the output through `sort`.

> It's not a drop-in replacement for GNU grep or ag though. So don't replace them with rg in scripts without testing.

## Installation
If you have Rust toolchain (1.20 or newer) installed, you can install it using cargo. Add `~/.cargo/bin` to $PATH if you haven't yet.
```bash
$ cargo install ripgrep
```

If you run bleeding-edge Arch, run
```bash
$ pacman -S ripgrep
```

Fedora users can install it using:
```bash
$ dnf install ripgrep
```

On macOS, run
```bash
$ brew install ripgrep
```

If you are worrying about having to type 3 more letters everytime you search and don't know what an alias is, don't worry. The binary is called just `rg`. (:

## Usage
If you know how to use `grep`, you can use `ripgrep`. I'll just outline basic usage here though. Read the instructions on its GitHub page if you want to know everything about it.

To search any word recursively in a directory:
```bash
$ rg <keyword>
```
> `ripgrep`'s default behavior is to skip hidden and binary files apart from everything ignored by git. Use `-uuu` to disable that.

To search a keyword in only specific filetypes, pass the file extension to -t switch:
```bash
$ rg -tjs foo
```

To search a keyword in files matching the specified glob:
```bash
$ rg foo -g 'bar.*'
```

## Basic Benchmarks
I ran simple benchmarks on my machine (Core i7 6500U, 8GB RAM, KDE neon 5.12.5 based on Ubuntu 16.04) using `/usr/bin/time` binary and ripgrep seems to beat GNU grep everytime (by a huge margin!).

```bash
$ /usr/bin/time rg -uu import > /dev/null # ~24 seconds

$ /usr/bin/time grep -r import * > /dev/null # ~3 min 27 seconds
```

Keep in mind that these are not scientific benchmarks by any means. Go to ripgrep's [GitHub page](https://github.com/BurntSushi/ripgrep) for more comprehensive numbers.

---

This post was originally published on my [website](https://abhnv.com/blog/2018/05/16/rip-grep.html).