teleren/devto huggingface dataset:
Recent Favorite Rails Tip!
Tags: rails, ruby, productivity
Published: 2020-09-18 04:09:34

Rails is a powerful framework known for boosting productivity and being developer-friendly. There are many traits that help you in being productive. Let's talk about the one that I found very recently and how difficult was it to get the job done without it.

*Rails migrations*. If you haven't heard this term, in short, migrations help in changing the schema of your database. Read more [here](https://edgeguides.rubyonrails.org/active_record_migrations.html) in case you're not familiar with it.

Rails provides scaffolding to create migration files. You need not create a migration file from scratch nor copy from the existing files. This is pretty standard.
 
```
rails generate migration add_email_to_users email:string
```

generates the following file

```
class AddEmailToUsers < ActiveRecord::Migration[5.0]
 def change
   add_column :users, :email, :string
 end
end
```

After that, you just run 

``` 
rake db:migrate
```

Making a change to the database hardly takes a minute!

But consider this scenario where you created a table and started working on it.


![source code 2](https://github.com/rahulramfort/blog/blob/master/ruby/1_migrate_redo/redo/reference_type.png?raw=true)

Now for some reasons, you want to rename the column names and also add another column to it. 

![source code](https://github.com/rahulramfort/blog/blob/master/ruby/1_migrate_redo/redo/logger_type.png?raw=true)


Since the migration already ran, these are the steps you're required to do to run the migration again.

* Get the migration version from the file name `20200827072540`
* Remove the entry from the `schema_migrations` table
* Drop the table `transaction_dumps`
* Run the migration `rake db:migrate` again

This set of things gets really frustrating if you want to play around in your development or you're not really sure of the final schema.

A better way to do this is,

```
rake db:rollback #rolls back the latest migration change
rake db:migrate #runs all the pending migrations again
```

Neat right.

Hang on. This post ain't about this.

If you want to rollback multiple migration files and run them again, the headache is back. You have to get the migration versions and do,

```
rake db:migrate:down VERSION=20200827072540
rake db:migrate:down VERSION=20200825121103
rake db:migrate
```

There is a *Rails* way to do this and this is my recent favourite go-to option when I am playing with the migrations. 

```
rake db:migrate:redo
```

This rolls back the latest migration and runs the migration again. Here's the elegant part, if you want to redo the last `n`  migration files, you could just feed that as a variable `STEP`.

```
rake db:migrate:redo STEP=2
```

![output](https://github.com/rahulramfort/blog/blob/master/ruby/1_migrate_redo/redo/output.png?raw=true)

Easy and painless! 

Always remember this, if you're doing something that takes too much time and makes you feel that Rails isn't fun to work with, you might be doing it the wrong way 😉

Thanks [@Prathamesh](https://dev.to/prathamesh) for this tip.
Chaucha Wallet Generator Github Action
Tags: actionshackathon, github, blockchain, chile
Published: 2020-09-18 03:55:23

---
title: Chaucha Wallet Generator Github Action
published: true
description: My submission to the GitHub Actions x DEV Hackathon!
tags: actionshackathon, github, blockchain,chile
---

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)

This is a simple Github Action to generate Chaucha cryptocurrency wallets. This serves as an example for other cryptocurrencies similar to bitcoin. 

### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)

Wacky Wildcards

### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)

{% github proyecto-chaucha/chaucha-gha-wallet-generator %}

### Additional Resources / Info

www.chaucha.cl
Create, Build, Share
Tags: create
Published: 2020-09-18 03:50:09



One of the things I love most about development is sharing ideas. Taking an idea from just a thought to a functioning usable project is so rewarding. Take the time this week to create something fun. Share your ideas with the world.

Don't be afraid to use your voice!

<img class="wp-image-152 size-full" src="http://christopherleejarvis.com/JarvisScript/wp-content/uploads/2018/04/canaryinconcert.jpg" alt="" width="590" height="787" /> 

Still learning how to use the DEV editor. Is there a list of existing tags? 

<div class="wp-menu-arrow">-$JarvisScript git push</div>
Data Science & Machine Learning. Do they focus on by “library”? like Numpy, Pandas, Scipy, ect? or is it wider then that?
Tags: numpy, scipy, pandas, python
Published: 2020-09-18 03:43:00

When you get into Data Science and Machine Learning.... do you focus on a few libraries? Or is it allot of them? I’m getting started with Numpy now, then I’ll look at Pandas.
Hello World !
Tags: opensource
Published: 2020-09-18 03:36:12

I have read many blogs by others. But I never created one myself.
So for my future self, here comes my first blog.  

I am learning programming at college. 
Right now, I am taking a course titled as "Topics in Open Source Development" to gain some real world experience on large programming projects.

I like to work on open source projects on Android due to its market share in the world's smartphone sector. Affordable Android smartphones are bringing the Internet to the fingertips of more people in the world. I would love to make their experience more smooth and enjoyable.
After 8 months 4 weeks and 1 day
Tags: personal, blog
Published: 2020-09-18 03:25:40

It has been a while I didn't post something for 8 months 4 weeks and 1 day 😂. What a shame.

Anyway, I just want to share my current state for now. There are a lot of things happened before and after the pandemic. My primary laptop broken (data were safe, hopefully), my only phone was also broken. However, I was able to work for developments and thesis since I still have to get to the campus and able to borrowed my sister's netbook (Thank God).

One of the great things was that me with my team can deliver new app using Flutter framework and deployed it successfully without too much drama (perhaps). The app was made for a campus which I work for and thankfully, it is the first project to be adequately documented. That is one achievement for our team by the way (a lot of do-not-tell-others stories here). Here is <a href='https://play.google.com/store/apps/details?id=id.ac.likmi.likminetmobile&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'>the app</a>.

We still have to work and support on other things like e-learning system that our campus using. In other side, we still have to improve the way we work, managing projects and smaller tasks, and so on.

That's it for the post. Not a insightful post 😅. But anyway, sharing stories is good, no?
A poc password manager (no database)
Tags: javascript
Published: 2020-09-18 02:46:53

Hi everyone, I'm a fullstack engineer based in Melbourne Australia. In a random afternoon I got this random idea
```
Why we trust a password manager platform?
The most secure database should be our own memory
(or kinda wrong haha)
```

I came to this idea which is I only need to remember my password pattern and a master password (or more like a secret key)

https://easypwd.vercel.app/

![Screen Shot 2020-09-18 at 12.42.57 pm](https://dev-to-uploads.s3.amazonaws.com/i/u8okvkigjzmziwhgo0jl.png)
 
Here I assume my password format is
`platform-domain__DoB`

eg. `facebook.com__01011900`

and my master password can be `password123`

![Screen Shot 2020-09-18 at 12.45.59 pm](https://dev-to-uploads.s3.amazonaws.com/i/sti5fwirer2ctyy0tci5.png)
 


This is my first side project, feel free to leave any comment :)
Introducing ForemJS: The API Wrapper for Dev.to
Tags: node, javascript, forem, opensource
Published: 2020-09-18 02:20:08

If you hadn't already known, Dev.to has access to an API. You can access it [here](https://docs.forem.com/api/). For my lovely NodeJS developers, I've started developing an [open-souce](https://github.com/foremjs/foremjs) API wrapper for it called [ForemJS](https://www.npmjs.com/package/foremjs).

{% github foremjs/foremjs no-readme %}

Currently, it is very limited but I have plans to cover the entire API. ForemJS runs asynchronously, so you will have to use `await`, or `.then()` callbacks. I am currently working on documentation, but here are the basics of how it works.

# Step 1 - Install the Package

`npm i foremjs@0.1.x`

As by [SemVer](https://semver.org), while the MAJOR version is still 0, breaking changes may occur. The PATCH versions (0.1.x) are going to be adding documentation, and polished up the wrapper as per people's specifications. The next MINOR (0.2.0) version should cover more of the API and get ready for 1.0.0. 

# Step 2 - Require the Package

```js
const Forem = require('foremjs')
```

This is a simple process of just requiring the package.

# Step 3 - Create a Client

You will have to get a token from your [settings page](https://dev.to/settings/account). Now use the following code to create an instance. This is how you will access the API.

```js
const client = new Forem.Client(TOKEN)
```

# Step 4 - Use the API

You can use `.getArticle(id)` to get an article. These are some of the properties carried by the Article class: `.title`, `.description`, and `.url`. You can see the code for the whole list. There is also `.getUser(id)`, however, it is a bit limited by the API itself. You can get things like `.createdAt`, and `.github` for their username.

More features are soon to come, such as posting articles. Thank you so much for reading this article. Maybe my next one will be posted using my wrapper? Seriously, though, if you have any questions, comments, or concerns about this project comment them down below and I will respond as soon as possible.
Help me choose: My desire vs popularity. Your opinion please!
Tags: python, php, ruby, rails
Published: 2020-09-18 02:14:23

A few days ago I wrote a post about my choice between Django, Rails or Laravel. here is my post: https://dev.to/rickavmaniac/django-rails-or-laravel-my-personal-journey-30lh

As of today I have not yet made this choice. I have studied the matter from all angles but I cannot make a decision.

Here is my dilemma. Clearly I prefer Ruby on Rails. However as mentioned in my post Ruby on Rails is not very popular locally (and even globally). And I am afraid of the consequences this could have at all levels. Is that really reason enough not to choose it? Would you pass popularity first? Do we base too much of our choices on the cool new kid on the block? Or maybe it is wise to do it?

I guess I'm not the first to experience a similar dilemma. 

Your opinion please ...
I made my own laptop stickers this week
Tags: watercooler, showdev
Published: 2020-09-18 02:08:51

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

First of all, I'm not a US citizen and can't vote yet. Although I'm inclined toward liberty and freedom in general, I'm not critically political for US politics and I hope you won't drag it there.

I'm just here to show off my new maker skill I've learned that's outside of writing code. It's been seven years of continuous code bashing and I'm glad to say it's a good winding down to finally pick up or return to doing something that's softer and not too black or white.

Mrs. Harris happened to be a perfect subject of my art because she represents what I deem as inspiring, growing up in a family of immigrants.

If you happen to enjoy my sticker and would like to slap one on your box, you can help support my new found passion and make a pre-order here https://etsy.com/shop/monkeypiston.
Installing lorawan-stack in local machine
Published: 2020-09-18 01:41:04

========================================

## Prerequisites

1. Make sure you have go version 14 or above. I had some issues with go version 13 when initializing the database.

2. Make sure you have the GOPATH and other paths configured.

My environment:
MacOS Catalina
go version 15

========================================

Clone the development repository into your local machine, and initialize the repository.

```
$ git clone https://github.com/TheThingsNetwork/lorawan-stack $GOPATH/src/github.com/lorawan-stack

$ cd $GOPATH/src/github.com/lorawan-stack
$ make init
```

Run the following command to set up the frontend. This may take about 10~20 mins.

```
$ tools/bin/mage js:build
```

Run the following command to get the database started.

```
$ tools/bin/mage dev:dbStart
Creating network "lorawan-stack-dev_default" with the default driver
Creating lorawan-stack-dev_cockroach_1 ... done
Creating lorawan-stack-dev_redis_1     ... done
            Name                           Command               State                                Ports
-----------------------------------------------------------------------------------------------------------------------------------------
lorawan-stack-dev_cockroach_1   /cockroach/cockroach.sh st ...   Up      127.0.0.1:26256->26256/tcp, 127.0.0.1:26257->26257/tcp, 8080/tcp
lorawan-stack-dev_redis_1       docker-entrypoint.sh redis ...   Up      127.0.0.1:6379->6379/tcp
```

Initialize the stack. This will take a few minutes as well.

```
$ tools/bin/mage dev:initStack
go: downloading github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c
go: downloading go.thethings.network/lorawan-stack-legacy/v2 v2.0.2
go: downloading github.com/oklog/ulid v1.3.1
go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9

etc....

  INFO Connecting to Identity Server database...
  INFO Detected database CockroachDB CCL v20.1.5 (x86_64-unknown-linux-gnu, built 2020/08/24 19:52:08, go1.13.9)
  INFO Initializing database...
  INFO Creating tables...
  INFO Successfully initialized
  INFO Connecting to Identity Server database...
  INFO Creating user...
  INFO Created user
  INFO Connecting to Identity Server database...
  INFO Creating OAuth client...
  INFO Created OAuth client                     secret=
  INFO Setting owner rights...
  INFO Set owner rights
  INFO Connecting to Identity Server database...
  INFO Creating OAuth client...
  INFO Created OAuth client                     secret=console
  INFO Setting owner rights...
  INFO Set owner rights
```

Finally, run the code.

```
go run ./cmd/ttn-lw-stack -c ./config/stack/ttn-lw-stack.yml start
```

Open `localhost:1885` in your browser. Both the username and the password will be `admin`.

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

Once you login, you should see this page.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4d3jvrvr5xhg1kizk4qk.png)
4 Weeks in at General Assembly
Published: 2020-09-18 01:07:58

In my last post I talked about my background, why I'm making the career pivot into Data Science, and how I came to start at General Assembly.

Now I guess it's time for an update! 

I'm now 4 weeks in to the 12 week immersive and I'd like to talk about what's working and what isn't.

The first week was gaining our bearings and refreshing us on the basics of probability. Seeing as this was largely a recap of the required pre-work we did, I was hoping for slightly more in-depth Python fundamentals. I appreciate them making sure everyone is on the same page, though.

The second week is where I started to really sink my teeth in. Pandas and exploratory data analysis. I may not have enjoyed it much at the time, but now I rather enjoy the data analysis! We presented our first big projects and I while I felt terrible about mine going in, I felt really good about it afterwards. 

Week 3, however, was not kind to me. I submitted both of my homework labs half-finished and I still don't really fully understand the basics of Linear Regression. I feel like I really fell behind here. My mental health proceeded to get bad and just... the class is affecting me more than I thought. 

But that's not the end of this recap! This week I took more time for my health (... at the cost of making progress on my school work) and I'm feeling much better. As we've gotten further into Logistic Regression and Classification Metrics, some of what confused me last week is starting to fall into place. I know I'm going to be spending all weekend doing the homework I should've been doing during the week, but I think I'll be alright!

Alright, that was a lot of venting. So where does that leave me? I have the basics of how to analyze data and make a model based off it. I'm getting a better idea of what I don't know (understanding my ignorance is a wonderful feeling, honestly). And my capstone project is on the horizon. 

Oh, and I'm still waiting on a follow-up call from the recruiter. I think I can safely tell him I'm interested in the world of tech and programming and will come out with a solid understanding of Data Science. I don't know if that's where my heart is, but we've got 8 more weeks till we find out.

I know this is more Diary than article but it was due tonight and I know I'm not in a mindset to write "Linear Regression for Babies." Next week though ;)
Lord of the Pythons!!
Tags: actionshackathon, python, payid, xrp
Published: 2020-09-18 00:58:10

### My Workflow
So, you like Lord of the Rings, right? Every developer likes LotR, right? Don't you wish that more of your code had variables named after LotR characters? Right? RIGHT?!

What about if you could actually get PAID for replacing the variable names in your code with LotR names? Wouldn't that be AWESOME?!

![Party hard Gandalf!](https://dev-to-uploads.s3.amazonaws.com/i/3dulyvhw33k0aaa9xyyz.gif)

The wait is over... the ULTIMATE Github Action is here.

When you push code to a Github repo this action goes through all .py files it can find, parses them with an AST and pulls out the variable names. It then cross references them against LotR characters... and if you have increased the number of variables named after LotR characters in this set of commits then you are immediately paid an amount of XRP for your devotion and love.

### Submission Category: 

**Wacky Wildcards** Of course!


### Yaml File or Link to Code

This is how you get all the goodness... ohhhh yeah baby!

```yaml
name: Lord of the Pythons

on:
  # Trigger the workflow on push or pull request,
  # but only for the master branch
  push:
    branches:
      - master

jobs:
  pay:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout code  
      uses: actions/checkout@v2
      with:
        fetch-depth: 5

    - name: Checkout prior code  
      uses: actions/checkout@v2
      with:
        ref: ${{ github.event.before }}
        path: .old-code

    - name: Checkout current code  
      uses: actions/checkout@v2
      with:
        path: .new-code

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.x'

    - name: get commit message
      run: |
        echo ::set-env name=commit_log::$(git log --format=%B ${{ github.event.before }}..${{ github.event.after }})
    - name: Get number of new LotR characters
      id: lotr
      uses: hammertoe/lord_of_the_pythons@master

    - name: Run PayID
      uses: hammertoe/payid_xrp_action@1.1
      if: ${{ steps.lotr.outputs.num > 0 }}
      with:
        wallet_secret: ${{ secrets.PAYID_WALLET_SECRET }}
        amount: ${{ steps.lotr.outputs.amount }}
        commit_log: ${{ env.commit_log }}
```

The full link to the repo is here:

{% github hammertoe/lord_of_the_pythons %}

### Additional Resources / Info

This action utilises another action that I have developed for this hackathon, `payid_xrp_action` [which has it's own entry](https://dev.to/hammertoe/automatically-pay-contributors-in-xrp-via-payid-4d3e).
New Corona Charts
Tags: showdev, vue, chartjs
Published: 2020-09-18 00:52:44

I made a web application with Vue.js, Chart.js and a free API([COVID 19 API](https://covid19api.com/)) tells us many kind of data of corona virus.
The name of the application is [Corona Report Made by a Failure](http://crmf.s3-website-ap-northeast-1.amazonaws.com/?#/index).
In it,You can get
* Number of new confirmed, new deaths, new recovered, total confirmed, total deaths and total recovered of the world
* Top 10 countries of number of them
* Number of them of countries around the world
* Line charts of number of confirmed, deaths, recovered and active per day

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

If you want to know codes in it, Please check my repository.
[Github CRMF](https://github.com/santooooooo/CRMF)
A Call For Developers To Be United
Tags: discuss, javascript, java, webdev
Published: 2020-09-18 00:51:46

I'd like to share this video with all of you , and hear your thoughts. It's very important to watch the video first.
However, I'm going to sum up the main points of the video.

main points:
1 - stop reinventing the wheel. The number of programming languages out there is distracting , and most importantly they add nothing new fundamentally. 

2- NO corporations own any programming languages.Instead, an organization will be responsible for all the standards and technical specifications.

3- if we didn't do this by our own will, there will be sooner or later some rising of horrific tragedy caused by a bug that leads to lawsuits against developers. Which then leads governments to step in and regulate us! tells us what language to use and how to use it.As an attempt to prevent such an accident to happen again.

The video: (fast forward to the minute 27:20 )

  
{% youtube P2yr-3F6PQo %}
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2020-09-18 00:47:08

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

---

Welcome to DEV, @tatjanaburdett!

{% devcomment 14okp %}

Great "Explain Like I'm Five" example for generating random numbers, @yechielk.

{% devcomment 14jnp %}

Big congrats on the new gig, @jarodpeachey!

{% devcomment 14k6n %}

So true, @sarahob!

{% devcomment 14jgh %}

@flabbet is getting ready for first-time Hacktoberfest contributors. Love it!

{% devcomment 14ki4 %}



See you next week for more great comments ✌
What does your study routine looks like?
Tags: productivity, discuss, career
Published: 2020-09-18 00:43:03

Hey everyone,

I'm curious to learn about what does your study routine looks like? What time of the day you choose to indulge in learning and how much it is usually?

I have been recently struggling to make time for learning and trying new things in general because of the workload and not being able to prioritize correctly, which led me to think that maybe I need to make some adjustments in my routine to make more time.

Thank you :)