teleren/devto huggingface dataset:
Get release tag from GitHub Actions to debug on Heroku
Tags: github, actions, cicd, heroku
Published: 2019-11-29 22:02:50

---
title: Get release tag from GitHub Actions to debug on Heroku
published: true
date: 2019-11-28 09:00:00 UTC
tags: github,actions,cicd,heroku
canonical_url: http://javaguirre.me/2019/11/28/getting-release-github-heroku-debug
cover_image: https://user-images.githubusercontent.com/488556/69891326-16b15380-12fc-11ea-944e-6b90128cb8a5.jpg
---

In TNP we’ve moved everything to GitHub Actions and we’re very happy about it. :-)

But… this article is not about how happy we are using it but a small tip on how we could simplify every day debugging with some simple improvements.

As a good metric oriented company, We measure and monitor everything we believe relevant, this is a solution to control which release we have in production and being able to monitor its breaking changes in a simple way.

We decided to add the git release tag to our deploy and our app footers, with the following steps.

First, We push to production only when a git tag (a release) is created on GitHub.

```yaml
jobs:
  ...

  deploy_production:
    ...

    if: success() && contains(github.ref, 'tags')
```

We deploy to Heroku where is super easy to set a config variable via API, so we decided to:

- Get the release tag from the current release
- Update a `RELEASE_VERSION` variable on Heroku every time a new deploy is successful.
- Profit!

```yaml
steps:
 - name: Push to Heroku
   run: git push -f https://heroku:${{ secrets.HEROKU_API_TOKEN }}@git.heroku.com/${{ secrets.HEROKU_APP_PRODUCTION }}.git origin/master:master
 - name: Update RELEASE_VERSION on Heroku production
   if: success()
   run: |
    curl -n -X PATCH https://api.heroku.com/apps/${{ secrets.HEROKU_APP_PRODUCTION }}/config-vars \
    -d '{
      "RELEASE_VERSION”: "${{ github.ref }}",
    }’ \
    -H "Authorization: Bearer ${{ secrets.GITHUB_API_TOKEN }}"
    -H "Content-Type: application/json" \
    -H "Accept: application/vnd.heroku+json; version=3"
```

We need to set two variables:

- `HEROKU_API_TOKEN`: Your personal token, you can get it from your [account settings](https://dashboard.heroku.com/account).
- `HEROKU_APP_PRODUCTION`: Your production app name on Heroku, we don’t hardcode it, so it’s easier to share these recipes in other projects.

That’s It! You’ll have something like this on your Heroku app if all goes well.

![Screenshot 2019-11-29 at 22 10 38](https://user-images.githubusercontent.com/488556/69890303-37c27600-12f5-11ea-9280-6a89fa3b74c4.png)

*Cover Image Garett Mizunaka - Unsplash*
#7DaysJS: Factorial and Average
Tags: javascript, challenge, beginners
Published: 2019-11-30 02:19:28

---
title: #7DaysJS: Factorial and Average
published: true
date: 2019-11-29 22:32:00 UTC
tags: javascript, challenge, beginners
canonical_url: https://lautarolobo.xyz/blog/7-days-of-js-factorial-and-average/
cover_image: https://lautarolobo.xyz/images/7daysJS-7f7d8328.webp
description: Welcome to day 1 of #7DaysJS!
---

Welcome to day 1 of 7 Days of JavaScript! A 7 days challenge to crack your head up into some simple but complex algorithms. Today we’ll work on writing two math functions, factorial and average.

To test and run JavaScript, you need the JSC compiler.

Just kidding! A compiler?! You can run it in your own browser!

But, I’ve found this website: [Playcode.io](https://playcode.io/). It has all I want, a minimalistic dark theme and a clean console. You can run the code wherever you want, but I encourage you to use Playcode, everything is just nicer.

Enough introduction, let’s dive right in!

## Factorial

So the factorial function takes a Natural number `n`, and returns the product between all the Naturales numbers that are between 1 and `n`, like this:

~~~java
5
//1*2*3*4*5
120
~~~


## Average

The average function is a well known one. It takes an array of numbers, sums them and divides that sum by the length of the initial array. Here’s an example:

```java
[1,5,8,4]
//(1+5+8+4)/4
4.5
```

Now it’s your turn. Give them a try, especially if you are kinda newbie on JavaScript because you’ll build a good understanding of how loops work.

Did you solve them already? Try a different approach! Making more than one solution will strengthen your knowledge, giving you some flexibility when facing problems. And that’s key when programming.

[Here](https://lautarolobo.xyz/blog/solution-to-day-1-of-7-days-of-js "Solution to Day 1 of 7 Days of JS") are the solutions.

See ya!
Meteor 1.8.2 is out
Tags: meteor, node
Published: 2019-11-30 09:44:00

As the title suggest a new minor version of [Meteor](https://www.meteor.com/) is out. The biggest update I'd like to highlight is the inclusion of typescript, which you can add to existing projects by running `meteor add typescript` or creating an new one with `meteor create --typescript new-typescript-app`.

[Filipe Névola](https://twitter.com/FilipeNevola), the new Meteor evangelist, wrote a beautiful [article](https://blog.meteor.com/announcing-meteor-1-8-2-13eab70a4bec) on medium detailing the changes that I highly recommend. 

I hope you have a nice day, bye!
I struggle with pacing, do you?
Tags: contentcreation, writing
Published: 2019-11-30 13:53:37

I've been programming since 1977. I have used programming as part of my professional life as an IT Support Technician since 1985 and since 2006 as a full-time software developer. In the last couple of days I've been posting items about the programming languages I use or have used. 

I find myself wrestling with a compulsion to write, to go flat out and post a write-up about every language I've ever known replete with links to the current implementation and anything else helpful I can think of. I actually don't have the time to do that but I'd almost happily give up food and sleep just for the endorphin rush of researching and writing. I remember having similar experiences when I was running my own [programming-related blog](http://codeaholic.blogspot.com/). (Nothing much happens there now because I'm writing straight into DEV.)

At the same time, there's the desire to pace things out a bit. I have to ask myself, "What's better: 52 articles at one per week and still be sane and productive at the end of a year, or one per hour and be institutionalized before the end of the week?" 

Someone once said, "it's better to burn out than rust out." With my 60th birthday 15 months away I'm wondering if there's a third alternative. My mind keeps coming back to the account in the book of Exodus where Moses sees a bush that is burning but the bush isn't being consumed by the fire. It's in Exodus 3:2. The Latin motto of many Presbyterian churches throughout the world (including Australia) refers to that event in the words *NEC TAMEN CONSUMEBATUR* meaning "And yet it was not consumed". Can I too burn but not burn out? 

I'm probably stuck with having to continue to wrestle, but I am going keep trying to pace myself. 

To the other content creators on DEV: how to do you keep yourself from going bananas yet keep a consistent amount of content flowing? How do you keep the fire of the passion of your craft from burning you up? How do you deal with the push from the other direction that slows you down toward inactivity and oxidization?
#7DaysJS: Even or Odd
Tags: javascript, beginners, challenge
Published: 2019-11-30 16:06:01

---
title: #7DaysJS: Even or Odd
published: true
date: 2019-11-30 15:17:00 UTC
tags: javascript, beginners, challenge
canonical_url: https://lautarolobo.xyz/blog/7-days-of-js-even-or-odd/
cover_image: https://lautarolobo.xyz/images/7daysJS-7f7d8328.webp
description: Second day of #7DaysJS! 
---

Welcome to day 2 of 7 Days of JavaScript!

Let’s begin our journey today. We need to write a function that takes an array and gives back two values: one with the sum of all the odd numbers of the array, and other with the sum of all the even numbers on the array.

It can’t be that hard right?

You can read the solution to today’s challenge [here](https://lautarolobo.xyz/blog/solution-to-day-2-of-7-days-of-js "Solution to Day 2 of 7 Days of JS").
What is an engineer's worth?
Tags: career
Published: 2019-12-01 13:45:04

An engineer's worth can be seen from the number of different perspectives they can look a problem from. As a software engineer I may think about getting things across the finish line. But I have found that if I start thinking it from someone else's perspective it makes my work better. Different people in different professions may look at things differently. e.g.

- Someone who is doing software testing might think "How do I break this", "What do developers usually not test"?
- Someone who manages Infrastructure might think "In what sequence would this get deployed" or "How many servers would this change require"?
- Someone who does ETL might think where is data coming from, where is it going?
- Someone who does BI might be more interested in what each column in a table means and how does it relate to business?
- Someone in customer success might be more interested in how will this be rolled out to customers? If something happens would there be workarounds for the customer? How would the team find out before the customer has to report the problem?
- Someone who has to increase sales for a product might be more interested in reducing the number of steps customer has to take to buy something to increase the likelihood of sales.
- Someone who has been working more as a SQL dev might tend to solve problems one tabular operation at a time, someone who has been working in general purpose programming languages might tend to solve problems one row at a time.

I recently started thinking much more about how to grow more as an engineer. This is the answer that I came up with. Try and put more hats when looking at a problem to make the solutions better.

What's your take on this?

---

If you want to know when I write more articles join telegram channel for [Data posts](https://t.me/aseem_data), [software posts](https://t.me/aseem_software) or [other posts](https://t.me/aseem_life). I don't spam, promise.
A Login Form built using React Hooks
Tags: react, typescript, javascript, opensource
Published: 2019-12-01 17:43:13

Created a simple login form using **React, Typescript and React Material UI** featuring `useReducer` and `useEffect` hooks.<br/>


![Login Form](https://cdn.dribbble.com/users/4100504/screenshots/8667299/media/0cbf1ed32f91e2ec74bc137a5e0061e3.png)

A detailed article on [How to build a React Login Form with Typescript and React hooks](https://surajsharma.net/blog/react-login-form-typescript)
New rails 6 app with postgresql database and heroku deployment
Tags: ruby, rails, postgres, todayilearned
Published: 2019-12-01 23:40:06

I have been working with rails professionally for over a year now, and I want to share the guide I use personally to quickly spin up a new rails app with a postgresql database, and deploy to heroku.

My aim is to make it quick and easy for you to get going, and take the fuzziness out of the setup process.

Find my gist here!
https://gist.github.com/chair28980/acaa7c8f8a71dc663194ce79c44d00b9

I'd love to hear your feedback. Drop a comment here or find me on twitter: @vrycmfy
How To Create Custom State Hook - Custom Hooks ReactJS Mini Course Part 1
Tags: react
Published: 2019-12-02 01:28:06

---
title: How To Create Custom State Hook - Custom Hooks ReactJS Mini Course Part 1
published: true
description: Welcome to ReactJS Custom Hooks Mini Course. In this course we'll learn how to create custom hooks in React, how to test them using React Testing Library and how to publish them as a standalone npm package.
tags: react
series: Custom Hooks ReactJS Mini Course
---

{% youtube hTmWfTniyIk %}

Welcome to ReactJS Custom Hooks Mini Course. In this course we'll learn how to create custom hooks in React, how to test them using React Testing Library and how to publish them as a standalone npm package.

Course playlist: http://bit.ly/35FHALa
Subscribe to the channel: http://bit.ly/2QZ2UY3
Minor Follow-up on Hacktoberfest 2019
Tags: opensource, hacktoberfest
Published: 2019-12-02 08:49:27

---
title: Minor Follow-up on Hacktoberfest 2019
published: true
date: 2019-12-01 00:00:00 UTC
tags: open-source, hacktoberfest
canonical_url: http://hugomartins.io/essays/minor-followup-on-hacktoberfest/
---

In a previous essay I wrote about the process behind my Hacktoberfest 2019 contributions. It is now worthwhile to make a quick follow-up, at this point, at the status of those contributions.

It is relevant to start by mentioning I made a bit of a mess of my contributions, right after I wrote up the article. I tried to correct an issue with the email and user of the contributions and re-wrote the history of my git repositories…bummer! That forced me to close my initial PRs and having to open up new ones - and re-writing all the changes I had made.

I had opened [PR #4476](https://github.com/pyinstaller/pyinstaller/pull/4476), [PR #4499](https://github.com/pyinstaller/pyinstaller/pull/4499) and [PR #4500](https://github.com/pyinstaller/pyinstaller/pull/4500). PR #4499 had to be closed and re-opened as [PR #4516](https://github.com/pyinstaller/pyinstaller/pull/4516). PR #4500 had to be closed and re-opened as [PR #4517](https://github.com/pyinstaller/pyinstaller/pull/4517). That makes a total of 5 PRs, of which only 3 were actually valid for review by PyInstaller’s maintainers.

PR #4476 was accepted, within a two-week period. This seems to be a fairly usual time frame, by looking at previous PR reviews in the project. There was a minor wrapping issues, which the maintainers of PyInstaller promptly resolved and pushed to my branch. PR #4516 was merged within approximately the same two-week period, without any need for further modification. PR #4517 took a bit longer to merge because I had made an error when creating the changelog entry - plus there was a need for a small lint correction.

I was very happy with the end result, getting all 3 PRs approved and merged. I was surprised with how friendly the maintainers of PyInstaller were, even with the small errors. I was also thankful they completely ignored my shenanigans of duplicating the PRs.

They should be an example for the entire community, how they deal with new contributors and their mistakes. That is one of the reasons why they have 280+ contributors on Github.

Now, looking towards the future, I hope I can be of more use to them by adding more hooks. Adding hooks seems to be something that I can do, without creating a lot of work for the maintainers in terms of reviews. But , it will also allow me to start understanding more of the codebase and contribute in different areas.
Created iPadOS/iOS browser to operate without touching   
Tags: reactnative, ios, ipados, javascript
Published: 2019-12-02 03:11:23



I bought iPad Pro and found that I need to touch screen to move pages. I know there is browser extension, like [Vimium](https://github.com/philc/vimium) to operate with only keyboard. To move page, use "hit-a-hint".  I like this idea and wanted to have the app. I looked for App store but I unabled to find it. Ok, it's time to develop it by myself.  I spent 5 months to build this. I used React Native as I had experience on it.

I named this app as Wazari Brower and this can be downloaded from [here](https://www.wazaterm.com/wazaribrowser).  I wrote documentation [here]() 

This is an open source project and able to see the code inside from [the github repository](https://github.com/shohey1226/wazari). I’m sure there are tons of bugs there, so any bug report is welcome (and also PR :) )

I’ve also found that iOS doesn’t support keyboard key configuration. So I added this function to replace capslock and ctrl. The final feature is folloing. I hope you like this. 

## Feature

* Customizable shortcuts to operate browser. e.g. Change tabs without touching screen.
* Panes to split views vertiacally or horizontally.
* Hit-A-Hint - without touching, click links to move pages.
* Customizable modifiers. e.g. swap capslock with ctrl key.
* Customizable default search engine - DuckDuckGo or Google
* Exclude web sites not to use keymapping. Some dynamic web site doesn't use Input type=text or textarea, which Wazari keymapping doesn't work. But you can exclude these website so you can still type on it.
* Histories to go back easily
* Integrated to Wazaterm so you can terminal - I had a separate project for this. I wanted to integrate with it too.
CSS Layout: A collection of popular layouts and patterns made with CSS
Tags: showdev, css, react, typescript
Published: 2019-12-02 15:01:50



Being a front-end engineer, I have to deal with a lot of layouts and components.

There are a lot of CSS frameworks out there that provide popular layouts and components but I usually don't want to include entire framework in my project because

* It's giant and there are a lot of stuffs I don't need
* Each layout or component provides a lot of unnecessary options because it serves many functionalities, for many people

For each project with different requirements, I often google for the most basic part of particular layout or UI pattern and build up from there.

So I collect most popular layouts and components that can be built with pure CSS. They are powered by modern CSS features such as flexbox and grid.

And here it is: https://csslayout.io 🎉🎉🎉

![CSS Layout](https://thepracticaldev.s3.amazonaws.com/i/6y7qtw6e8fvm7o2qilxv.png)


They are great starting points to be picked and customized easily for each specific need. By composing them, you can have any possible layout that exists in the real life.

It helps me a lot and hopefully it will help you!


## Source code

This is fake JavaScript codes but it covers all the tools that I use to build the website:

```
this
    .madeWith([react,typescript])
    .then(r => lint(tslint))
    .then(r => lazyLoad(@loadable/component))
    .then(r => optimizeAndBundle(webpack))
    .then(r => exportHtml(react-snap))
    .then(r => deploy(Netlify))
    .then(r => {
        expect(r).is(scalableCode);
        expect(r).is(superFastWebsite);
        expect(r).is(seoFriendly);
    })
    .finally(() => {/* Give me 1 star */}) 🎉
```

The entire website is open source, so let's explore and give me one Github star :)
QuestDB - fast relational time-series DB, zero GC java
Tags: database, java, opensource, sql
Published: 2019-12-02 17:06:52

Hi all,

We have just released QuestDB open source (apache 2.0), and we would welcome your feedback. 

QuestDB is an open-source NewSQL relational database designed to process time-series data, faster. Our approach comes from low-latency trading; QuestDB’s stack is engineered from scratch, zero-GC Java and dependency-free.

https://www.questdb.io/
https://github.com/questdb/questdb

thanks

Nic
Emoji Island Dispatch: Play on your phone with an Emoji URL 🤯
Tags: showdev, devops, mobile, gamedev
Published: 2019-12-19 09:09:30

---
title: Emoji Island Dispatch: Play on your phone with an Emoji URL 🤯
published: true
description: Updates to emoji island and a warning about emoji urls
tags: showdev, devops, mobile, gamedev
series: Emoji Island
---

Hello all!

Two updates to the emoji island project:

1. I modified the UI so you can play on your phone! I'd welcome any feedback, or even a pull request! There should be a way for you to do it all in CodeSandbox, so let me know if you need help!
2. To make it super mobile friendly, I registered an [emoji domain](https://🏝.fm) — literally `https://🏝.fm` — for emoji island! And through much struggle I managed to get it to work. 


Want to register your own emoji domain? My tips are, if you run into problems with a registrar (which you probably will):

1. Definitely let them know about your issues. Nobody fixes what they don't see or know customers care about.
2. It may be possible (as it was for me) to manually edit some of their API calls to replace the emoji domain with an alternate code (for `🏝.fm` the code is `xn--rm8h.fm`) This is a pain but it may allow you to update dns records you otherwise couldn't
3. Be very careful with transfers! I tried and it failed. I thought I lost it all together, but it stayed at the original registrar. I suspect this is also related to special characters and systems unable to process them.

Anyway, I'm happy this works! If it doesn't, let me know! And thanks!

With ❤️ from Emoji Island:

-- Ryan
Responsive websites that are not so responsive
Tags: discuss, css, responsive, typography
Published: 2019-12-19 09:45:13

I embrace the fluidity of the web. People use all kinds of devices, from smartwatches to TVs. It’s almost impossible to provide the same, exact UX to all of them.

In this regard, I wonder what’s the best way to make a website really responsive. Most of the sites use a fixed-width body after a specific (break)point, with auto margins to center it horizontally. This image is a screenshot of a webpage seen on a 4K TV:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ei3ooy416loa4c0196g4.png)

I find it to be a not so good philosophy when building truly responsive websites: why do I have to see a site in so an uncomfortable way when I see it on a TV, therefore viewing it from afar? Shouldn’t we build websites that scale well, in a way that lets them take advantage of all the screen’s space? Shouldn’t we use truly responsive typography and layouts?  Of course, using fixed-width after a breakpoint we think is appropriate is a good way to give us more control, but again, I think this doesn’t embrace the responsive philosophy completely.