teleren/devto huggingface dataset:
↪️ Refactor for Hacktober ↩️
Tags: hacktoberfest, refactor, codeclimate, opensource
Published: 2018-10-08 21:39:50

---
title: ↪️ Refactor for Hacktober ↩️
published: true
description: For anyone interested in the DEV Community codebase, I wanted to share an unending list of potential ways you can contribute.
tags: hacktoberfest, refactor, code climate, open source
---

For anyone interested in the [DEV Community codebase](https://github.com/thepracticaldev/dev.to), I wanted to share an unending list of potential ways you can contribute. And that is: by way of refactoring. Refactoring tends to be a nice-to-have until one day it becomes an absolute-must-have-blocker-to-something-else. 

To access our unending list of things to refactor, check out our [code climate issues](https://codeclimate.com/github/thepracticaldev/dev.to/issues). You'll see a variation of this: 

![code climate screenshot](https://thepracticaldev.s3.amazonaws.com/i/mxselqz7l5bayowbsfoh.png)

Some issues are bigger than others, but they're all worth tackling. _Any_ refactoring will help the project and contribute to the health of the codebase. 


Happy Coding!
The easiest problem you cannot solve.
Tags: programming, challenge, javascript
Published: 2018-10-08 21:33:11

---
title: The easiest problem you cannot solve.
published: true
description: 
tags: programming, challenge, javascript
---

**Given** the following code:

```javascript
const K = a => b => a
const cat = 'cat'
const dog = 'dog'
```

Calling `K` like this will output `cat`

```javascript
K(cat)(dog)
//=> "cat"
```

How can you call `K` to output `dog` without swapping the order of `cat` and `dog`? 

`cat` and `dog` must appear exactly once.

The **Given** cannot be modified.

```javascript
// INVALID: Cannot swap order!
K(dog)(cat)

// NO CHEATING: May only appear once.
K.bind(null, dog)(cat)(dog)
```

I know of two ways to solve this problem. Surprise me with another!

I should have also specified no bind, call, or apply, but the solutions are just too interesting :)

**Hints:** `K` in the problem is the **K combinator**, part of the **SKI combinator calculus**.

**Spoilers are in the comments! BEWARE!**

Many great solutions have been posted below! A lot I never considered. Also some very creative loopholes around the rules I created ;)

Here's one solution that went undiscovered. It's base64 encoded to hide the "spoiler". But if you are curious you can decode it using your console's `atob` function.

```
Syh4PT54KShjYXQpKGRvZyk=
```

![Cheers!](https://thepracticaldev.s3.amazonaws.com/i/6jsy3a866frzp3u5oda0.jpg)
Hiring process of your dreams
Tags: discuss, interview, career
Published: 2018-10-08 20:30:51

---
title: Hiring process of your dreams
published: true
description: What would be a hiring process you would love?
tags: discuss, interview, career
cover_image: https://s3.amazonaws.com/directworksmedia/media/images/2015/10/05/agileteam.jpg
---

So... imagine you are starting your dream company with the smartest guys in the coolest office ever.... :) And you are looking for a software developer.

What would be a hiring process you would love to participate? One that you think that really shows a candidate's skills, gives a real result so that you can see that he or she would be a good fit.

My initial idea would be like:

- short and simple interview: talking about previous projects and goals in the long run
- start off with one very basic challenge like Game of Life to check code style, ability to refactor, clean code stuff
- continue with a simple project from database level to frontend like an URL shortener service or something
- last but not least adding a new feature to a complex (preferably legacy) system
- team decides if candidate should be hired

It could be conducted in the office, candidates together with the other developers, so they would be able to ask whenever they want and feel like a member of the team!

What do you think? :)
Use the JIRA API to Post Tickets to JIRA
Tags: ruby, sinatra, jira, api
Published: 2018-10-08 18:22:01

---
title: Use the JIRA API to Post Tickets to JIRA
published: true
description: A walkthrough of simple Sinatra application to create tickets using the JIRA API
tags: ruby, sinatra, jira, apis
---
_Originally posted on [jmkoni.com](https://www.jenniferkonikowski.com/blog/2018/9/20/use-the-jira-api-to-post-tickets-to-jira)_

A while ago, I built this [super basic Sinatra app](https://github.com/jmkoni/sinatra-jira-app) to post tickets to JIRA. Here’s the use case: you have non-technical people who are part of your company/team that need to be able to add bugs to JIRA. However, they aren’t putting the right information into the ticket. Here comes this super basic app. To get it running, you just need to update .env with your JIRA username, password, and project key. However, I would recommend changing it to use [OAuth](https://developer.atlassian.com/server/jira/platform/oauth/). Right now, the form is very simple and, if you decide to use this, I would highly recommend you update it to ask for whatever information you want. Just don’t forget to update the JSON in sinatra_jira.rb! This application is completely open source - feel free to copy any of it for any reason, whole or partial. Let’s dig in a bit and do a quick overview of how [Sinatra](http://sinatrarb.com/) works.

To start off, the Gemfile is minimal. The biggest thing is that I’m using [dotenv](https://github.com/bkeepers/dotenv), a super useful gem that helps manage environment variables using .env files. Other than that, rubocop, sinatra, and we are using thin for the server.

{% gist https://gist.github.com/jmkoni/cd8f4474d74a23c7b7ce44f8a692359e %}

The main file (sinatra-jira.rb) contains the routes and the actions. It’s basically a combination of a controller and routes file all in one. The initial get just displays the form and all the work happens in post. Even that is fairly simple though… we just take the field contents and put them in the form that the JIRA API wants.

{% gist https://gist.github.com/jmkoni/c613f3d919bf6ec537b2e2561277dde2 %}

The form is pretty simple too and really ugly. I would definitely recommend adding some styling and don’t be like me… internal users deserve nice looking apps too! Since the problem I was facing was that I wasn’t getting the right information, I made sure to put examples in the form to increase the chance that I would get the information that I need.

{% gist https://gist.github.com/jmkoni/b84e2327a43b3f7a19b20030305ba869 %}

This is a SUPER basic response. Don’t miss that we are passing key to the response. That is the issue key which, depending on how much your end users use JIRA, might be useful to include.

{% gist https://gist.github.com/jmkoni/790776b36f0c96a47f37174766c188a1 %}

Hope this was somewhat useful in some way. I’d love to see feedback too!
fetch with a timeout
Tags: webdev, javascript
Published: 2018-10-08 18:12:00

---
title: fetch with a timeout
published: true
description: fetch with a timeout, which also cancels network request
tags: [webdev, js]
cover_image: https://thepracticaldev.s3.amazonaws.com/i/r60l55c0udosekdo512s.png
---

You may know (or will learn it right now) that new Web API `fetch`  comes without a timeout. I guess this is because it is built more around the idea of streams.
If you, like me, want to use `fetch` for AJAX(`XMLHttpRequest`) you would expect it to support timeout. I googled it and indeed people have the same issue. What I noticed is that most solution built around `setTimeout` and `Promise.reject`, most solutions don't bother to cancel the actual request.

So I created this snippet, which will not just timeout, but also cancel the network request:

```js
const timeoutableFetch = (url, options = {}) => {
  let { timeout = 5000, ...rest } = options;
  if (rest.signal) throw new Error("Signal not supported in timeoutable fetch");
  const controller = new AbortController();
  const { signal } = controller;
  return new Promise((resolve, reject) => {
    const timer = setTimeout(() => {
      reject(new Error("Timeout for Promise"));
      controller.abort();
    }, timeout);
    fetch(url, { signal, ...rest })
      .finally(() => clearTimeout(timer))
      .then(resolve, reject);
  });
};
``` 

requires [`AbortController`](https://caniuse.com/#search=AbortController). WDYT?
PHP Em Modo Interativo
Tags: php, phpinterativo, php7
Published: 2018-10-08 17:42:08

---
title: PHP Em Modo Interativo
published: true
description: Usando php de modo interativo no prompt
tags: #php #phpInterativo #php7
---

Quando aprendi PHP senti a necessidade de utilizar-la de <b>modo interativo</b> pois eu vinha do Python e sempre que necessário abria o terminal e digitava um comando Python ali rapidamente.

Despois de um tempo descobri que existe esse modo interativo também para o <b>PHP</b> e para uzá-lo basta fazer o comando no prompt:
        <b># php -a</b>

Agora pode-se criar variáveis e testar várias coisas interativamente!

<i><b>Observação:</b></i> Esse simbolo tralha (#) é o indicador do terminal <b>Linux</b>. O mesmo comando serve para o <b>Windows</b> também (php -a).

Bons estudos!
=]
If you could install only one VSCode extension?
Tags: discuss, vscode, productivity
Published: 2018-10-08 16:59:37

---
title: If you could install only one VSCode extension?
published: true
description: What would it be and why?
tags: discuss, vscode, productivity
cover_image: https://thepracticaldev.s3.amazonaws.com/i/x6ulm9uiu7t4xo6lpaqq.png
---

Halloween it's near, witches and sorcerers are among us... making his own magic potion. And me too... Muajajajaja!

![Alt Magic Spell](https://media.giphy.com/media/mrntmDtLQdILS/giphy.gif)

- Seven unsolved issues exist from version 1
- Thirty TODO comment lines
- Some spiders web
- Ten drops coffee from java
- Eight virgin libraries
- Follow three repositories with 0 stars
- One unused ASCII table
- Two broken laptops
- Junior developer's tears

And finally, the secret ingredient... 
- One Rubik's cube solved in less than 10 seconds! 

> Evil laugh! Trumpeting of thunders in the distance!

> Dance around the pot, chanting. 

> Abracadabra! Abracadabra! Abracadabra!

Booom!!! Almost each one of us creates a post like this:

{% link https://dev.to/equiman/my-essential-visual-studio-code-extensions-and-configurations-5197 %}
<figcaption>My preciousss! Gollum! Gollum!</figcaption>

It's like your own perfect spell, but only work in your reign! 

That's why I think this kind of post is a useless thing than others can ever seen. It's a post made only for you.

![Alt Creepy Ghost](https://media.giphy.com/media/26uTqWF2wNac8sumk/giphy.gif)

But now imagine this creepy story: 
- An evil ghost was seized **Visual Studio Code** and limited to install one extension.
- Ohhh no! Who you gonna call?
- Ghostbuster!
- No, they are busy this month
- El Chapulín Colorado?
- Who? No!
- So?
- You need to choose one 
- Only one?
- Yep, sorry
- Crap!

![Alt Only One](https://media.giphy.com/media/9Jmb2idg10qJSygvTQ/giphy.gif)

- What would it be... and why?

--
**That's All Folks!**
**Happy Halloween** 🎃💀

[![beer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkgsx4aw6qn9i9ax6as9.png)](https://github.com/sponsors/deinsoftware)
Role-Based Access Control (RBAC) and React Apps
Tags: react, javascript, authorization, rbac
Published: 2018-10-08 16:56:39

---
title: Role-Based Access Control (RBAC) and React Apps
published: true
description: Learn how to implement Role-Based Access Control (RBAC) in React apps properly.
tags: #reactjs #javascript #authorization #rbac
canonical_url: https://auth0.com/blog/role-based-access-control-rbac-and-react-apps/
---

In this article, you will learn how to implement Role-Based Access Control (RBAC) in React apps properly. First, you will take a brief look into what authorization and authentication are. Then, you will look at a naive strategy that is used constantly while securing React apps. In the end, you will learn what RBAC is, see the working example, learn what makes it a better strategy, and how you can implement it in React. 

[Read on 👥⚛️](https://auth0.com/blog/role-based-access-control-rbac-and-react-apps/?utm_source=dev&utm_medium=sc&utm_campaign=rbac_react)

![Role-Based Access Control (RBAC) and React Apps](https://thepracticaldev.s3.amazonaws.com/i/mly4lepqikwvv127h7ki.png)
Vim
Tags: vim, poem, beautiful, beauty
Published: 2018-10-08 16:43:44

---
title: Vim
published: true
description: A poem dedicated to Vim.
tags: Vim, poem, beautiful, beauty
---

It’s 1991 and Bill turns his computer on,

Patiently watching his monitor’s scan-lines trudge along,

Ten minutes pass until logged on, only to realize something is wrong,

Bill made a promise to his beautiful wife Martha,

He would digitally collate her recipes into a book with no flaws,

However he stood at a crossroads between which text editor to draw,

You see, as of 1981 Emacs was the OG,

Bills father, a first gen software engineer held it to the highest decree,

Bill naturally followed suit, in hopes of honouring their family tree,

However Bill owns a macintosh,

A beautiful machine with a keyboard layout strictly designed for the posh,

The layout was not fitting for the antiquated Emac editor which needed a revitalizing wash,

It was then no longer a question,

Vim was the only option,

Bill enabled insert and began his descent down Martha’s recipe mission,

Soon after Martha rewards him for his beautifully formatted creation,

Fast forward two and a half decades to 2018,

Plentiful editors existing, but only one lives on Bill and I’s screen,

Vim,

An editor so fast, so accessible, so delightful indeed,

Whether equipped with plugins or ran raw, your creative shackles are instantly freed,

You see VIM is like no other when you have a project to lead,

I can ripgrep faster than you can opengrok,

Index files before anyone can squak,

Manipulating layered memory buffers is nothing to mock,

Column edit and string substitute before you read the docs,

All without making a dent in the CPU clock,

If this hasn’t convinced you I have nothing left to say,

For you have gone along a path leading you very much astray.

— A tribute to Vim and all the glory it has bestowed upon us —

https://raw.githubusercontent.com/IhsanE/dotfiles/master/.vimrc
Module Monday 16: Hover flip gallery, Ring nav, Live weather & more
Tags: showdev, opensource, webdev, javascript
Published: 2018-10-08 16:11:19

---
title: Module Monday 16: Hover flip gallery, Ring nav, Live weather & more
published: true
description: Module Monday 16
tags: showdev, opensource, webdev, javascript
cover_image: https://res.cloudinary.com/component/image/upload/b_rgb:f6f6f6,c_pad,h_370,w_880/v1538846747/gallery-flip_jaxcwh.gif
canonical_url: https://guide.anymod.com/v1/module-mondays/2018-10.html#Module-Monday-16
---

## Fast features for any website

Everything below is open source and free to use on any website, web app, or anywhere else. [Anymod](https://anymod.com) lets you quickly add features like these.

Click a mod to see it along with its source code.

### Ring navigation
Expanding circular links: edit content, color, and quantity.
<a class="button" href="https://anymod.com/mod/lmlrm?v=20">View mod</a>
<a href="https://anymod.com/mod/lmlrm?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1538846748/circles-nav_hymorz.gif"/>
</a>

### Hover flip gallery
Every image flips when you hover. Each image has a link.
<a class="button" href="https://anymod.com/mod/rbaba?v=20">View mod</a>
<a href="https://anymod.com/mod/rbaba?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1538846747/gallery-flip_jaxcwh.gif"/>
</a>

### Live weather by city
Add your city and an OpenWeatherMap key, and it just works.
<a class="button" href="https://anymod.com/mod/bbabd?v=20">View mod</a>
<a href="https://anymod.com/mod/bbabd?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1538846745/weather_sdghge.png"/>
</a>

### Gif card
Add a gif in a classic card layout with link.
<a class="button" href="https://anymod.com/mod/nbknn?v=20">View mod</a>
<a href="https://anymod.com/mod/nbknn?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1538846747/gif-card_h7ccsz.gif"/>
</a>

### GitHub button
Configure with star, watch, fork, or follow. Links to your account or repo.
<a class="button" href="https://anymod.com/mod/aklmr?v=20">View mod</a>
<a href="https://anymod.com/mod/aklmr?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1538846746/github_bk2oxz.png"/>
</a>

<hr>

I post new mods [here](https://dev.to/tyrw) every (Module) Monday -- I hope you find them useful!

Happy coding ✌️
Best advice for a junior software developer? 
Tags: beginners, career, dev
Published: 2018-10-08 16:08:51

---
title: Best advice for a junior software developer? 
published: true
description: What things would you like to tell yourself when you were a junior?
tags: beginners, career, dev
---

Based on the posts of [Ted Hagos](https://dev.to/tedhagos/if-i-knew-then-what-i-know-now-55pb) and [Sergio Tapai](https://dev.to/sergiotapia/what-is-your-best-advice-for-a-junior-software-developer-32gn) I wanted to share my two cents  (literally) on the topic. There are a lot of small little things that can help you get further. Instead of a long 143 items list with small things I wanted to point out two general principles I apply every single day, even outside of coding.

## 1. Find a balance. 
You won't learn how to code by just reading books and watching courses. With actually writing and putting it into practice comes extra obstacles you can solve. These can help you in future similar situations. The opposite is also true, building things is great but always question your own workflow and see if there are any other ways ([Shoshin](https://en.wikipedia.org/wiki/Shoshin)) for solving the same problem. 

## 2. Don't ride the bandwagon.
Learn the fundamentals first. HTML, CSS and JavaScript aren't going away any time soon. That doesn't mean learning frameworks and libraries is a bad thing but dive into one to broaden your skill set and if it seems relevant to you, not because it's what all the job listings tell you.

---
On a last note, I highly recommend you watch [this video](https://vimeo.com/85040589) about 'The Gap' by Ira Glass. It fundamentally changed the way I look at other people that try to code for the first time.

> Thanks for reading! You can follow me on @dandevri and feel free to reach out to me if you have something to say!
How Did Angular CLI Budgets Save My Day And How They Can Save Yours
Tags: angular, javascript, webdev, css
Published: 2018-10-08 15:11:45

---
title: How Did Angular CLI Budgets Save My Day And How They Can Save Yours
published: true
description: Budgets is one of the less known features of the Angular CLI which helps you to keep application bundle sizes in check and prevent bugs…
tags: angular,javascript,webdev,css
cover_image: https://thepracticaldev.s3.amazonaws.com/i/34477zav145y03dmnqao.jpeg
canonical_url: https://medium.com/tomastrajan/how-did-angular-cli-budgets-save-my-day-and-how-they-can-save-yours-300d534aae7a
---


#What Are We Going To Learn?

1. What are the Angular application budgets
2. What kind of problems can be discovered by using budgets
3. How can budgets help with these problems
4. What are the tradeoffs ( cost of using budgets in your application )
5. How to prevent problems uncovered by budgets to ever happen again


>This article is based on a true story! It happened while working on the Angular NgRx Material Starter which recently started using Angular CLI budgets…

[Read more...](https://medium.com/tomastrajan/how-did-angular-cli-budgets-save-my-day-and-how-they-can-save-yours-300d534aae7a)
PunkPong – Pong game in JavaScript (February 2006)
Tags: game, classic, javascript, gamedev
Published: 2018-10-08 15:16:54

---
title: PunkPong – Pong game in JavaScript (February 2006)
published: true
tags: game,classic,JavaScript,gamedev
canonical_url: 
---

“PunkPong” is an open source Pong clone totally written in DHTML (HTML, CSS and JavaScript).

![Screenshot](http://dhtmlgames.com/punkpong/punkpong.gif)

It is my second DHTML game and was made in early 2006.

It allows you to use either mouse or keyboard to control your paddle.

Despite the fact that it is very easy in the beginning, the difficulty increases slowly every level and the computer will be much harder to beat.

You can also change the game behaviour easily by editing many of the configuration variables which are at the beginning of the script.

This game doesn’t use any image at all, just pure HTML and CSS.

Official languages are Spanish and English.

You can find other modified and adapted versions of this game on the Internet, including one Opera widget and even a Drupal module.

This game has been tested under BeOS, Linux, NetBSD, OpenBSD, FreeBSD, Windows, Mac OS X, BlackBerry Tablet OS, Android, iOS and others.

Play online in English: [http://punkpong.tuxfamily.org/punkpong\_english/](http://punkpong.tuxfamily.org/punkpong_english/)

Play online in English (mirror): [http://www.dhtmlgames.com/punkpong/punkpong\_english/](http://www.dhtmlgames.com/punkpong/punkpong_english/)

Play online in Spanish: [http://punkpong.tuxfamily.org/punkpong\_spanish/](http://punkpong.tuxfamily.org/punkpong_spanish/)

Play online in Spanish (mirror): [http://www.dhtmlgames.com/punkpong/punkpong\_spanish/](http://www.dhtmlgames.com/punkpong/punkpong_spanish/)

Official web site: [http://punkpong.tuxfamily.org/](http://punkpong.tuxfamily.org/) (mirror at [http://www.dhtmlgames.com/punkpong/](http://www.dhtmlgames.com/punkpong/)).

The repository can be found on GitHub: [https://github.com/jalbam/punkpong](https://github.com/jalbam/punkpong)
Who's looking for open source contributors? (October 8th edition)
Tags: discuss, opensource, hacktoberfest
Published: 2018-10-08 15:07:02

It's one week into [#hacktoberfest](/t/hacktoberfest)!

Find something to work on or promote your project here.

Please shamelessly promote your project. Everyone who posted in previous weeks is welcome back this week, as always. 😄

Happy coding!
The Legacy Blues: How To Maintain Joy Doing Digital Janitorial Work
Tags: discuss
Published: 2018-10-08 13:19:58

---
title: The Legacy Blues: How To Maintain Joy Doing Digital Janitorial Work
published: true
description: How do you stay positive about your job when the going gets tough. 
tags: discuss 
---

I am having a hard time staying motivated and doing good work on an app that I find boring with poor architecture. How do you find joy in doing the dirty work?
Just launched my first app on Product Hunt - Free My Desktop
Tags: mac, showdev, free
Published: 2018-10-08 14:41:34

---
title: Just launched my first app on Product Hunt - Free My Desktop
published: true
description: Hides all the icons from your desktop with a click
tags: mac, showdev, free
---

Just launched Free My Desktop for Mac!

https://www.producthunt.com/posts/free-my-desktop

Hides all the icons from your desktop with a click

I’ve been doing some screen recordings lately and I needed a way to quickly hide my desktop while recording and flip it back to visible once done in succession. I made this simple menubar app in under an hour, that can be toggled on and off by a simple tap. On top of showing and hiding the desktop, it also works for the dock and the menubar.

    Made in less than an hour

    500 visitors so far

    Completely free

🙏 Let me know what you think and if you have any questions!
React Native Animated Flatlist
Tags: reactnative, react, javascript, animated
Published: 2018-10-08 14:32:59

---
title: React Native Animated Flatlist
published: true
description: 
tags: react-native, react, javascript, animated
---

React Native Animated Flatlist
Animate item add/delete on

[view on github](https://github.com/shakogegia/react-native-animated-flatlist)
[View demo on Snack](https://snack.expo.io/@shakogegia/react-native-animated-flatlist-demo)

feedbacks & contributions are more than welcome

![alt text](https://github.com/shakogegia/react-native-animated-flatlist/raw/master/screenshots/demo.gif "Demo")