teleren/devto huggingface dataset:
Migrating from Heroku to AWS with kubernetes and without stopping production
Tags: heroku, aws, kubernetes, devops
Published: 2018-03-15 10:00:20

---
title: Migrating from Heroku to AWS with kubernetes and without stopping production
published: true
description: 
tags: heroku, aws, kubernetes, devops
---

A couple of months ago, we successfully migrated a larger part of our infrastructure from Heroku to AWS. Now, when the dust (or should I say the cloud) has settled, we’d like to share what was the main driver behind our decision and how we approached the transfer without stopping Voucherify API, even for a minute.

## Architecture summary
To better understand our reasoning here, let’s take a quick look at what Voucherify is and what the architecture looks like.

Voucherify offers programmable building blocks to build coupon, referral, and loyalty campaigns. It’s basically an API-first platform which devs can use to build complex and personalized promotional campaigns, like send a customer an email with a specific coupon code when he or she joins a “premium” segment. It also allows companies to track coupon redemptions to figure out what promotions work best. Lastly, it provides a dashboard for marketers to take the burden of promotions’ maintenance and monitoring off developers’ shoulders.

The platform consists basically of 3 components:

* Core application exposing the API
* Website serving the dashboard
* Supporting microservices for non-API related jobs
* When it comes to data storage, we employ Postgres, Mongo, and redis trio.

This is how it looks after the migration:
![](https://thepracticaldev.s3.amazonaws.com/i/wvxl8q1o22kr3jh9z10h.png)

**The load**: We serve over 100 customers, who send a couple of million API calls monthly, including both regular requests and some more power-consuming ones like bulk imports/exports or syncs with 3rd party integrations.‍

**Why Heroku in the first place and why did we migrate?** Read more on our [blog](https://www.voucherify.io/blog/migrating-from-heroku-to-aws-with-kubernates-and-without-stopping-production?utm_campaign=tofu&utm_medium=post&utm_source=devto).
Deploying Static Site To Netlify
Tags: nuxt, vue, contentful, netlify
Published: 2018-03-15 09:18:53

---
title: Deploying Static Site To Netlify
published: true
description: See how to deploy a static site to Netlify
tags: nuxt.js, vue.js, contentful, netlify
---

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

In this tutorial, we'll look at how to deploy our static blog built with Nuxt.js and Contentful to Netlify:

{% youtube vkoVJkWb84A %}

### Related tutorial
[Build A Static Blog With Nuxt.js And Contentful](https://dev.to/mezie/build-a-static-blog-with-nuxtjs-and-contentful--202l)
Build A Static Blog With Nuxt.js And Contentful
Tags: nuxt, vue, contentful
Published: 2018-03-15 09:16:00

---
title: Build A Static Blog With Nuxt.js And Contentful
published: true
description: See how to build a static blog with Nuxt.js and Contentful
tags: nuxt.js, vue.js, contentful
---

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

In this tutorial, we look at how to build a static blog with Nuxt.js and Contentful:

{% youtube Pa5t8KyEORs %}

The code for this tutorial is available on [GitHub](https://github.com/tutstack/nuxt-static-blog)

### Related tutorial
[Deploying Static Site To Netlify](https://dev.to/mezie/deploying-static-site-to-netlify--3760)
How do you deal with a lot of meetings?
Tags: workplace, beginners, productivity, discuss
Published: 2018-03-15 07:05:32

---
title: How do you deal with a lot of meetings?
published: true
description: attending meetings
tags: workplace, beginners, productivity, discuss 
---

You've a 3 weeks long Sprint and your manager wants you to go meetings worth 3-5 days of working time and this time isn't allocated in the sprint? How do you deal with this kind of situations? Do you take your laptop with you and keep working? Or do you work late after to get your work done? Or do simply tell your manager that this time hasn't been allocated in the sprint?
Tech T-Shirts?
Tags: discuss
Published: 2018-03-15 05:32:36

---
title: Tech T-Shirts?
published: true
tags: #discuss
---

Who has fallen down the tech/developer t-shirts hole?

I know I'm totally nerded out wearing all of the crazy dev t-shirts I've collected over the year. I just can't help myself! I've even gone as far as [creating my very first tech t-shirt](https://ua1.us/tech/t-shirts/my-cookies-cant-be-dipped-in-milk-funny-tech-t-shirt/)!
Utilidades: Scripts com Powershell
Tags: windows, powershell
Published: 2021-04-14 12:12:44

---
title: Utilidades: Scripts com Powershell
published: true
date: 2018-03-15 03:00:00 UTC
tags: Windows,Powershell
canonical_url: https://andersonbraz.com/utilidades-scripts-com-powershell
---

Atuando na sustentação ou operação de aplicações para ambiente de produção. Sempre nos deparamos com situações corriqueiras que demandam a necessidade de tratarmos incidentes ou atividades de trabalho em curto espaço de tempo.

Tratando-se de ambientes Windows eu costumo lançar mão de algumas rotinas utilizando o Powershell. E aqui gostaria de compartilhar alguns dos meus procedimentos mais rotineiros.

## Verificação de Políticas de Execução

```
Get-ExecutionPolicy -List

```

## Habilitando Políticas de Execução sem Restrições

```
Set-ExecutionPolicy Unrestricted

```

## Exclusão de Arquivos

Script para apagar arquivos temporários, ou com uma determinada extensão, de um determinado diretório especifico.

```

$FilePath = "C:\Windows\Temp\*"
$KeyWord = "*.tmp"
$Files = Get-ChildItem -Path $FilePath -Include $KeyWord -Recurse

ForEach($File In $Files)
{
    $Item = $File.FullName
    Write-Output $Item
    Remove-Item $Item -Force
}

```

* * *

## Exclusão de Diretórios

Script para apagar diretórios que contenham uma determinada palavra num determinado local especifico.

```

$FolderPath = "C:\Temp\"
$KeyWord = "*Quarantine*"
$Files = Get-ChildItem -Path $FolderPath -dir -r | Where-Object {$_.name -like $KeyWord}

ForEach($Folder In $Folders)
{
    $Item = $Folder.FullName
    Write-Output $Item
    Remove-Item $Item -Force -Recurse
}

```

* * *

## Compactação de Arquivos (7zip)

```

$KeyWord = "*.log"
$LogPath = "E:\Logs\W3SVC*\"
$Limit = (Get-Date).AddDays(-150)

$Files = Get-ChildItem -Path $LogPath -Include $KeyWord -Recurse | Where CreationTime -lt $Limit
ForEach ($File In $Files) 
{
    $Item = $File.FullName
    Write-Output "File Found: " $Item 
    & "E:\Program Files\7-Zip\7z.exe" a -tzip ($Item + ".zip") $Item

}

```

* * *

## Validar Acesso ao Ip:Porta

```
New-Object System.Net.Sockets.TcpClient("192.168.0.15", 80)

```

* * *

## Verificar Tamanho de Diretórios

```
$Path = "C:\inetpub\wwwroot\andersonbraz\"
$colItems = Get-ChildItem $Path | Where-Object {$_.PSIsContainer -eq $true} | Sort-Object

ForEach ($i In $colItems)
{
    $subFolderItems = Get-ChildItem $i.FullName -Recurse -Force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -Property Length -Sum | Select-Object Sum
    $i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
}

```

## Créditos

Photo by [Pakata Goh](https://unsplash.com/@pakata?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
Has anyone created a Node.js app that renders HTML instead of JSON?
Tags: discuss
Published: 2018-03-14 16:58:37

---
title: Has anyone created a Node.js app that renders HTML instead of JSON?
published: true
tags: discuss
---
I'm working on a side project that really benefits from an asynchronous web framework, so I decided to try Node.js. From the tutorials I've seen online, it seems that most Node developers are using it for a JSON API that connects to an SPA frontend. I would prefer to do server rendered templates instead. If you've made a site like this before, what templating engine did you use and what did you use for integration tests? I appreciate any tips!
Troubleshooting Webtasks: Using the Editor
Tags: serverless, webtask, troubleshooting
Published: 2018-03-14 16:52:45

---
title: Troubleshooting Webtasks: Using the Editor
published: true
description: Learn how to troubleshoot webtasks from monitoring logs in the editor all the way to debugging locally using devtool and visual studio code.
tags: #serverless #webtask #troubleshooting
canonical_url: https://auth0.com/blog/troubleshooting-webtasks-using-the-editor/
---

In this series, we will learn how to troubleshoot webtasks from monitoring logs in the editor all the way to debugging locally using devtool and visual studio code.

This post covers the tools built into the Webtasks Editor, here are some shortcuts to help you locate the topics you are interested in quickly.

[Read on 🔍🐞](https://auth0.com/blog/troubleshooting-webtasks-using-the-editor/?utm_source=dev&utm_medium=sc&utm_campaign=troubleshooting_webtasks)

![Troubleshooting Webtasks: Using the Editor](https://thepracticaldev.s3.amazonaws.com/i/4sknio8vayz7ofl1gp3q.png)
Pi Day: Estimating the value of Pi
Tags: pi, math, piday
Published: 2018-03-14 15:05:43

---
title: Pi Day: Estimating the value of Pi
published: true
description: Write some simple code to use Nilakantha Series to estimate Pi.
tags: Pi, Math, PiDay
---
It's Pi day (March 14) and one question you may be wondering is “how is Pi calculated?”

Measuring circles can give a rough estimate, but an infinite series is perhaps a better and more common way to do it. As described on Calculating Pi at MathCareers.org.uk, the Nilakantha Series works pretty well. Its formula looks like this:

Nilakantha Series: π = 3 + 4 / (2×3×4) − 4 / (4×5×6) + 4 / (6×7×8) − 4 / (8×9×10) + …

You ought to be able to figure out a pattern from that. And it’s a short leap to convert that to [Xojo code](http://www.xojo.com). Here’s code that calculates Pi using the Nilakantha Series:


    Dim even As Boolean = True
    Dim calc As Double
    Dim calcStart As Int64
 
    Dim iterations As Integer
    While iterations < 1000
      iterations = iterations + 1
      calcStart = calcStart + 2
      calc = 4.0 / (calcStart * (calcStart + 1) * (calcStart + 2))
 
      If even Then
        Pi = Pi + calc
      Else
        Pi = Pi - calc
      End If
 
      even = Not even
    Wend

Here’s a completed project you can run in Xojo: [CalcPi Project](http://cdn.xojo.com/BlogExamples/CalcPi.xojo_binary_project)

The above code correctly calculated the first 9 digits of Pi almost immediately. Unfortunately, calculating more digits of Pi is not really practical using the standard double-precision floating point data type used in most programming languages.
How to break elements outside of their container with CSS
Tags: css, howto
Published: 2018-03-14 12:35:38

---
title: How to break elements outside of their container with CSS
published: true
description: Learn how to "break" elements outside of their containers using the :not selector.
tags: css,how-to
---

{% youtube UQpvYbFNzFc %}

View the source files on [Github](https://github.com/alexcarpenter/screencasts/blob/master/13-breakout-css/index.html).
Setting Google Analytics with react, redux, material-ui etc.
Tags: react, materialui, ga
Published: 2018-03-14 11:45:16

---
title: Setting Google Analytics with react, redux, material-ui etc.
published: true
description: 
tags: React,Material-UI,GA
---


# Installation

```
yarn add react-ga
```

# Code

### Initialize


```jsx
import ReactGA from 'react-ga'
ReactGA.initialize('UA-000000-01')
```

### Bind react-router

```jsx
export const history = createHistory()
history.listen((location, action) => {
  ReactGA.set({ page: location.pathname })
  ReactGA.pageview(location.pathname)
})
```


### Record material-ui/Popover


```jsx
import React from 'react'
import ReactGA from 'react-ga'
import Popover from 'material-ui/Popover'

export default ({name, ...rest}) => {
  return (
    <Popover
      onEntered={() => ReactGA.modalview(name)}
      {...rest}
    />
  )
}

```

### Record material-ui/Dialog


```jsx
import React from 'react'
import ReactGA from 'react-ga'
import Dialog from 'material-ui/Dialog'

export default ({name, ...rest}) => {
  return (
    <Dialog
      onEntered={() => ReactGA.modalview(name)}
      {...rest}
    />
  )
}

```
Recomandation for Automatization  
Tags: crud
Published: 2018-03-14 11:01:51

---
title: Recomandation for Automatization  
published: true
description: 
tags: crud, 
---


Hi, i want do a Abstract class what ca be use to inheritentence for other class.

I have around 20 table, and i wanna apply DRY for write just few line for each table.

Every book, every tutorial will be wellcome , thanks!
Linux Process Management Commands
Tags: linux, beginners
Published: 2018-03-14 09:35:09

---
title: Linux Process Management Commands
published: true
description: 
tags: #linux #beginners 
---

In server administration, it is very important to understand how the running processes work in detail, from high load to slow response time processes. When your server becomes so slow or fails to respond, you should understand the process management or Linux process management in specific to an action.

When it is the time to kill a process or renice it and how to monitor the currently running processes and how these processes affect the system load. Let’s see how Linux process management will help us tune the system.
1 Process Types
2 Memory Management
3 Managing virtual memory with vmstat
4 System Load & top Command
5 Monitoring Disk I/O with iotop
6 ps command
7 Monitoring System Health with iostat and lsof
8 Calculating the system load
9 pgrep and systemctl
10 Managing Services with systemd
11 Nice and Renice Processes
12 Sending the kill signal

https://likegeeks.com/linux-process-management/

Hope you like it.

Regards,
LetsEncrypt: Wildcard support
Tags: letsencrypt, https
Published: 2018-03-14 09:34:24

---
title: LetsEncrypt: Wildcard support
published: true
description: Starting from today, you can issue wildcard certificates.
tags: letsencrypt, https
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cmefbsicobdx47ir29hm.png
---


Starting from today, you can issue wildcard certificates using a client that supports ACME v2 ([acme.sh](//acme.sh) for example).

Some useful links:

* [The announce](https://community.letsencrypt.org/t/acme-v2-and-wildcard-certificate-support-is-live/55579)
* [Technical information about ACMEv2](https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578)

LetsEncrypt is a non-profit organization, so they need a lot of support from the community. Consider to [donate to them](https://letsencrypt.org/donate/) or [become a sponsor](https://letsencrypt.org/become-a-sponsor/) if you're using LE in production.
Interruptions in the open office
Tags: interruptions, openoffice, frustration, discuss
Published: 2018-03-14 05:32:23

---
title: Interruptions in the open office
published: true
description: More than a post is a question
cover_image: https://thepracticaldev.s3.amazonaws.com/i/d3kmjb6qv030dro5tbt6.jpg
tags: interruptions, open_office, frustration, discuss
---

Hi everyone! Since this is my first post i will keep it simple.

## How you and your team manage the interruptions that comes with a open office space?

### Do you have rules? Or just let it be and deal with the consequences?

Greetings!!
A Simple Way To Run JS in Background Thread on React Native
Tags: reactnative, javascript, react
Published: 2018-03-14 02:39:58

---
title: A Simple Way To Run JS in Background Thread on React Native
published: true
description: 
tags: react-native, javascript, react
canonical_url: https://medium.com/@inkdrop/a-simple-way-to-run-js-in-background-thread-on-react-native-8fff345576da
---

CPU intensive tasks block UI, like indexing. Because, in React Native, JavaScript is executed on JavaScriptCore which means that you have only 1 thread. So you have to use a native module like [react-native-workers](https://github.com/devfd/react-native-workers) which provides similar API as [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers). But it’s kind of an overspec way if you just want to run a simple task in background. I don’t feel like installing many native modules into my app because they would make the app more complicated and fragile. If you have an expo app, it can’t use native modules.

I found that we already have background threads out of the box. That is, [WebView](https://facebook.github.io/react-native/docs/webview.html). You can run JavaScript in it by calling `injectJavaScript` method. Inside webview, it is another instance of Safari(iOS)/Chrome(Android), so JS running in it won’t block the app UI at all. I checked that on both platforms by running following code:

```js
for (;;) { Math.random() * 9999 / 7 }
```

This is useful. You don’t have to install native modules to run code in background thread!
Here is an example:

```jsx
import React, { Component } from 'react'
import { WebView } from 'react-native'

export default class BackgroundTaskRunner extends Component {
  render() {
    return (
      <WebView
        ref={el => this.webView = el}
        source={{html: '<html><body></body></html>'}}
        onMessage={this.handleMessage}
      />
    )
  }
  runJSInBackground (code) {
    this.webView.injectJavaScript(code)
  }
  handleMessage = (e) => {
    const message = e.nativeEvent.data
    console.log('message from webview:', message)
  }
}
```

To get a result of the code, you can specify `onMessage` prop to your webview.
A function that is invoked when the webview calls `window.postMessage`. Setting this property will inject a `postMessage` global into your webview, but will still call pre-existing values of `postMessage`.
`window.postMessage` accepts one argument, `data`, which will be available on the `event` object, `event.nativeEvent.data`. `data` must be a string.

Just call it on webview:

```js
const message = { ok: 1 }
window.postMessage(message)
```

Then you get the message on the app:

```
message from webview:, { ok:1 }
```

That's it! 😄
Discuss: How do you work with your testers?
Tags: discuss, testing, testers, automationtesters
Published: 2018-03-13 19:07:07

---
title: Discuss: How do you work with your testers?
published: true
description: How do you work best with your testers? Where do you see the value of testers?
tags: discuss, testing, testers, automation testers
---

I recently started at a new job with testers in the teams. Having never worked with testers, I am curious to see what you all think of the best ways to work with them.

I've had 1:1s with the testers, but keen to get other thoughts and find out what works for your business and team. 


Finally, what skill level of programming are your testers, and how does that affect the working relationship?
Changelog: Chronofilters!
Tags: meta, changelog
Published: 2018-03-13 17:20:31

---
title: Changelog: Chronofilters!
published: true
description: We now have filters on the home page and the tag pages which will help folks discover the most interesting content from the past while.
tags: meta, changelog
---

**Chronofilter?** It's a weird name but that's what I called my branch and I'm sticking with it!

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

We now have filters on the home page and the tag pages which will help folks discover the most interesting content from the past while. The cream rises to the top really well this way.

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

This will make spending time in the tag pages more valuable. As someone who has trouble keeping up with the JavaScript community's pace of progress, this should help me click in and get a look at what the community engaged with most in the past week or month. And if you only come to the [dev.to](/) about once a week, this will help you catch up.

The _latest_ tab might get spammy sometimes because it's the latest unranked and unmoderated content, but dipping in there to ❤️ the posts you like will go a long way in ensuring good content across the site. And we are always working on improving our ranking and moderation systems.

Anyway, hope folks enjoy the new navigation features!
Botters of the Galaxy - Complete Stream Collection
Tags: stream, rust, coding, ai
Published: 2018-03-13 17:00:49

---
title: Botters of the Galaxy - Complete Stream Collection
published: true
description: Writing and AI bot in Rust for a competition. All the streams in one place.
tags: stream, rust, coding, ai
cover_image: https://thepracticaldev.s3.amazonaws.com/i/colox2aw1d0ozf79wtpf.jpg
---

These are all the streams I did for the [Botters of the Galaxy](https://www.codingame.com/leaderboards/challenge/botters-of-the-galaxy/global) competition. I'll be doing a post-mortem a bit later.

## Day 1-1

{% youtube hu2xniVrpyU %}

## Day 1-2

{% youtube XfzmHvVTw5E %}

## Day 2-1 

{% youtube rZSaYBeherY %}

## Day 2-2 

{% youtube 1PTT5fZA_0Y %}

## Day ...3

{% youtube 1fNtCEOxqik %}

## Day 4

{% youtube 7z9Xl0Y_n6U %}

## Day 5

{% youtube ktT61yALodI %}

## Day 6 (Finale)

{% youtube pS_5rCfcljU %}
I am what I follow — Or maybe what I Wish to be
Tags: developer, feeds, reading
Published: 2018-03-13 14:52:07

---
title: I am what I follow — Or maybe what I Wish to be
published: true
description: 
tags: #developer #feeds #reading
---

I am a developer by heart whose brain is just not ready to settle on what to learn or do. Probably there are a lot of developers out there always want to learn a lot of things but end up doing nothing and getting lost in the 4th dimension(Internet) of things. Maybe our education system is to blame or the internet. We do not get things done unless someone has set fire on our asses saying — “I need this by end of the day”, not just says pays as well ;)

So for those developers here is a list of people or blogs you should follow and not get lost in the 4th dimension.

<a href="https://www.youtube.com/channel/UCxX9wt5FWQUAAz4UrysqK9A" data-href="https://www.youtube.com/channel/UCxX9wt5FWQUAAz4UrysqK9A" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">CS Dojo</a> — Algorithms explained

<a href="https://www.hackerrank.com/" data-href="https://www.hackerrank.com/" class="markup--anchor markup--p-anchor" rel="noopener nofollow" target="_blank">Hacker Rank</a> — Excellent challenges to assess yourself.

<a href="https://www.hackerearth.com/" data-href="https://www.hackerearth.com/" class="markup--anchor markup--p-anchor" rel="noopener nofollow" target="_blank">Hacker Earth</a> — Another great place to learn to programme

<a href="https://www.codecademy.com" data-href="https://www.codecademy.com" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">Code Academy</a>— Learning JS or creating websites

<a href="https://stackoverflow.com/users/22656/jon-skeet" data-href="https://stackoverflow.com/users/22656/jon-skeet" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">Jon Skeet</a> in depth, check out his answers on Stackoverflow, this guy earns more points in a day than my monthly salary :P

<a href="https://devhints.io/" data-href="https://devhints.io/" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">DevHints</a> — when your blank and not sure what to do fiddle in here

<a href="https://www.katacoda.com/" data-href="https://www.katacoda.com/" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">Kata Code</a> — Some guided courses

Facebook — Definitely not this

Most of the links mentioned above are platform independent interests. Here is a list of feeds I follow. Forgive me for not well-organised list. You can scavenge here and maybe you find something that interests you ;)

<a href="https://gist.github.com/unrealnerd/8d6c89fb4f76895ae5f29221509f17b1" data-href="https://gist.github.com/unrealnerd/8d6c89fb4f76895ae5f29221509f17b1" class="markup--anchor markup--p-anchor" rel="nofollow noopener" target="_blank">Subscriptions Feed</a>