teleren/devto huggingface dataset:
Dev workflow from android
Tags: npm, android, productivity
Published: 2021-01-11 03:24:56

Yes, it's a hack and yes the speed is much worse than using a laptop but for a few weeks now I have decided to sleep 17:00-1:00 and take care of my newborn baby 1:00-9:00, so that my wife can sleep. If I sleep let's say for 1 hour when my baby manages after [Colic](https://en.m.wikipedia.org/wiki/Baby_colic) pain to sleep for a bit, then it would be hard for me to wake up, so here is how I avoid falling asleep.

I wanted something more than vim as the touch keyboard in my mobile phone doesn't really help and something faster than [dcoder](https://dcoder.tech).

## Terminal

Install the open source android app termux.

Open termux, run `mkdir $HOME/projects` to run commands there and run `pkg install git nodejs`

## Code editor

Install the open source android app acode.

Open termux and run `termux-setup-storage`. You will then be prompted to "Allow Termux access photos, media and files on your device". The contents of the created `$HOME/storage` folder are kind of symlinks to different storage folders with the most important here being the root of the shared storage between all apps `~/storage/shared`. In my case I have folder `~/storage/shared/Git` to edit files.

## Edit javascript and run it

As the storage folders emulate fat32 you need to copy your modified files to a folder under `$HOME/projects` that supports symlinks, so create the following `run.sh` and `chmod +x run.sh`

```
#!/bin/bash

# changeme
projectName=reduce

destDirectory=$HOME/projects/
originDirectory=$HOME/storage/shared/Git/$projectName
cp $originDirectory $destDirectory -Ru
cd $destDirectory/$projectName

# changeme
npm install
npm start
```

Adjust the script to your needs and whenever you are ready to test your site, run the script.

## Markdown editor

Install the open source android app markor and note that `/storage/emulated/0` points to `$HOME/storage/shared` of termux and `/Internal storage/` of acode. Its syntax highlighting and preview are amazing.

## What about gitlab?

I love gitlab but don't try firefox from android, cloudflare keeps reloading when loading login page. And in chrome, don't expect copy-paste to work from a mobile phone.

## Enjoy

Have fun!

Tips to parents: [Colic](https://en.m.wikipedia.org/wiki/Baby_colic) is common, just set your mobile phone to flight mode and in a few weeks time it will be gone. Trust me, it's my second one :)
17 - Updating TokenPair Model
Tags: go, gin, authentication, architecture
Published: 2021-01-11 03:23:25

---
title: 17 - Updating TokenPair Model
published: true
description: I previously said we'd working on the refresh token route and logic. However, it will be helpful to add some fields to our TokenPair model first. 
tags: golang, gin, authentication, architecture
image: https://dev-to-uploads.s3.amazonaws.com/i/4gurl97ynjx1u0yt06j8.png
---

## Written Tutorial Ending 😥

Thanks to all of you have been following along with this tutorial series. After much consideration, I have decided to focus on the video series only.

I'm currently increasing my effort to land my first job in software development and have thankfully been getting a few interviews. I need a little more time to review topics and frameworks that I haven't used in some time as I tend to go all in with one tech stack and then forget what I've previously learned. I also should spend some more time on algorithm study as I do not have a CS background. Unfortunately, companies still haven't found a better way to choose candidates.

Furthermore, my YouTube channel has seen slow, but steady growth in minutes watched and subscribers, whereas these articles don't seem to be gaining as much traction. Also, as the app gets more complex, it's really tough to explain the details in writing. 

I know some of you might find it harder to watch a video in your non-native language (and frankly, they're a little long), but I promise I'll try to speak slowly!

Thanks for those of you that have followed along!

*As always, check out the [Github repo](https://github.com/JacobSNGoodwin/memrizr) with all of the code for this tutorial including a branch for each lesson and some unit tests not included in the tutorials!*

Here's the video for today's tutorial where I'll be updating the `TokenPair` model!

{% youtube SeksH9txEZ4 %}

¡Hasta pronto!
Building a Sunday scaries Messaging Service
Tags: dohackathon, aws, node, lol
Published: 2021-01-11 03:10:15

---
title: Building a Sunday scaries Messaging Service
published: true
description: My submission to the DigitalOcean App Platform Hackathon!
tags: dohackathon, aws, nodejs, lol
---

## What I built and why

My friends and I get Sunday scaries, the anxiety that sets in on Sunday nights with the impending end of the weekend and return to our dev jobs on Monday. Lots of memes and sobbing emoji are exchanged on Sunday nights, but there's just no support on Monday mornings. 🥺 So I built SMS HMU. What is SMS HMU you may ask? SMS HMU stands for "Sunday scaries Messaging Service to Hype Mondays Up." This is an automated solution to send my friends and me funny / motivational text messages every Monday morning to make the beginning of the week a little less painful. 

[Sunday Scaries in graph form](https://www.reddit.com/r/funny/comments/6jhuek/the_sunday_scaries_in_graph_form/) by u/ToothMan22
![Alt Text](https://i.redd.it/v987eimxxv5z.jpg)

### Category Submission: Random Roulette 🥳

### App Link
API: https://github.com/stephjs/sms-hype-mondays-up
Cron job to send out SMS HMU every Monday: https://github.com/stephjs/sms-hmu-cron-job


### Screenshots

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pr1bi6kr4oqguu1fpcyk.jpg)

### Description

Here are three messages I sent to my friends with my SMS HMU API. The real fun will start tomorrow (Monday) when the cron job executes the code and starts sending weekly messages to everyone.

### Link to Source Code
API: https://github.com/stephjs/sms-hype-mondays-up
Cron job that sends my friends their SMS HMU every Monday: https://github.com/stephjs/sms-hmu-cron-job

### Permissive License
MIT

## Background
(What made you decide to build this particular app? What inspired you?)

I built this on a Sunday. The scaries are just now setting in. I work as a frontend developer. You may have noticed this has no frontend. I wanted to build something that would be fun for my friends and a bit different than what I work on day to day.

### How I built it 
(How did you utilize DigitalOcean’s App Platform? Did you learn something new along the way? Pick up a new skill?)

I had never used DigitalOcean before! I used DO to deploy my Node.js API and cron job. I was impressed by how helpful the starter docs were, and how intuitive the DigitalOcean UI makes deploying projects from Github. I had also never actually written a cron job! So that was fun to figure out. The [node-cron package](https://www.npmjs.com/package//node-cron) + [crontab guru](https://crontab.guru/#30_7_*_*_1) made it painless.
PG::UndefinedTable: ERROR:  relation "users" does not exist
Published: 2021-01-11 02:03:58

rake db:migrate
== 20190928042042 CreatePosts: migrating ======================================
-- create_table(:posts)
   -> 0.0422s
== 20190928042042 CreatePosts: migrated (0.0426s) =============================

== 20190928042817 CreateVotes: migrating ======================================
-- create_table(:votes)
`rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedTable: ERROR:  relation "users" does not exist`

Solution:

run the single migration first 
`rake db:migrate:up VERSION=20090408054555`
https://riptutorial.com/ruby-on-rails/example/3486/run-specific-migration

then run `rake db:migrate`
Hiding my nodejs application code within a docker container
Tags: docker, node, security, mongodb
Published: 2021-01-11 02:50:39

> Building binaries on compiled languages like Rust and Go as Static or dynamic linking makes a huge step on code security, i mean no one can access your code, reading it !, but in many use cases they can by doing some complicated reverse engineering methods ... actually it's hard ! it become more harder when you built your app as a static linking nd bundle all the shit 💩 together. Nodejs applications can be read it easly ... all your source code is accessible, In this post we will hide our node app and "COMPILE" it ! seems owesome right ! let's go folks 😇 !

Original post : https://hatembentayeb.hashnode.dev/hiding-my-nodejs-application-code-within-a-docker-container
Adding Deploy to DO button (Also found some bug)
Tags: dohackathon, showdev
Published: 2021-01-11 02:14:15


## Add .do/deploy.template.yaml

I copy template from tutorial and add `build_command` and `output_dir` field

```
spec:
  name: chomtana-portfolio
  static_sites:
  - git:
      branch: master
      repo_clone_url: https://github.com/Chomtana/personal-site
    name: chomtana-portfolio
    build_command: yarn export
    output_dir: __sapper__/export
```

## Add Deploy to DigitalOcean button

Add these code to Readme.md

```
[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/Chomtana/personal-site/tree/master)
```

## What is the bug?

The bug is the `output_dir` command is not working as you can see in these screenshot it failed to build because `output_dir` is not set. But I have checked that it has been set.

![Deploy failed](https://dev-to-uploads.s3.amazonaws.com/i/sedw8an7qg94nzie98o0.png)

![No Output dir](https://dev-to-uploads.s3.amazonaws.com/i/3ihkgzwd8t19dybz0rjd.png)

## Hotfix

We temporary fix this by adding `cp -r __sapper__/export public` command to build command in order to copy static site output from `__sapper__/export` to `public` folder

## Then deployment successful!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/evwx6zpgggpw4k714sb5.png)
create pgsql user
Published: 2021-01-11 02:06:09

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/buk60such0epcnfqlmu9.jpg)

For example, to create the PostgreSQL username jdoe the command is:

sudo -u postgres createuser -s jdoe
To set a password for this user, log in to the PostgreSQL command line client:

sudo -u postgres psql
At the PostgreSQL prompt, enter the following command to set the password:

\password [username]
For example, to set the password for jdoe the command is:

\password jdoe
Enter and confirm the password. Then exit the PostgreSQL client:

\q

source https://www.ionos.com/digitalguide/server/know-how/use-postgresql-with-ruby-on-rails-on-ubuntu/
Should i learn PHP or Node.js for server-side
Published: 2021-01-11 02:06:05

Hello Guys, am **Emmanuel** (a.k.a **Emmanrl**)
this is just a short post about 10 - 15sec read

So i need an advice and i don't wanna post it on stackoverflow. I wanna ask if i should learn php for server-side or node.js, because i want to start new this 2021 and i don't want any REGRETS.
Getting Organized
Tags: emacs, orgmode, organization
Published: 2021-01-11 02:03:49

---
title: Getting Organized
published: true
description: The importance of keeping track of projects, notes, and to-do lists
tags: #emacs, #orgmode, #organization
cover_image: https://www.gnu.org/software/emacs/images/teaser.png
---
# The problem
As a developer, I code a lot. I have multiple projects waiting to be completed (is a project ever really complete?), new projects I want to start working on, and of course a bunch of new frameworks and languages I want to dive into. It's hard to keep track of all the features that pop into my head, bugs I find, and new projects I come up with. I'm also currently looking for a job, so I have to make time to network, apply to jobs, and write blogs like this one. So this week I would like to talk about the tool I have started to use to get organized.
# [Emacs](https://www.gnu.org/software/emacs/)
Programming courses at my university required students to SSH into "The Linux Lab" which meant no GUI. I had never worked with Linux or the command line, so it took me a while to get comfortable working on assignments and projects. The default editor was Emacs. I had never heard of it, but the cryptic short cuts (aka key bindings) really intrigued me. Moving around in text files using C-n, C-p, M-b, and M-f took a few days to get used to, but now I get so annoyed when I can't use these bindings (I've recently been trying out VIM for Vimium on Firefox/the i3 window manager, and I like it so far). Needless to say it has been a few years since college and I'm still using Emacs. I am far from being a pro, but my work-flow revolves around Emacs. 
# [Org Mode](https://orgmode.org/)
Org Mode is short for, I'm sure you guessed it, organizational mode. Simply put, Org Mode is just a markup language, but what makes it cool is how Emacs can turn an org file into an interactive, customizable document. While I don't utilize all Org Mode has to offer, I can easily keep track of my projects, take notes, and create to-do lists. Here's a quick screenshot of my projects file. ![My projects](https://dev-to-uploads.s3.amazonaws.com/i/2gmhnypl91c5lu5qhg12.png)
# Documents
Thanks to Emacs/the command line, I really enjoy keeping my hands on my keyboard. My to-do lists, project plans, and notes are all easy-to-edit documents saved on my local machine. I really enjoy having the freedom to make these lists look any way I want. I am also really happy that I don't need to open a browser or download an app to check something off my list. I just switch to another buffer and check off that feature. 
# Productivity
Unfortunately I have not tried very hard to keep track of my productivity, so I feel like that is the next natural step in getting a more organized workflow. I would like to avoid having another tab open in my browser, so maybe a command line app is the solution. Honestly, I'm sure there is some way I could use Org Mode or another Emacs package to keep track of how I spend my day. I'll look into it and let you know. ![Relevant Emacs xkcd comic](https://imgs.xkcd.com/comics/real_programmers.png)
Would you use target="_blank"? And how many rels?
Tags: discuss, webdev, security
Published: 2021-01-11 02:01:16

If you don't know already, `<a href target="_blank">` can be a security risk. But, the question I have in mind is, did I overprotect myself?

To get started, see these two links,

- [When to use target=”_blank”](https://css-tricks.com/use-target_blank/)
- [Explained: noopener, noreferrer, and nofollow Values](https://pointjupiter.com/what-noopener-noreferrer-nofollow-explained/)

My understanding is,

- Without `target="_blank"`, navigating out will break SPA's (single page apps)
- `rel="noopener noreferrer"` is enough for blogging sites, but `noopener` is only there for backward compat security risk.
- I don't know enough about `nofollow`, or please follow...
Personal Site - DO Hackaton Submission
Tags: dohackathon, react, nextjs
Published: 2021-01-11 00:42:18

## What I built

I built a personal site for myself containing my bio, funny animation and simple voice control.

### Category Submission:

Personal Site/Portfolio

### App Link

[https://michal.mmlab.cz](https://michal.mmlab.cz/)

### Screenshots
![Screenshot of my site](https://dev-to-uploads.s3.amazonaws.com/i/cvy7calzcknuyrgk5flo.png)
![Screenshot of my site](https://dev-to-uploads.s3.amazonaws.com/i/u0anznmgg3mzw3z82vyu.png)

### Description

The personal site is one simple page containing all information about me, my works and my skills. The page has two language mutations - English and Czech and two color schemes. Besides that, I built a simple Voice Control for this page, because I developed RSI in both my wrists and elbows recently and I wanted to show others how it feels to control a computer using your voice. Also, a simple voice-controlled game is included.
Btw something is hidden in the console.

### Link to Source Code

{% github MichalMartinek/personal-site no-readme %}

### Permissive License

[MIT License](https://github.com/MichalMartinek/personal-site/blob/main/LICENSE.txt)

## Background

Not long ago, I developed Carpal and Cubital Tunnel Syndrome in both of my elbows and wrists. As a consequence, I can't use a keyboard or mouse for more than 30 minutes without a long break. Fortunately, there are other ways to control computers e.g. voice control. I've started learning to program again, but with a microphone instead of a mouse and keyboard.

For a start, I picked a completely new simple project, this personal site, to gain confidence in programming using the voice control tool called [Talon voice](https://talonvoice.com/).

### How I built it

I used for this project these technologies:

-   [Sass](https://sass-lang.com/) - CSS preprocessor
-   [React](https://reactjs.org/) - UI library
-   [Next.js](https://nextjs.org/) - React framework
-   [Framer Motion](https://www.framer.com/motion/) - animation library
-   [i18next](https://www.i18next.com/) - internationalization-framework

I learned a lot about [Talon voice](https://talonvoice.com/), the voice control tool specialized in programming. Also, I used an animation library [Framer Motion](https://www.framer.com/motion/) for the first time.

I was quite surprised how easy was deploying to DigitalOcean’s App Platform.

### Additional Resources/Info
Creating A JavaScript Framework (1)
Tags: javascript, webdev, showdev
Published: 2021-01-11 01:39:30

I have been working on a JavaScript templating framework for my projects. The purpose of it is to make it easier (much easier) to work with the DOM and generating HTML, and to make it easier to make and read forms elements. Here is a demo of code:
~~~html
<aside>
  <template>
    {each items}
      <section>{item}</section>
    {/each}
  </template>
</aside>
~~~
~~~js
var items = ['home', 'dashboard', 'addons'];
let sidebar = new Template('aside');
~~~
result:
~~~html
<aside>
  <section>home</section>
  <section>dashboard</section>
  <section>addons</section>
</aside>
~~~
Here is the current architecture of the project (bottom to top):
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7i3f5us0xe3prkpyaup3.png)

Here is another code example:

~~~html
<main><template>
  <h1>Hello {name || 'unknown'}</h1>
  {inputText name="fullname" placeholder="John Doe" label="Full Name"/}
  {inputColor name="color" label="Favorate Color" value="#ffffff"/}
  {inputSelect name="option" label="Pick one" options="!disabled:Pick an option,a:Pick A,b: Pick letter B"/}
  <button onclick="submit()">Submit</button>
</template></main>
~~~
~~~js
let form = new Template('main');

function submit() {
  console.log(form.getData());
}
~~~
output:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ukjy9ldi3zjwvj68qwlf.png)

~~~js
{ 
  fullname: "John Smith",
  Joe: "#cb6d5c",
  option: "b" 
}
~~~
There are also if, repeat and debug blocks included, as well as 8 other form blocks. There is also a link function on the Template class that updates the template when changing a value, for example,
~~~js
let updateForm = form.link('name', 'color', 'options');
updateForm('Joe', '#3F32AB', '1:one,2:two,!3:three')
~~~
Here are the next features I am going to add:
- Automatic ending of blocks without a slash at the end
- More logical blocks
- Popups
- Form validation
How to open keybindings.json in VSCode
Published: 2021-01-11 01:36:38

You can also open the keybindings.json file from the Command Palette (Ctrl+Shift+P) with the Preferences: Open Keyboard Shortcuts (JSON) command.

Here's my file for toggling the console:

`// Place your key bindings in this file to override the defaults
[
    {
    "key": "shift+space",
    "command": "workbench.action.toggleMaximizedPanel",
    // "command": "workbench.action.toggleEditorVisibility"  either one
    "when": "!terminalFocus"
},
]`

Source: https://stackoverflow.com/questions/48511956/toggle-between-fullscreen-editor-and-terminal-in-vs-code#:~:text=There%20are%20two%20commands%20that,action.
Bitcherry Developer Hangout
Published: 2021-01-11 01:11:58

#BitCherry #Developers Hangout  


 Fill the form and join https://docs.google.com/forms/d/e/1FAIpQLSfgPQ95nwfcwqKQPyXUo8_u1-EK1MEEbaNpnIlRQbWHPTT4tA/viewform… 


Date: 11/1/2021 (Today)


 Time: 5 PM (UTC 8)


 It's for everyone here.


 Do well to join our Telegram group.


 Telegram Group: https://t.me/BitCherryDevelopersGroupEN…
EatBeep - Simple drag-and-drop menu creator for restaurants
Tags: dohackathon, elixir, liveview
Published: 2021-01-11 00:35:31

## What I built
A drag-and-drop web app to let restaurants easily publish their menu online. Complete with QR Code!

### Category Submission: 
It's a SAAS, intended for the **built for business** category.

### App Link
[www.eatbeep.com](www.eatbeep.com) / [demo.eatbeep.com](https://demo.eatbeep.com)

### Screenshots
![Screenshot of Signup screen](https://dev-to-uploads.s3.amazonaws.com/i/w4hh9dohg4tqx5n6yssu.png)

![Screenshot of editor](https://dev-to-uploads.s3.amazonaws.com/i/u9k608n7txlpih2fh6ms.png)

![Screenshot of editing a block](https://dev-to-uploads.s3.amazonaws.com/i/x2nlvhzfv1nzqkdw27sz.png)

![Screenshot of QR code](https://dev-to-uploads.s3.amazonaws.com/i/w6nfem2hovwkcm7aqvk8.png)



### Description
Once signed up, the user can easily add blocks to the page and re-arrange them, quickly building a good looking menu. With just one click it's published online at a customisable subdomain.

### Link to Source Code
https://github.com/eatbeep/eatbeep

### Permissive License
MIT

## Background
Sadly I've seen several of my favourite restaurants go out of business over the last year due to the pandemic, and I've been keen to find a way to help. I noticed there has been a steady growth in publishing menus online rather than printing them, which is both more hygienic and easier to update - and so this tool enables the transition.

### How I built it 
This is my first time building something with Elixir, with LiveView powering the UI. It's quite different from my usual stack (React, with Node API), but the end result is quite slick.
It's hosted on DO App Platform, which I was pleased with - once the Dockerfile was working, it was plain sailing.

### Additional Resources/Info
Photo by  [Asnim Ansari](https://unsplash.com/@asnimansari?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)  on  [Unsplash](https://unsplash.com/s/photos/food?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
Image overflowing grid item
Tags: help, css, html
Published: 2021-01-11 00:29:40

Hey everyone! I’ve tried everything with this for about 3 hours now and I can’t seem to figure out a solution. For some reason, my image keeps overflowing the grid item! Any help you could offer would be so so appreciated.

I’ve tried declaring a 100% width in the HTML for the image, which does scale it down to fit within the box, but it doesn’t reach the bottom and also doesn’t respond well to rescaling. So now I’m trying that along with applying object-fit: cover, but now it’s just a massive image again. I tried doing a background-size: cover, but that didn’t seem to do anything at all, so maybe I just did it wrong. Does anyone have any ideas? I’m pretty new to the grid.

HTML

    <section id="grid">
        <div class="box">
            <div class="img-content"><img src="./images/hp-img1.png" width:100%></div>
        </div>

        <div class="box">
            <div class="box-content">Box 2</div>
        </div>

        <div class="box">
            <div class="box-content">Box 3</div>
        </div>

        <div class="box">
            <div class="box-content">Box 4</div>
        </div>
    </section>


SCSS

#grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    background-size: cover;

    .box {
        display: flex;
        justify-content: center;
        align-items: center;
        color: $white;
        overflow: hidden;
        object-fit: cover;

        .box-content {
            padding: 3rem 4rem;
        }

        &:nth-child(1) {
            background: $blue;
        }

        &:nth-child(2) {
            background: $black;
            color: $blue;
        }

        &:nth-child(3) {
            background: $white;
            color: $blue;
        }

        &:nth-child(4) {
            background: $red;
        }
    }
}