teleren/devto huggingface dataset:
ASK DEV: How are you managing your code snippets
Tags: help, discuss, programming, productivity
Published: 2019-05-05 07:34:43

---
title: ASK DEV: How are you managing your code snippets
published: true
description: What tools are you using to manage code snippets
tags: help, discuss, programming, productivity
---
Hey Devs

Do you have a habit of saving code snippets? (I don't). If Yes, comment on your favorite tool to manage your code snippets. 

And If No, Tell me why you don't need a snippet manager. Personally, I didn't find a good product to use.
Current Status 01
Tags: nethack, blogging
Published: 2019-05-05 04:32:54

---
title: Current Status 01
published: true
description: "Sick. Digging into the source code of NetHack."
tags: nethack, blogging
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ehj4rm7zxdw0tk3calrk.png
---

# Sick

## So Sick

At the end of the [last post](https://dev.to/shindakun/a-stab-at-roguish-go-part-04-3jl9) I noted that I was beat. In fact, shortly after posting a link to the post on Twitter I repeated that.

{% twitter 1122332805470412801 %}

Pretty much since then, I've spent my time fighting off this awful cold. It's left me too tired to actually code that much. I had an idea that we would try and cobble together some code to allow creatures in the Go rogue-ish thing I had been working on but that went off the rails pretty quickly.

***

Hopefully, we'll be back to our regularly scheduled Golang posts next week. Whether that means more Rogue-ish or back over to APIs or web apps we'll see. For now, though I'm going to read through the NetHack source until I fall asleep.

{% github NetHack/NetHack %}

***

| Enjoy this post? |
|:----:|
| [How about buying me a coffee?](https://ko-fi.com/shindakun) |

***
I really want to know how to make this
Tags: help, beginners
Published: 2019-05-05 04:12:41

---
title: I really want to know how to make this
published: true
tags: help, beginners
---

Hi everyone!
I would love to make things like this. I would really appreciate if anyone can help guide me in the right direction — how it's built, maybe any tutorials, or what I should learn. 
https://www.tuftandpaw.com/pages/beautiful-cats-of-instagram-3d#hamilton

<img src="https://thepracticaldev.s3.amazonaws.com/i/dug99ktblr5fnfv3brl5.png">

Thanks in advance!! 😸
I Wrote Zero Lines of Code Today
Tags: selfcare, health, rest
Published: 2019-05-05 03:55:16

---
title: I Wrote Zero Lines of Code Today
published: true
description: There are a ton of projects on my to-do list, but it's just been one of those days.
tags: self-care, health, rest
cover_image: https://firebasestorage.googleapis.com/v0/b/ashleemboyer-2018.appspot.com/o/images%2Frelax.jpg?alt=media&token=5398e4d9-c096-42c3-8166-5eb1e65d188b
canonical_url: https://ashleemboyer.com/i-wrote-zero-lines-of-code-today
---

*You can also find this post [on my blog](https://ashleemboyer.com/i-wrote-zero-lines-of-code-today).*

Sometimes you need a day. When you have a job in tech, the amount of available knowledge to us can both incredible and staggering. We fear to look unintelligent to our peers and colleagues, so feel obligated to learn everything we can. The desire to learn is not the issue here, though. What's important to remember, is that it's impossible to learn *everything*.

You can spend hours on end reading up on the newest frameworks and testing them out, but you know what? That framework will still be there tomorrow. You don't have to spend every waking or free hour writing code. I'm *not* saying you should procrastinate learning or [give in to Resistance](https://www.amazon.com/gp/product/B007A4SDCG/ref=ppx_yo_dt_b_d_asin_title_o00?ie=UTF8&psc=1). All I'm saying is, really listen to your body. If you're falling asleep while sitting at your desk or on the couch, it's probably time to take a nap or go to bed. If it's taking you 3 or 4 times as long to complete a task because you're feeling anxious, it's probably time to step away.

Don't be afraid to put some things down for a minute. Your best work is done when you're feeling your best. But if you can't put the things down right now, make sure you are [taking breaks](https://ashleemboyer.com/don-t-forget-to-take-breaks). Please don't put your own health on the line for this. One day will not put you behind. Care for yourself. You deserve it.

---

Did you know I have a newsletter? 📬

If you want to get notified when I publish new blog posts or make major project announcements, head over to [https://ashleemboyer.com/newsletter](https://ashleemboyer.com/newsletter).

---

*[Image](https://unsplash.com/photos/zlABb6Gke24) by [Clem Onojeghuo](https://unsplash.com/@clemono2) on [Unsplash](https://unsplash.com).*
Initial planning for sentiment-chat
Tags: javascript, nlp, react, node
Published: 2019-05-05 03:09:50

---
title: Initial planning for sentiment-chat
series: sentiment-chat
published: true
description: 
tags: javascript, nlp, react, node
---

Alright, I'm working on a fun side project now. I'll be blogging my way through the process and the design decisions that I'm making. This is part 1.

First off, here's what I want from the app.

It's an NLP/sentiment analysis driven chat app. Two people will be able to use the app to communicate. However, instead of receiving another person's words, users will receive a block of color, based off of the results of a sentiment analysis or NLP library.

For starters, I'm planning on using [sentiment](https://www.npmjs.com/package/sentiment). It'll return a `comparative score`, which is calculated by taking each word in a string, making a judgment on how positive/negative they are, and averaging all of those results to get a final score that lands somewhere between -5 (extremely negative) and 5 (extremely positive). It's only one number, but it's a floating point, so we'll be able to get a nice gradation of values along at least one axis.

Sentiment is supposed to be fairly fast, [benching around 860k operations/sec on its creator's macbook pro](https://www.npmjs.com/package/sentiment#benchmarks). This should be essentially real-time for my usage.

Right now, I'm planning to implement sentiment as part of the client bundle, so users won't have to wait on network latency to see their colors. I'm imagining a flow that works something like this:

user input -> reducer (sentiment) -> state -> websockets connection -> chat partner (render it as color)

Today, I'm aiming to finish user input, reducer, state, and color-display functionality. I'll do websockets (or socket.io) next, then start work on finessing the UI/UX.

As far as the tech stack I'm on, it'll be React (with hooks) for the frontend, Node + Express for the backend, and userstorage to cache message history. At some point I might set up a database for chat history, but it doesn't matter that much for this kind of art-y project. Might be fun to export chat history as some kind of a gradient as well.

More to come in future posts.
Thoughts on SaaS Tenant-Level User Management
Tags: saas, design, webdev, aws
Published: 2019-05-05 02:48:56

---
title: Thoughts on SaaS Tenant-Level User Management
published: true
description: 
tags: saas, design, webdev, aws
---

## Background

I'm designing a multi-tenant SaaS app to help businesses manage inventory. The backend is all Serverless using AWS Lambda for business logic, Cognito for user management and role access, DynamoDB for data storage, CloudFormation for configuring and updating the stack, as well as provisioning new tenants.

The frontend is JAMStack vanilla javascript hosted on S3 and provided by Cloudfront Edge.

Each code push triggers a Lambda function that builds the project, runs tests, and if successful pushes any new lambdas and replaces the static web assets. 

## User Management

Every user account is assigned a `tenant-id` that matches them to the company they work for. Using IAM I can create Groups for each user to manage their roles. `HR`, `Dispatch`, `Warehouse`, and `Driver` might be good examples, each with specific role access on the backend that defines which resources they can interact with, and are also exposed to the front end so I can customize the interface to reflect the actions they can take. 

Someone who has read-only access to the inventory won't be able to select items, because they can't do anything with them if they could.

The `HR` group has read and write permissions for users. When there's a new hire, it's up them to create a new user account and assign it the relevant role.

I don't want to let HR have access to the user's password, so either the user changes their assigned password later or I open account creation to the public and then it becomes HR's job to assign roles to the account after the user creates it. I like that better, but I'm unsure how well that will work with many accounts to create and roll out. They might prefer to batch out a whole fleet of accounts and let the users handle their own authentication afterward.
Responsive Text
Tags: html, webdev, css, responsive
Published: 2019-05-05 01:22:23

---
title: Responsive Text
published: true
description: 
tags: html, webdev, css, responsive
---

Every once in a while I find myself writing paragraphs of text that look fine on desktop, but on mobile are an indecipherable wall of text that would make Tolkien proud. 

To get around this, I've started using `<br />` elements between each sentence in my paragraphs and then using media queries to hide them on larger screen sizes.

https://codepen.io/anon/pen/dEyPep

```html
<p>
    Spicy jalapeno bacon ipsum dolor amet ball tip meatball burgdoggen cupim buffalo elit beef shank. 
    <br class="minor" />
    Ball tip biltong shoulder, officia tenderloin duis ut voluptate proident cupidatat bacon reprehenderit capicola. 
    <br class="major"/>
    Sunt in in, non filet mignon flank chuck cow eiusmod laboris officia alcatra aute. 
    <br class="minor"/>
    Officia commodo ut in, meatloaf veniam velit eu consequat. 
    <br class="major"/>
    Magna corned beef tail short loin enim, pastrami picanha shank meatloaf in burgdoggen pancetta frankfurter t-bone.
</p>
```

```scss
br {
  line-height: 2rem;
  @media screen and (min-width: 500px) {
    &.minor {
      display: none;
    }
  }
  @media screen and (min-width: 800px) {
    &.major {
      line-height: 1rem;
    }
  }
  @media screen and (min-width: 1000px) {
    &.major {
      display: none;
    }
  }
  
}

```

You can tweak the breakpoints to match your specific layout.

Demo here: https://codepen.io/anon/pen/dEyPep
Sirix - Released 0.9.1 (time travel queries and versioning made easy)
Tags: versioning, json, xml, vertx
Published: 2019-05-04 23:15:42

---
title: Sirix - Released 0.9.1 (time travel queries and versioning made easy)
published: true
description: 
tags: versioning, json, xml, vertx
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wsg7678lqpecq6z3w16m.png
---

Hi all,

I want to release version 1.0.0 soon, but would love some input, as I added a complete native JSON storage about three weeks ago (several layers) :-)

I've just published an article called Asynchronous, Temporal REST with Vert.x, Keykloak and Kotlin Coroutines: https://hackernoon.com/asynchronous-temporal-rest-with-vert-...

And another one about some use cases and internals: https://hackernoon.com/sirix-io-why-copy-on-write-semantics-...

I've also added a bunch of documentation on the website :-)

Have a great weekend :)

Kind regards
Johannes

https://sirix.io
Como obtener ETH de Rinkeby Testnet
Tags: buidlhonduras, ethereum, rinkeby
Published: 2019-05-04 22:22:50

---
title: Como obtener ETH de Rinkeby Testnet
published: true
description: Tutorial de como obtener tokens de Rinkeby Testnet
tags: buidlhonduras,ethereum,rinkeby
cover_image: https://thepracticaldev.s3.amazonaws.com/i/i1625ktpjcdobipc2scq.png
series: BUIDL Honduras

---

Este es un tutorial corto de como obtener Rinkeby ETH, útil para probar aplicaciones decentralizadas.

### Pasos

#### 1. Instalar Metamask en metamask.io [(tutorial de Metamask)](https://medium.com/affogato-network/tutorial-de-metamask-a98d9aed7659)

#### 2. Copiar tu Address 

![Screenshot](https://thepracticaldev.s3.amazonaws.com/i/uzqemrk5s6vy0gomdz5m.png)

#### 3. Crear un post en Twitter ingresando la información de tu address. Por ejemplo:

> Requesting faucet funds into 0x0000000000000000000000000000000000000000 on the #Rinkeby #Ethereum test network.

#### 4. Ingresar a https://faucet.rinkeby.io/


#### 5. Ingresa en el campo el url del tweet y presiona "Give Me Ether"

*Eso es todo! ya estas listo para usar tu ETH de pruebas en la red Rinkeby.*
If Debian says "The following packages have been kept back:"
Tags: debian, linux
Published: 2019-07-12 18:02:35

---
title: If Debian says "The following packages have been kept back:"
published: true
tags: debian,linux
canonical_url: https://ofdigitalwater.postach.io/post/if-debian-says-the-following-packages-have-been-kept-back
---

According to [this askubuntu.com question](https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it), if your Debian-based Linux tells you `The following packages have been kept back:` while upgrading, you might do this:

1. Run `sudo apt-get --with-new-pkgs upgrade`
2. Run `sudo apt-get install <list of packages kept back>`
3. (If nothing else helps, run `sudo apt-get dist-upgrade`, but beware of automatic package removals!)
How can you prepare for a job at Google?
Tags: discuss
Published: 2019-05-04 21:20:20

---
title: How can you prepare for a job at Google?
published: true
description: 
tags: discuss
---

There's a ton of articles and advice out there on how to prepare for a coding interview for companies like Facebook, Google, Netflix, etc.

This is great and extremely helpful for actually landing a job (even if it's not at one of those top tech companies.)

However, I don't think it's enough. 

I don't know about you guys, but if I ever did land a job at Google or Facebook, I wouldn't want to feel like I got it just cause I was able to "hack" my way through the interview process.

I'd rather go in on my first day feeling prepared for whatever challenge "X" company throws my way, instead of feeling like I'm not cut out for the role and wondering how long it will take for them to realize the interview was just a fluke.

With that in mind, what's your best advice on how to prepare for an actual programming *job* and not just the programming *interview.*

*I used Google in the title as an example, but I want to keep this discussion as open as possible, so I'd love to hear your advice even if you don't work at one of the FANG companies.*
Verifying Twitch Webhooks in Rails
Tags: twitch, rails, webhooks, ruby
Published: 2019-05-04 21:20:05

I was recently working on adding some Twitch embedding support to dev.to! Part of this was adding webhook support.

One of the things that Twitch recommends doing, and I wanted to do, was verify that the webhooks came from Twitch and not a malicious third party. This works by passing a secret when you register for the webhook and using that and the contents of the body to create a hash and verify the payload came from Twitch.
The bottom of their Webhook Guide mentions verifying payloads but doesn't give a lot of context of how to actually do that, [https://dev.twitch.tv/docs/api/webhooks-guide/](https://dev.twitch.tv/docs/api/webhooks-guide/)

At first I thought I needed to do a 'normal' SHA256 with the secret and payload data concatenated together. But this was not correct I needed to make a SHA256 HMAC using the secret as the HMAC secret, and the payload as the entirety of the body. I figured this out by reading some issues online, but they were all in JS so I had to figure out the right Ruby methods to use and luckily that wasn't too hard.

Here is the long for way to do this in Ruby using the OpenSSL Library

~~~ruby
digest = OpenSSL::Digest::SHA256.new
secret = "SECRET_SENT_TO_TWITCH_AT_WEBHOOK_REGISTRATION"
hmac = OpenSSL::HMAC.new(secret, digest)
hmac << "BODY_OF_PAYLOAD_HERE"
hmac.hexdigest
~~~

There is also a short cut method that looks like this!

~~~ruby
secret = "SECRET_SENT_TO_TWITCH_AT_WEBHOOK_REGISTRATION"
OpenSSL::HMAC.hexdigest("SHA256", secret, "BODY_OF_PAYLOAD_HERE")
~~~

What this actually looked like in the Rails project I was working on was something like this to determine if the request was valid. This assumes the Twitch Secret is stored in an ENV variable.

~~~ruby
def webhook_verified?
  twitch_sha = request.headers["x-hub-signature"]
  digest = OpenSSL::HMAC.hexdigest("SHA256", ENV["TWITCH_WEBHOOK_SECRET"], request.raw_post)

  twitch_sha == "sha256=#{digest}"
end
~~~

I used this method in my controller action to determine what action to take in response to the webhook! In case the webhook is not verified I decided to simply reply with a 204 No Content, and make no local changes. This way if some malicious actor was trying to impersonate Twitch I would not immediately alert them of their requests failing.
How Do You Track GitLab Tickets?
Tags: gitlab
Published: 2019-05-04 19:39:03

---
title: How Do You Track GitLab Tickets?
published: True
description: Learn about my approach to track GitLab tickets to be more organized 
tags: #gitlab
---

In my position as Product Manager I want to make sure that I follow the track of some tickets (or ‘issues’ as GitLab call them). Sometimes those tickets needs to be taken care by me and sometimes by others. But most important — I want to make sure I don’t forget those tickets.

So I found a nice way to make sure I don’t forget them by using GitLab options with combination of my Chrome Extension — <a href="https://chrome.google.com/webstore/detail/gbb-gitlab-board-better/fjhimlhfidegbajaoaagkogellknammf?ref=devtochequered" target="_blank">GitLab Board Better :)

<img src="https://thepracticaldev.s3.amazonaws.com/i/77tfp86dz3dugoysi2vx.jpeg">

## How To — The Chequered Flag Icon

1. I add Chequered icon/reaction 🏁 to every ticket I want to track

<img src="https://cdn-images-1.medium.com/max/1600/1*uc7WPSHulBIIO7NXbP5M-g.png">

2. I use GitLab Board search bar to find all tickets which include my ‘Reaction’ with this flag

<img src="https://cdn-images-1.medium.com/max/1600/1*vojh0qEKSmTl6dKjM35IyQ.png">

3. Last, I convert current URL to filter by using GBB

<img src="https://cdn-images-1.medium.com/max/1600/1*vQ7ja16-YhBByoUpzkNHhA.png">

That’s it! I simply click on chequered icon almost everyday and use it like a to-do list.

## And last tip…

If you have a designer in your team that you don’t want to forget to talk with him about some tickets, mark them with a different icon. So you have a nice filter bar with icons :)

<img src="https://cdn-images-1.medium.com/max/1600/1*6hesTSWlltd9k2jgINB8uw.png">

## The End

- Get GitLab Board Better extension from the <a href="https://chrome.google.com/webstore/detail/gbb-gitlab-board-better/fjhimlhfidegbajaoaagkogellknammf?ref=devtochequered" target="_blank">Chrome Web Store</a>
- Follow/talk with me on <a href="https://twitter.com/erezson/" target="_blank">Twitter</a>
- Be my friend on <a href="https://www.linkedin.com/in/erezson/" target="_blank">Linkedin</a>
Org mode with Spacemacs
Tags: emacs, orgmode, gtd
Published: 2019-05-04 21:18:47

---
title: Org mode with Spacemacs
published: true
description: Video tutorial on using org mode with Spacemacs
tags: Emacs, org mode, gtd
---

I recently started making videos about Spacemacs and my most recent one is about using org mode. You can find it [here](https://youtu.be/S4f-GUxu3CY). 

I'm looking for general feedback as well as suggestions. Current plan is to keep making videos in this style for a number of spacemacs topics as well as for other productivity boosting tools like i3, zsh, etc. Hope you all like it :)
Sankaku Complex XSS
Tags: xss, security, web, bug
Published: 2019-05-04 20:50:14

---
title: Sankaku Complex XSS
published: true
description: A short blog on how I found my first XSS
tags: xss, security, web, bug
---

### first written January 19, 2019

This is, officially, my first recognized XSS bug that I've found. I am super excited because it basically confirmed that I am doing the right things in general and just need to be more patient about it. As they say, "everything is time" :) 

So here I was, chilling in the morning, checking websites, and I decide to be a degen and visit my favorite animu/mango/hentai site, [Sankaku Complex](https://www.sankakucomplex.com).

Sankaku has a long history of posting adult material on their website, and at some point implemented a simple disclaimer pop-over. I happened to notice that the URL that shows up in the bottom bar when you rollover the link was different and indicated a middleman URL with a redirect.

Right-click, copy link location. Paste in new tab. Such hacker, wow.

So, there IS a middleman!

```
https://www.sankakucomplex.com/mature-content-disclaimer/?then=
```

Basically, the "then" parameter is used to generate the Yes/No links on that page, which is crazy because it isn't being properly sanitized.

I played around for a few minutes until I broke the system and could observe some behavior. It is amazing how many things will break if you just try inputting a single double-quote and a greater-than character `">`.

Turns out on that field, you can inject arbitrary HTML, including `<script>` tags!

The string `">` is all it took to break the page.

However, the full payload could be as short as: 

```
"><script>alert()</script>

https://www.sankakucomplex.com/mature-content-disclaimer/?then="><script>alert()</script>
```

The public disclosure date was 17 February 2019, and the report can be located at: [https://www.openbugbounty.org/reports/726249/](https://www.openbugbounty.org/reports/726249/)

-----

# [If you need a Computer Science tutor, code reviewer, or just someone to pair program with, hit me up](https://codementor.io/mikebell66)