teleren/devto huggingface dataset:
Using raspberry as gitlab runner(with docker)
Tags: gitlab, raspberrypi, docker, node
Published: 2019-01-30 17:47:36

---
title: Using raspberry as gitlab runner(with docker)
tags: ["gitlab", "raspberry", "docker", "node"]
published: true
---
With an introduction of [USB boot](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md) option to Raspberry you can use it with an external SSD drive, so you don't need to switch broken SD cards from time to time and reconfigure the whole system.

And with SSD installed raspberry becomes an interesting option to use as an external [`gitlab runner`](https://docs.gitlab.com/runner/#install-gitlab-runner).

Now, as an executor you will probably choose `docker` since it allows you to run any software that you want in without having to install it on your Raspberry.

## But there is a catch

Since Raspberry doesn't have x64 CPU but rather ARMvX you will find that some of your gitlab jobs will fail with a following log:
```
standard_init_linux.go:190: exec user process caused "exec format error"
standard_init_linux.go:190: exec user process caused "exec format error"
ERROR: Job failed: exit code 1
```

That means that you have to go onto your raspberry and build your image locally like so:
```bash
docker build -t node .
```

provided that you have a `Dockerfile` prepared:
```
FROM node:8
```

And then you need to tell your docker executor to use local image instead of one from Dockerhub:
```yaml
[[runners]]
  name = "raspberrypi"
  ...
  executor = "docker"
  [runners.docker]
    ...
    pull_policy = "if-not-present"
```
Day 30: Swift macOS password manager for people who hate the cloud
Tags: macos, swift, passwordmanager, cloud
Published: 2019-01-30 18:57:23

---
title: Day 30: Swift macOS password manager for people who hate the cloud
published: true
description: Follow along as I make a 100% cloudless and 100% swift password manager for macOS. That's 200% raw password managing power.
tags: macos, swift, password manager, cloud
series: Making a swift MacOS password manager for people who hate the cloud
cover_image: https://thepracticaldev.s3.amazonaws.com/i/q6r73zbfbm3mpfs98bu5.jpg
---

[<- For Day 29 go here](https://dev.to/swlkr/day-29-swift-macos-password-manager-for-people-who-hate-the-cloud-4ph4)

📅 01/29/2019
🚀 [13 hours until launch 🤞](https://www.producthunt.com/upcoming/all-your-passwords)
🔥 29 day streak
💰 $5.00 price
🤑 $0 revenue
📈 0 customers
⌚️ 52 hours spent
😭 1 Rewrite
🛬 [1 Lander](https://allyourpasswords.com) with [Source](https://github.com/swlkr/allyourpasswords-lander)
💻 114 files changed, 250127 insertions(+), 559 deletions(-)
🏁 Today's goal: **Submit to app store for the third time. Finish lander. Submit to product hunt**

**11:52 AM**
Got rejected from the app store again, here's the reason

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

No surprise there, this is my first mac app. There were a few other things like not being able to tab through the text fields, which I thought was interesting. 

Submitting to the app store probably isn't going to happen by tomorrow. So I signed up for [devmate](https://devmate.com) something I didn't really want to do, but if I want to even have a chance at launching tomorrow morning at 12 AM PST, I'm going to have take some drastic measures. Let's see how fast I can integrate their SDK in and set up payments 😬 after work.

**5:55 PM**
I got paddle working on a notarized version of the binary. It actually worked when Alisha downloaded it and installed it. I CANT BELIEVE IT. A week's worth of work over the span of a month and I actually have a decent password manager that I wrote from Xcode > New Project.

The feeling is incredible. I honestly could care less about the launch. It's just great to finally complete a very tiny version of something in the timeframe I set and have it work. 💪

I can probably make any piece of software given enough days… I could probably do ANYTHING given enough days. Wait.

I don't want to get ahead of myself.

I still need to create a bunch of promo stuff for product hunt before 1 AM and I still need to get the lander in order, but other than that, the very first version of allyourpasswords is done. So many features I want to add, not to mention an iOS companion app so I can truly be free of my current password manager.

Turns out I didn't finish the lander, but it's good enough to launch!
How to convince junior developers to learn basics first?
Tags: discuss, advice
Published: 2019-01-30 18:49:31

---
title: How to convince junior developers to learn basics first?
published: true
description: Most developers I help learn at work tend to go for bigger things right away and forget about the basics. How should I convince them to learn the basics?
tags: discuss,advice
---

I myself am I junior developer but throughout my 3 years journey so far, I've had the opportunity to work with some of the greatest minds. They helped me learn programming, work etiquettes and a lot of other stuff and for that, I am really thankful to them. At work, I help junior developers/internees learn basic front-end stuff. 

When I started learning, I had the best teachers. I was instructed to learn the basics first and then go on to learn frameworks. I started with basic HTML & CSS, learned a bit of JavaScript and then moved to learn Bootstrap. After that, I moved onto Foundation and then material design. Right now, I don't do much of UI work but I know a good amount of best UI frameworks available. But I didn't do it in one night (obviously).

It took me time. Nights and days and weekends. A lot of them. Just like most beginners, I was eager to learn all at once. But soon realized that this is not how it works (thanks to wonderful mentors and clients). 

This is the same thing I want to teach the guys who chose me as a mentor. I try my best to explain everything with a proper and valid reference. I have told every guy I taught that learning something is not the same for everyone. Someone might learn a whole new framework over a weekend but others might take a month or even two. But most of the beginners don't seem to take my advice seriously. 

Recently, I told a guy not to use Bootstrap, in the very first assignment I gave him. And he replied:

> I saw you using Bootstrap. Why shouldn't I use Bootstrap too? 

I told him to learn CSS first but he insisted on using Bootstrap and eventually ran off 🙁. And the same thing happened to another colleague who was helping another internee.

What I want to ask is:

## How do I convince a beginner to learn basic stuff first?

...without having them think that I am being an obstacle in their path?
Swiss Army knife for Unix permissions
Tags: unix, security, node, javascript
Published: 2019-01-30 18:10:06

---
title: Swiss Army knife for Unix permissions
published: true
description: Swiss Army knife for Unix permissions
tags: [unix, security, nodejs, javascript]
---

[Unix file permissions](https://en.wikipedia.org/wiki/File_system_permissions) can take many shapes: symbolic (`ug+rw`), octal (`660`) or a list of characters (`drw-rw----`).

`unix-permissions` (https://github.com/ehmicky/unix-permissions) enables using any of these (instead of being limited to a single one) with any Node.js or CLI command.

This library can also perform operations on Unix permissions such as:

- testing, setting and unsetting. Using bitwise operations (`|`, `&`, `^`, `~`) can be tedious and error-prone otherwise.
- validating syntax.
- normalizing. For example `u+r,u+w` can be shortened to `u+rw`.
- inverting. For example a [`umask`](https://linux.die.net/man/2/umask) of `117` means new files will be created with `661` permissions.
- checking the minimal or maximal permissions among a list of them. This can be useful to aggregate all the permissions of several files, e.g. during a directory recursion.

Feel free to provide me with feedback on dev.to or on GitHub!
react-native-localize and i18n-js
Tags: reactnative, javascript, i18n
Published: 2020-01-07 08:52:06

---
title: react-native-localize and i18n-js
published: true
date: 2019-01-30 17:50:59 UTC
tags: react-native,javascript,I18n
canonical_url: https://medium.com/@nicolas.kovacs/react-native-localize-and-i18n-js-117f09428017
---

![](https://cdn-images-1.medium.com/max/1024/0*J_HDdN0RoaW7cNg8)<figcaption>Photo by <a href="https://unsplash.com/@kylejglenn?utm_source=medium&amp;utm_medium=referral">Kyle Glenn</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

*Initially posted on Medium*

Recently **react-native-i18n** has been deprecated in favor of **react-native-localize** , here is how you can keep the same logic as before without recode It all over again. It’s the simplest way I could found.

- [react-native-community/react-native-localize](https://github.com/react-native-community/react-native-localize)
- [fnando/i18n-js](https://github.com/fnando/i18n-js)

First, install the new dependencies. You should unlink **react-native-i18n** if you had It and link the new ones.

yarn add react-native-localize

yarn add i18n-js

You should have in your **package.json** something like this :

{% gist https://gist.github.com/nicovak/96e890b26591f03b26ff4b164724fda7 %}

If you are using react-native ≥ **0.60** you don’t need linking anymore and you can pass the next quoted step.

> Don’t forget to link new dependencies, for more informations go to github pages linked above.

> react-native link

Now create a file where you will initialize **i18n-js** , let’s call It **i18n.js** for example in a **src/utils** folder

{% gist https://gist.github.com/nicovak/cb651918b050c31af2130b3dd0e8f0cb %}

Now in the same folder create a new one named **locales** for example and create a new file for each locale you want.

Example of  **en.js**

{% gist https://gist.github.com/nicovak/7eb987baefa378663e0d78449f18ec91 %}

Example of  **fr.js**

{% gist https://gist.github.com/nicovak/ea6f911ec8c43029696aed84e568cacc %}

Don’t forget If you add more locales to import them in  **i18n.js**

Now in any component of your app, import the file created in the first step and initiate **I18n** as before

{% gist https://gist.github.com/nicovak/19114f323d3cd6b7f3e557dc17d4a616 %}

If you want to get current locale you can use

{% gist https://gist.github.com/nicovak/08bebd338729c160eb671fa51a14396f %}

That’s all, I hope It will help you to understand how to achieve It. Any comments or recommandations are welcome

Happy coding ;)
Running «Gatsby.js» blog with github pages
Tags: gatsby, github, blog, javascript
Published: 2019-01-30 17:43:32

---
title: Running «Gatsby.js» blog with github pages
tags: ["gatsbyjs", "github", "blog", "javascript"]
published: true
---

There are many tutorials on how to run a gatsby website with github pages, but most if not all of them are focused on how to generate a website for your repository.

Github has a feature where it provides you with ability to host your static website, i.e. «username.github.io» and link a domain name to it.

To do that you can create a repository `username.github.io`. You can find more info on that [here](https://pages.github.com)

Now the problem with gatsby and github pages is that the generated resources are not in the root folder of your repository and if you use `gh-pages` package it will rewrite all your source files when you publish.

To fix that, you need to create a `dev` branch which will contain all your sources and add `deploy` script to your `package.json` that will contain following:
```json
{
  "scripts": {
    "deploy": "gatsby build && gh-pages -d public -b master"
  }
}
```

So when we run `npm run deploy` on dev branch gatsby builds sources from `dev` branch and gh-pages publishes the result to the root folder on `master` branch.

## Custom domain name

If you have already setup a custom domain for github pages, you would notice that there has to be a `CNAME` file in the root folder of your repository that contains custom domain name.

If we run `npm run deploy` this file would be deleted by generated website.
Refresh commit date
Tags: git, commit, date, history
Published: 2019-01-30 17:41:42

---
title: Refresh commit date
tags: ["git", "commit", "date", "history"]
published: true
---

Imagine that you made some commits for which you would like to update the time or a date.(so that you would keep only the chronological order)

Now if you were to do it on the latest commit, you can just run:
```bash
GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"
```

and that would update the date of the last commit, so you can then `push` or `push force` it.

## Multiple commits

To perform this action in bulk mode you can just run:

```bash
git rebase HEAD~{number of commits} --ignore-date
```

You can also create a shortcut in your `~/.gitconfig` like so:
```bash
[alias]
  refresh = "!f() { git rebase HEAD~$1 --ignore-date; }; f"
```

where the parameter would be number of commits starting from `HEAD` to update, i.e.:
```bash
git refresh 6
```
Dev.to Review #13: Top 7 Of The Week, Discussed
Tags: bestofdev, career, discuss, webdev
Published: 2019-01-30 17:33:32

---
title: Dev.to Review #13: Top 7 Of The Week, Discussed
published: true
description: Two devs get together to discuss the week's Top 7 posts on dev.to
tags: bestofdev, career, discuss, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vb0u8y37l01es1y2ln9d.jpg
canonical_url: https://soundcloud.com/malikanddan/devto-review-episode-13
series: DEV.TO Review
---

> If you'd like to follow us on iTunes instead of waiting for these posts, check that out [over here!](https://itunes.apple.com/us/podcast/dev-to-review/id1444162833?mt=2) If you'd like to see a full archive without clicking around the series, check out this [nifty thing](https://overcast.fm/itunes1444162833/dev-to-review) that Overcast automatically created. If you want the direct RSS link, you can grab it [here](https://pcr.apple.com/id1444162833).

Did you miss us? After a month long hiatus, Malik and I are back again to discuss this week's Top 7 Articles on dev.to!

{% soundcloud https://soundcloud.com/malikanddan/devto-review-episode-13-1282019 %}

This week's discussed posts are:

{% link https://dev.to/alex_barashkov/20-docker-commands-use-cases-for-developers-2d9g %}
{% link https://dev.to/nzonnenberg/basic-color-theory-for-web-developers-15a0 %}
{% link https://dev.to/andygeorge/i-am-not-a-real-programmer-1ogo %}
{% link https://dev.to/emmawedekind/css-specificity-1kca %}
{% link https://dev.to/kmaschta/https-in-development-a-practical-guide-175m %}
{% link https://dev.to/teamxenox/do-we-really-need-a-css-framework-4ma6 %}
{% link https://dev.to/darraghor/be-careful-of-the-jwt-hype-train-3e81 %}

Do you struggle with CSS specificity? Do you think that the use of JSON web tokens why over-hyped? What tools do you think people reach for too quickly, and which do you think should be brought in as early as possible?

Let us know in the comments!

> We're still experimenting with post formats, audio, etc., so if you have any thoughts, feel free to let us know on here, or on Twitter at [@dangolant](https://twitter.com/dangolant) and [@milkstarz](https://twitter.com/milkstarz).
Nested Conditional Operators
Tags: discuss, javascript
Published: 2019-01-30 16:44:47

---
title: Nested Conditional Operators
published: true
description: 
tags: discuss, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9hcmpo98sbmq88jrhhiz.jpg
---

_Cover image by [Talles Alves](https://unsplash.com/photos/HNiOq7eg8ck?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash_

Internet wisdom says that nested conditional operators are evil. And I firmly believed internet wisdom until today.

Today I found myself refactoring some old Javascript code and it had one of those functions that validate that a heckload of properties exist and have the right format in an object. Then I went crazy and wrote something similar to this.

```javascript
const validateInput = ({ field1, field2, field3 }) =>
    (!field1
        ? Promise.reject('Missing field1')
        : !Array.isArray(field2)
        ? Promise.reject('field2 is not an array')
        : !isValidType(field3)
        ? Promise.reject('field3 is invalid')
        : Promise.resolve()
    )
```

Don't mind the thing with promises, this function is used inside a promise chain.

The thing is, it makes me cringe a bit because, you know, _nested conditional operators are evil_, but I actually find it readable, and I'd say it might even flow better than the chain of ifs.

I would like to read your thoughts and opinions in the topic. Are nested conditional operators inherently evil and unreadable or are they alright, they have just been used in a messy manner for too long?
Top 5 African Tech Podcasts
Tags: africa, developer, podcast
Published: 2019-01-30 15:28:39

---
title: Top 5 African Tech Podcasts
published: true
description: As podcasts are making a buzz on the continent and Africa tech scene is growing faster. Here are some tech podcasts you should listen to keep you updated with what’s going on the continent.
tags: Africa, Developer, Podcasts, 
---

As podcasts are making a buzz on the continent and Africa tech scene is growing faster. Here are some tech podcasts you should listen to keep you updated with what’s going on the continent.

**[Forloop Podcast](https://podcast.forloop.africa/)**

Hosted by [Ada Nduka Oyom](https://twitter.com/Kolokodess), the podcast covers a range of topics including dev, UX, ML/AI and tech ecosystem in Africa. It was created for Forloop Africa the larger African developer community and tech enthusiasts.

**[African Tech Round-Up](https://soundcloud.com/african-tech-round-up)**

If you want to know what is happening in Africa tech ecosystem this is your go-to podcast. Produced in Johannesburg, South Africa, ATRU podcasts are hosted by [Andile Masuku](https://twitter.com/MasukuAndile) where he covers the different innovations on the continent and invites some experts to share insights on the Africa tech scene.

**[24Bit Podcast](https://24bit.tech/)**

Kenyan based, 24Bit podcast is an ongoing conversation on happenings in the technology world from new Smart-phone on the market to Fin-tech solutions and discussions on the e-commerce states in Africa. The podcast runs bi-monthly brought to you by several Kenyan tech bloggers. The host of the podcasts are [Techish Kenya](https://tech-ish.com/), [TechTrends](http://techtrendske.co.ke/), [Android Kenya](https://androidkenya.com/), [TechArena](https://www.techarena.co.ke/), [E-labz](http://e-labz.info/).

**[TechCentral Podcast](http://techcentral.co.za/category/podcasts/)**

Duncan McLeod is the podcaster of TechCentral the leading news and information resource for people involved in South Africa’s fast-growing information and communications technology industry. Duncan is one of the best tech journalists in Africa while sharing the insights on the new technology, he also invites well-known players in tech eco-system in Africa to share with the audience what’s happening in the tech world.

**[CodeCast Zambia](https://anchor.fm/code-cast-zm)**

Zambia based podcasts, CodeCast is one of the leading biweekly podcast that focuses on everything tech (from innovations in AI and machine learning to the latest in data science, from the WWDC to Google IO), and the role developers play in shaping the future of technology, both from a uniquely Zambian perspective to the repercussions on a global scale.
Explain package-lock.json like I am five
Tags: discuss, help, javascript, explainlikeimfive
Published: 2019-01-30 14:52:13

---
title: Explain package-lock.json like I am five
published: true
description: 
tags: #discuss, #help, #javascript #explainlikeiamfive
---

What is the point of having same dependency tree ? And how does dependency tree actually work ? Should I commit package-lock.json every time I add new package ? How is it related to symbols (e.g. ^ ) that are put before package versions in package.json ?
Create Nuxt.js Universal Apps using GraphQL and Postgres
Tags: graphql, vue, nuxt, javascript
Published: 2019-01-30 14:43:45

---
title: Create Nuxt.js Universal Apps using GraphQL and Postgres
published: true
description: Server side render websites using Nuxt.js and GraphQL APIs over postgres using Hasura GraphQL Engine. Instant setup. Tutorial/boilerplate 👉 nuxtjs-postgres-graphql
canonical_url: https://blog.hasura.io/create-nuxt-js-universal-apps-using-graphql-on-postgres/
tags: graphql, vue, nuxtjs, javascript
---

#TL;DR: 

Server side render websites using [Nuxt.js](https://nuxtjs.org/) and [GraphQL](https://graphql.org/) APIs over postgres using Hasura GraphQL Engine. Instant setup. Tutorial/boilerplate 👉 [nuxtjs-postgres-graphql](https://github.com/hasura/graphql-engine/tree/master/community/sample-apps/nuxtjs-postgres-graphql)

![Nuxt.js Hasura GraphQL Postgres](https://thepracticaldev.s3.amazonaws.com/i/b9kdnvl00v541vm2oolh.png)

Building universal apps is generally touted to be hard and Nuxt.js is here to solve this for Vue.js apps by being performant and modular. Hasura GraphQL Engine makes it easy to get GraphQL APIs on top of Postgres database. In this post, we will look at how these two can be integrated.

#Nuxt.js

Nuxt.js gives full support for SSR apps and takes care of the common pitfalls. Being a universal app makes it more exciting; the page is server rendered and then SPA takes over. This is how it works:

####Pages:

Nuxt is opinionated on the project directory structure. It will transform every .vue file inside the pages directory as a route for the application. The community has embraced the opinionated directory structure with different projects (looking at you Gatsby, Next.js) and its quite easy to get familiar with. In the boilerplate example, you can see how the [pages](https://github.com/hasura/graphql-engine/tree/master/community/sample-apps/nuxtjs-postgres-graphql/pages) are structured. For more information on the directory structure that Nuxt enforces, read more [here](https://nuxtjs.org/guide/directory-structure).

####Server side data fetching:
 
Nuxt community has built this [apollo-module](https://github.com/nuxt-community/apollo-module) that sets up apollo client for a GraphQL endpoint. So in the index.vue page, we add the apollo snippet inside script as follows:

{% gist https://gist.github.com/praveenweb/7a19a94cc1ce0235650abf20032b4e26 %}

Here, author is a graphql query which fetches the list of authors from the database and updates the author property in vue. This GraphQL query is executed on the server and the data is available in template which allows the page to be rendered server side. The same query is then executed on the client side as well, making it universal/isomorphic. apollo-module in Nuxt accepts a clientConfig which can be used to configure endpoint, authentication and other parameters as well.

####Nuxt.js + Hasura + apollo-module = Universal apps with GraphQL!

I have put together a boilerplate and tutorial so that you can get started quickly!

Check it out on [github](https://github.com/hasura/graphql-engine/tree/master/community/sample-apps/nuxtjs-postgres-graphql).