teleren/devto huggingface dataset:
So You Created a Regression?
Tags: git, regression
Published: 2018-09-26 19:52:11

---
title: So You Created a Regression?
published: true
tags: git,regression
canonical_url: https://thjones2.blogspot.com/2018/09/so-you-created-regression.html
---

Sometimes, when you're fixing up files in git-managed files, you'll create a regression by nuking a line (or whole blocks) of code. If you can remember something that was in that nuked chunk of code, you can write a quick script to find all prior commits that referenced that chunk of code.  
  
In this particular case, one of my peers was working on writing some Jenkins pipeline-definitions. The pipeline needed to automagically create S3 pre-signed URLs. At some point, the routine for doing so got nuked. Because coming up with the requisite interpolation-protections had been kind of a pain in the ass, we _really_ didn't want to have to go through the pain of reinventing that particular wheel.  
  
So, how to make git help us find the missing snippet. `git log`, horsed to a quick loop-iteration, can do the trick:

> ```
>
> for FILE in $( find <PROJECT\_ROOT\_DIR> -name "\*.groovy" )
> do
>    echo $FILE
>    git log --pretty=" %H" -Spresign $FILE
> done | grep ^commit
> 
> ```

In the above:  
  

- We're executing within the directory created by the original `git clone` invocation. To limit the search-scope, you can also run it from a subdirectory of the project.
- Since, in this example case, we know that all the Jenkins pipeline definitions end with the `.groovy` extension, we limit our search to just those file-types.
- The `-Spresign` is used to tell `git log` to look for the string `presign`.
- The `--pretty=" %H"` suppresses all the other output from the `git log` command's output - ensuring that only the commit-ID is print. The leading spaces in the quoted string provide a bit of indenting to make the output-groupings a bit easier to intuit.
  
This quick loop provides us a nice list of commit-IDs like so:  

> ```
>
> ./Deployment/Jenkins/agent/agent-instance.groovy
>    64e2039d593f653f75fd1776ca94bdf556166710
>    619a44054a6732bacfacc51305b353f8a7e5ebf6
>    1e8d5e40c7db2963671457afaf2d16e80e42951f
>    bb7af6fd6ed54aeca54b084627e7e98f54025c85
> ./Deployment/Jenkins/master/Jenkins\_master\_infra.groovy
> ./Deployment/Jenkins/master/Jenkins\_S3-MigrationHelper.groovy
> ./Deployment/Jenkins/master/Master-Ec2-Instance.groovy
> ./Deployment/Jenkins/master/Master-Elbv1.groovy
> ./Deployment/Jenkins/master/parent-instance.groovy
> 
> ```

In the above, only the file `Deployment/Jenkins/agent/agent-instance.groovy` contains our searched-for string. The first-listed commit-ID (indented under the filename) contains the subtraction-diff for the targeted string. Similary, the second commit-ID contains the code snippet _we're actually after_. The remaining commit-IDs contain the original "invention of the wheel",  
  
In this particular case, we couldn't simply revert to the specific commit as there were a lot of other changes that were desired. However, it did let the developer use `git show` so that he could copy out the full snippet he wanted back in the current version(s) of his pipelines.
Many software communities do not value the need to reduce the mental load for developers
Tags: healthydebate
Published: 2018-09-26 15:18:01

---
title: Many software communities do not value the need to reduce the mental load for developers
published: true
description: 
tags: healthydebate
---

I was thinking back to DHH's Railsconf keynote from this year:

{% youtube zKyv-IGvgGE %}

It largely centered around the Rails community's ongoing effort to keep up with user expectations while creating abstractions that limit the choices developers need to make.

Rails does not get everything right (nobody does), but I think they get this right big time. I find that the JavaScript community proliferates new "useful" technology without giving as much thought to the mental overhead of constantly learning new things and finding out how to fit everything together.

There are a few things at play. Rails has a pretty healthy BDFL model which has created some structure that other communities may lack, and often fails to benefit quickly from the latest and greatest tools or architecture principles. It's occasionally brutal in this way. But the acknowledged tradeoffs keep it healthy.

I would say this is the quality that most keeps me excited about the stack I continue to do most of my work with. I try not to be too much of a fanboy of the tech itself or the people involved, but I continue to really enjoy the effort to keep the mental load for developers under control.

I welcome a debate here, happy coding!
Vue CLI 3, TailwindCSS, and PurgeCSS
Tags: css, tailwindcss, postcss, vue
Published: 2018-09-26 15:14:26

---
published: true
tags: css, tailwindcss, postcss, vue
title: Vue CLI 3, TailwindCSS, and PurgeCSS
description: Using PurgeCSS to generate tiny TailwindCSS bundles in your Vue CLI 3 projects.
---

The new [Vue CLI](https://cli.vuejs.org/) just came out and I was itching to give it a go. Our wedding website needed a fresh coat of paint so decided to move it from Nuxt to just a plain Vue app. It's two pages so there was really no need to bring Nuxt in.

The new Vue CLI is awesome and got things up and running in no time. Add in my new favourite CSS framework, [TailwindCSS](https://tailwindcss.com/), and things were soaring along. Until I decided the decrease my bundle size.

Because of how TailwindCSS works, by default the entire framework gets included. You can add some configuration options to add or removes colours, responsive states, and such. However, an even easier way to handle things is with [PurgeCSS](https://github.com/FullHuman/purgecss). It'll go over through your HTML (Vue in my case) files and see what CSS selectors you use, and remove all the others from your CSS. This should cause your TailwindCSS output to be tiny, just the classes you use!

A new project with Vue CLI 3 uses [postcss-load-config](https://github.com/michael-ciniawsky/postcss-load-config) to handle PostCSS plugins. However, the default way of using your `package.json` to configure plugins doesn't appear to work with the PostCSS PurgeCSS [plugin](https://github.com/FullHuman/postcss-purgecss). Thankfully, postcss-load-config allows you to use numerous different type of configuration files. Switching to a JavaScript one (`.postcssrc.js`) gave me the below config that allows you to use TailwindCSS in your Vue files, but also removes unused CSS from the generated bundle.

```js
const tailwindcss = require('tailwindcss')
const purgecss = require('@fullhuman/postcss-purgecss')
const autoprefixer = require('autoprefixer')
const postcssImport = require('postcss-import')

module.exports = {
  plugins: [
    postcssImport,
    tailwindcss('./tailwind.js'),
    purgecss({
      content: ['./src/**/*.vue'],
      extractors: [
        {
            extractor: class TailwindExtractor {
                static extract(content) {
                    return content.match(/[A-z0-9-:\/]+/g) || [];
                }
            },
            extensions: ['vue']
        }
      ]
    }),
    autoprefixer
  ]
}
```

This took me far too long to figure out, but the benefits are profound! Before adding PurgeCSS my CSS bundle was 50.12 kb Gzipped, after PurgeCSS it was only 2.33 kb--over a 20 times reduction in size!

**Update:** The custom extrator is required for Tailwind's responsive classes which get stripped out by default!

--

Originally posted on my [site](https://delport.ca/2018/vue-tailwindcss-purgecss)
Job title: Full-time Open Sourcerer
Tags: opensource, career
Published: 2018-09-26 14:18:41

---
title: Job title: Full-time Open Sourcerer
published: true
description: 
tags: opensource, career
---

I absolutely loved this phrase pulled from this comment:

{% devcomment 5mj2 %}

And I am going to start using it myself. I find it pretty damn cool that I am now writing open source full time. No matter what comes of [dev.to](/), all the code we put out into the world is for everyone. That is pretty magical and thinking like that really helps me get up in the morning and get excited about work.

My open source work is on a consumer-facing application. This is different from "typical" open source work in library development etc. but I'm not sure low-level library/tool development would ever really be for me anyway. I'm very happy I get to do the work I like doing and put all the code out into the universe for others to use and benefit from.

I hope you too can become a full-time open sourcerer or sourceress.

![](https://media.giphy.com/media/pI2paNxecnUNW/giphy.gif?cid=3640f6095bab951a79314f7232b9fcfa)
Jelly Fin: Hello, World!
Tags: jellyfin, helloworld, vue, travisci
Published: 2018-09-26 13:57:03

---
title: Jelly Fin: Hello, World!
published: true
description: First major milestone for the web version of Jelly Fin
tags: jellyfin, helloworld, vuejs, travisci
---

After grinding away at the native app, it feels good to get the ball rolling in the right direction with the web app.  That's right, baby! We have successfully tested the production rollout process, had a successful build, and deployed to firebase!

### Earth: 
```
Earth to Jelly Fin...come in, Jelly Fin?
```

### Jelly Fin: 

["Hello, world!"](https://jellyfin.app)
Developing a Real-Time, Collaborative Editor with Pusher
Tags: node, express, pusher, webapp
Published: 2018-09-26 13:54:16

---
title: Developing a Real-Time, Collaborative Editor with Pusher
published: true
description: Learn how to develop a real-time web app that enables multiple users to work on the same document with ease.
tags: #nodejs #expressjs #pusher #webapp
canonical_url: https://auth0.com/blog/developing-a-real-time-collaborative-editor-with-pusher/
---

In this article, you will learn how to build a real-time, collaborative note editor application that enables multiple users to work on the same document simultaneously. To create this app, you will use tools like Node.js, Express, Pusher, and Auth0.

[Read on 🏄🏻‍♂️](https://auth0.com/blog/developing-a-real-time-collaborative-editor-with-pusher/?utm_source=dev&utm_medium=sc&utm_campaign=pusher_nodejs)

![Developing a Real-Time, Collaborative Editor with Pusher](https://thepracticaldev.s3.amazonaws.com/i/eir27aat1sznqbvggzm9.png)
I have no idea where I’m going, but I know how I’ll get there
Tags: go, selfimprovement
Published: 2018-09-26 13:32:29

---
title: I have no idea where I’m going, but I know how I’ll get there
published: true
description: How I'm developing myself through code.
canonical_url: https://unstuckdev.com/2018/09/17/i-have-no-idea-where-im-going-but-i-know-how-ill-get-there/
tags: go, golang, self-improvement
---

[Originally posted on my blog](https://unstuckdev.com/2018/09/17/i-have-no-idea-where-im-going-but-i-know-how-ill-get-there/)

I started 2018 stumbling on [Farnam Street’s mental models page](https://fs.blog/mental-models/). This is now on the list of things that turned my life upside down in a way that, on the other side, turned out to be good. My whole way of thinking changed.

One model in particular made the biggest difference: [inversion](https://fs.blog/2013/10/inversion/).

> Inversion is a powerful tool to improve your thinking because it helps you identify and remove obstacles to success. The root of inversion is “invert,” which means to upend or turn upside down. As a thinking tool it means approaching a situation from the opposite end of the natural starting point. Most of us tend to think one way about a problem: forward. Inversion allows us to flip the problem around and think backward. Sometimes it’s good to start at the beginning, but it can be more useful to start at the end.

Inversion is the humbling recognition that no one has all the right answers. No one has the right answer for you. No one has the right answer for me. But there is a huge set of wrong answers, and they’re wrong for just about everyone.

This is one reason Golang appealed to me so much. It accepts that there are many wrong ways to do things, and very few right ways. Golang encodes these right ways into a clean, simple syntax, and a set of standard packages that do most of what a programmer needs to do with few alternate paths. It’s like how Rails encoded a set of right things for web development so you could load it up and be productive fast without having to understand everything it’s doing with Ruby.

It’s a framework. You can build on it, and drop down to the lower level when its way turns out to not be the right way for what you’re doing. Golang is similar. It’s training wheels and a three-wheel road vehicle all in one. People driving supercars and slick motorcycles might laugh and say you’re missing out, but you understand their goals are different from your own.

That’s my life in 2018 and beyond. I don’t know where I’m going. I don’t know what to do. I don’t know where my path will take me. But I have chosen a path, and I have found a tool that helps me explore it. Maybe I’ll end up with a Ferrari or Civic Type R by the end of 2019\. Who knows? For now, I’ll take my practical three-wheeler.
How would kubernetes simplify my deployment
Tags: kubernetes
Published: 2018-09-26 13:21:07

---
title: How would kubernetes simplify my deployment
published: true
description: How would kubernetes simplify my deployment
tags: kubernetes    
---

I am currently using a combination of ansible and docker-compose for a an application that I am currently working on.   This app will run on a single node for now.

Currently a deployment takes about 90 seconds, most of the time is rebuilding the 4-5 docker images (app, db, redis, etc).

I have played around with kubernetes and was wondering if someone with a little more experience could chime in.  Seeing as this app runs on a single node, how would using kubernetes simplify my deployment process? Or would it not make sense seeing that we aren't talking 10+ nodes?
Got a crazy idea for user authentication, can I get some feedback?
Tags: discuss, node
Published: 2018-09-26 12:52:51

---
title: Got a crazy idea for user authentication, can I get some feedback?
published: true
description: I'm searching for the best possible solution to handling authentication between my projects
tags: discussion, nodejs
---

Okay, first post here, sorry if I make any mistakes.

So I like to get some projects running, working on them and that stuff, the problem always comes when I need to add authentication and I don't want to maintaint databases with user  data for each project, a simple user id for me is enough, that's why I normally use`passport-twitter` to handle authentication also not having to worry about storing someone else's password is a bonus.

Thing is, once you have more than one or two projects, I doubt that reusing the same twitter app for all of them is correct so I got a plan, and I'd like to know what you guya think of it and if anyone has any idea on how to implement such a thing.

So, my plan is to have a central authentication for all my projects, kind of what google does with `accounts.google.com`

The idea is simple, when a user wants to login to one of my projects, I start a OAuth process with a custom server of mine, `auth.example.com` which is basically a normal OAuth server, the caveat is that this custom OAuth server doesn't authenticate users with their username and password, instead, it does it via Twitter, Google, GitHub, whatever. So it'a basically OAuth inside Oauth.


I'm not really sure if anyone will understand what I mean but I'm not really sure this can be done either so I guess I'll try and see if anyone knows of an existing project that has thia system or knows if it's possible to do / how.

Authentication isn't my thing and I'd love some assistance here, I don't want to screw anything up

Thanks.
What book(s) has influenced your career?
Tags: books, reading, programming, discuss
Published: 2018-09-26 12:44:18

---
title: What book(s) has influenced your career?
published: true
description: I'm looking for more books to increase my general knowledge of programming.
tags: books, reading, programming, discussion
---

Hello everyone,

I have recently read *The Pragmatic Programmer* book and it significantly influences the way I behave, code, and I think about different aspects of this career.

I suggest you all have a look at it.

I'm so eager to read more non-coding books, would be great if you share some with me.
geeksay - Translate layman text 👶 to its geeky version 🤓!
Tags: javascript, webdev, beginners, opensource
Published: 2018-09-26 12:35:25

---
title: geeksay - Translate layman text 👶 to its geeky version 🤓!
published: true
description: Translate layman text 👶 to its geeky version 🤓!
tags: javascript, webdev, beginners, opensource
cover_image: https://raw.githubusercontent.com/swapagarwal/geeksay/master/break.jpg
---

"geeks will ctrl+s the world"
"There's no place like 127.0.0.1"
"sometimes, i just need a `<br>`"

You know how sometimes you find these really geeky quotes and wish the world had more of them? Yeah, geeksay fixes that. Try it out at http://geeksay.xyz

![](https://raw.githubusercontent.com/swapagarwal/geeksay/master/demo.gif)

Contributions are welcome at https://github.com/swapagarwal/geeksay! 😇
Unlock more dev.to features 
Tags: meta, sustainability, showdev, support
Published: 2018-09-26 10:48:50

---
title: Unlock more dev.to features 
published: true
description: Extra features like analytics are available to members
tags: meta, sustainability, showdev, support
---

Did you know dev.to had a paid membership program?

I had to dig around the GitHub issues to realise there was one and it unlocked post analytics.

It's not super promoted, you can access it at https://dev.to/membership.

Then just click the following:

![level 1 membership: beta features](https://i.imgur.com/b4k7qIy_d.jpg?maxwidth=640&shape=thumb&fidelity=medium)

It unlocks some extra goodies (beta features) for just $1/mo, most of us can afford that.
What is the best development approach for React/React Native?
Tags: reactnative, javascript, react, discuss
Published: 2018-09-26 09:31:50

---
title: What is the best development approach for React/React Native?
published: true
description: 
tags: react-native, javascript, react, discuss
---

I've been thinking of starting a new project with react native and I want to use the test-driven development. Is it going to be an efficient approach or just write the test later? Let me know your thoughts. Thanks! 😇
What is faster? Read file CSV or Oracle table?
Tags: talend, oracle, hbase, discuss
Published: 2018-09-26 09:24:01

---
title: What is faster? Read file CSV or Oracle table?
published: true
description: Use ETL (Talend) System to read  a huge amount of data(50 M)
tags: #Talend #Oracle #Hbase  #discuss
---

Hi guys,

I need an advice. I need to Load a huge amout of data(50 M). From Oracle to HBase.
In this moment there is an Job wrote in Talend (ETL System) that read data from CSV and load to HBase.

Oracle -> CSV File -> Talend Job -> HBase Database

Can I get better upload performance if I connect to the oracle database?


Is reading from a table Oracle faster than reading from a file CSV?

Thanks,
Daniel
Storing images in database in 2018
Tags: discuss, question, database
Published: 2018-09-26 08:59:39

---
title: Storing images in database in 2018
published: true
description: discussion about storing images in database in 2018
tags: discuss, question, database
---

For ages storing images in relationship databases was considered is a bad practice. It slows database, it makes replication, backup and retrieving more complicated. But recently I became a part of a new project and noticed that pictures are stored as blob there. The application is designed rather big and scalable so I wonder if it still not properly or something changed nowadays?
Learn React on Rails
Tags: react, rails, learning
Published: 2018-09-26 08:49:00

---
title: Learn React on Rails
published: true
description: Learn React on Rails video series
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qi4nu1b4ca10ng7glena.png
tags: 
  - react
  - ruby on rails
  - learning
---

[React and Ruby on Rails](https://www.codemy.net/collections/learn-react-on-rails) is a powerful combination. [This collection](https://www.codemy.net/collections/learn-react-on-rails) is a combination of the React Foundation, Rails API and React Intermediate series. It is organized in sequence of how the invoiced application is created. This is a great way to learn how to build React apps that get their data from a Rails API backend.
Tokenize String Using C++
Tags: string, tokenize
Published: 2018-09-26 08:47:47

---
title: Tokenize String Using C++
published: true
description: My choice of elegant string tokenizing in C++
tags: C++,string,tokenize
---

    std::string input = "We, are, all, strangers, here"; // our input
    char delim = ','; // our delimiter


    std::istringstream ss(input);
    std::string token;

    std::vector<std::string> tokens;
    while(std::getline(ss, token, delim)) {
        tokens.push_back(token);
    }

    // tokens contain the array of tokenized strings separated by delimiter
Upgrading from react-native ~0.56 to 0.57.1 and Babel v7 after just installing MacOS Mojave and Xcode 10 
Tags: reactnative, ios, mojave, xcode10
Published: 2018-09-26 01:20:55

---
title: Upgrading from react-native ~0.56 to 0.57.1 and Babel v7 after just installing MacOS Mojave and Xcode 10 
published: true
description: 
tags: react-native, iOS, Mojave, XCode 10.
---

Sequence of commands I used to install this.

Updated to MacOS Mojave

 `rm-rf node_modules`    

`npm install`

`react-native-git-upgrade`

Got errors about babel hot reloader but ignored them.

ran `react-native run-ios`

Got build error to do with react-native cli

opened project in Xcode, updated build tools for shared workspace that were still on legacy to latest.

Cleaned project

Found this 

https://stackoverflow.com/questions/52452472/xcode-10-error-multiple-commands-produce-react-native/52452590

which led me to this

https://stackoverflow.com/questions/13751147/remove-or-uninstall-library-previously-added-cocoapods

Which gave me errors when I ran `pod install` referring to BoringSSL.

Decided to change track since I hate pods and update Babel instead.

That was pretty easy, I just followed this.

https://babeljs.io/blog/2018/08/27/7.0.0#babel-upgrade 

I installed it globally, if I could do it again I wouldn't have done that, no reason why, just seemed like it could cause problems down the line.

App eventually ran after a little friction, manually started packager, but then I got some version mismatch errors.

Ran `npm cache verify` and erase all content and settings on the simulator to get around these, but realized that I'd been getting build errors all along so I morosely trekked back to

cd `./ios`

Realized BoringSSL error was being caused by this file changing name on Github. 

https://github.com/grpc/grpc/blob/master/src/objective-c/BoringSSL-GRPC.podspec

Changed name of pod BoringSSL to BoringSSL-GRPC too after that gave me an error.

`pod install` appeared to be successful subsequently.

Killed still running packager, deleted app from simulator and ran:

`react-native run-ios` 

Build succeeded, one brief moment of joy, instantly brought back down to reality with lovely post build succeeding error.

Bunch of cache cleans and erase all content and settings type things got things fixed though.

Android should be a piece of cake right?

Terminal logs available on request and at your peril.