teleren/devto huggingface dataset:
Building an Automatic Daily Text Notification System - Project Start 
Tags: twiliohackathon, python
Published: 2020-04-21 20:15:20


## Project Idea
Hey everyone! I wanted to join the TwilioHackathon & (hopefully) create something neat that others can use as well. 

The idea for the build is to create an automatic messaging system that runs daily. Each day, the script would pull data from this [API](https://covidtracking.com/api/states/daily) that would be processed, filtered, and passed to someone who subscribes to the notifications via a web form. 

I've already made some progress in building this, and the web form can be found [here](https://18547.wayscript.io/). A user submits their name, location, and a phone number to receive the notifications on.

I'm using [WayScript](www.wayscript.com) for this build to quickly build all the moving pieces and to automate the script to notify subscribers daily. 

### Collecting the Data
To get the data that will be passed on to the subscribers, I'll be using Python and the requests library. The code for this project can be found [here](https://github.com/wayscript/code_snippets/tree/master/Trigger%20Notifications%20%26%20Alerts/Twilio%20Covid%20Informer). 

### Integrations used 
For the completed build, I'll incorporate the Google Sheets API for storing subscribers information and the Twilio messaging API for sending the notifications. 

I'll update shortly with more progress. Happy Coding!
Await a setTimeout
Tags: javascript, snippets, programming, devtips
Published: 2020-04-21 20:07:07

---
title: Await a setTimeout
published: true
description: Use the async/await syntax with setTimeout
tags: JavaScript, Snippets, programming, devtips
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/myondqoergjfjwnchm5c.png
---

Even thought `setTimeout` isn't always the best solution we always end up using it for some reason. Since I quite like the `async/await` syntax I create a small snippets to `await` a `setTimeout`.

``` JavaScript
// === Snippet ===
const wait = (timeToDelay) => new Promise((resolve) => setTimeout(resolve, timeToDelay));

// === Usage ===
// Some code before
await wait(1000); // wait 1s
// Code runs after 1s
```
Introducing VS Code Working Sets 💼
Tags: showdev, vscode, productivity, tools
Published: 2020-04-21 20:05:43

---
title: Introducing VS Code Working Sets 💼
published: true
description: An introduction to my VS Code extension Working Sets
tags: showdev, vscode, productivity, tools
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/c30hi2gf7aexdjeo580h.jpg
---

Picture this, you're happily coding an awesome feature for your product and you have a few VS Code tabs open specific to that feature. Suddenly, you receive a message, there is a bug in a totally unrelated part of the site and you need to investigate. You start opening new files as you debug the issue, next thing you know you have 37 tabs open. You fixed the bug (nice job!), but now you want to go back to your awesome feature and there's a lot of clutter, you start closing one-by-one the unrelated tabs until your editor is back to the state it was before the bug.

Does that sound familiar? Have you ever been in that situation before? Wouldn't it be nice if you could "save" the files related to your awesome feature, work on your bug, and then come back to your saved files with just a few clicks?

Well, I wrote a VS Code extension that allows you to do just that. I call it [Working Sets](https://marketplace.visualstudio.com/items?itemName=bernardop.working-sets).

## What are Working Sets?

The idea is simple--a way to manage and organize groups of resources--but is not new. Other editors like [Eclipse](https://help.eclipse.org/2019-12/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm) and [Facebook's Nuclide](https://nuclide.io/docs/features/working-sets/) offer versions of this concept. The VS Code team has [discussed](https://github.com/microsoft/vscode/issues/9498) [this](https://github.com/microsoft/vscode/issues/13951) [before](https://github.com/microsoft/vscode/pull/87666) too. And although they may offer a baked-in solution in the near future, I still wanted to share my take on it. I've wanted to contribute to open source for a while and I thought this was the perfect opportunity.

## How does it work?

![VS Code Working Sets demo](https://dev-to-uploads.s3.amazonaws.com/i/9d26gnjbhpde6tnbqhxp.gif)

In a nutshell, it shows a new sidebar view where you'll have access to all your saved working sets. From there you can create, restore and delete them as well as add/remove files from them. You can find more details on the extension [README](https://marketplace.visualstudio.com/items?itemName=bernardop.working-sets).

I would love for you to take it for a spin and let me know what you think.

[VS Code Working Sets](https://marketplace.visualstudio.com/items?itemName=bernardop.working-sets)

***

Cover photo by [Russ Ward](https://unsplash.com/photos/bqzLehtF8XE)
JavaScript Project
Tags: codenewbie, javascript
Published: 2020-04-21 19:46:30

Thank you for being here! Originally publish in March of 2020!

This project is a single page application (SPA) built using a JavaScript frontend and a Rails API backend.

**Why a home maintenance app?**

As a home owner, there are more projects than days of the year - most of which aren't urgent but do need attention. Say hello to Fixit, a home maintenance app designed for renters or owners to track what needs to be attended to around the home.

**Language and skills implemented**

I built this project using a Rails API for the backend and JavaScript for the frontend. My toolset included Visual Studio Code (editor/terminal), GitHub (to store my repository), as well as Postgres for my database.

**Feature Highlight** 

Each user who interacts with this app gets to add their family (or roommate) information as well as any home projects that need attention. It's a very simple way to store tasks that might not get done immediately but do need to get done. A user can update the status of any project - whether it's complete or incomplete - and have a very quick look at which project they'd like to target next. 

**Hurdles Jumped** 

I thought building a Rails app was complex, but I think this one took the cake. Troubleshooting this app's code was a real hunt at times, and I found it hard to get into a routine.

The biggest hurdle was making sure I understood exactly where the issue was located. When an error message appeared or when the app wasn't responding in the intended way, I first had to ask, is this a backend or frontend issue? If it had to do with models, controllers, serializers or routes, check the backend. If it had to do with the app's behavior or what a button should be doing, check the frontend.
 
Toggling back and forth between backend and frontend meant moving more slowly and taking baby steps to figure out 1) where to look and 2) how to solve the issue. There was only one thing that really helped me keep moving:
# Experiment.
I didn't always know where to look or what to look for, so I told myself to *just try something*. Any movement means progress - even if I'm figuring out what's *not* the issue, at least it's one clue.

**What's Next**

My ultimate goal was to build a program that was relatively functional all along. But my secondary goal was to add an interative quality - and the pop-up buttons served that purpose. Something to really showcase that the page didn't need to refresh to show new data.

Having accomplished both, I do have a wish-list for when time becomes more abundant:

1) All families and all projects are accessible to anyone. To make this more private and more accessible to more families, I would create a login so you could only see your own family name and your own projects.

To see it for yourself, head here: [GitHub](https://github.com/AnnaWijetunga/fixit)

Thanks so much for reading through! To comment or get in touch, please see the links below. - Anna

Connect with Me [Twitter](https://twitter.com/AnnaWijetunga) [LinkedIn](https://www.linkedin.com/in/annatattan/)
Mental Models
Tags: codenewbie, javascript
Published: 2020-04-21 19:45:30

Originally posted in February of 2020!

After three months of Ruby, JavaScript hit me like a brick wall. Two weeks in and I had to slow down and find my bearings.

Flatiron's curriculum has always been exceptional, but it always helps to hear it again, in different ways.

I signed up for Dan Abramov's hot new course, Just JavaScript, and one of the early lessons made a huge impact.

Dan shares a bit about slow and fast thinking from author Daniel Kahneman:

> Whenever we can, we rely on the “fast” system. We share this system with many animals, and that gives us amazing powers like walking without falling all the time. This “fast” system is good at pattern matching (necessary for survival!) and “gut reactions”. But it’s not good at planning.
> 

Because slow thinking can be so draining, we mere humans default to fast thinking. And this gets us into trouble because we may miss bugs in our code.

The "fix" here is to pay attention to, and in a newbie's case, **build** our mental models.

```
let a = 10;
let b = a;
a = 0;
```

Our mental model would be how we talk through and understand code. 

For example:

```
let a = 10;
Declare a variable called a. Set it to 10.

let b = a;
Declare a variable called b. Set it to a.
Wait, what’s a again? Ah, it was 10. So b is 10 too.

a = 0;
Set the a variable to 0.
So a is 0 now, and b is 10. That’s our answer.
```

While rushing through labs and lessons always seems important to stay on track with the curriculum, I know that slowing down my thinking to ensure I'm building my own mental models is actually the priority. Tis a work in progress but this time, in the right direction.
Rails Project
Tags: codenewbie, rails
Published: 2020-04-21 19:44:24

Thank you for being here! Originally from February 2020, here she is now in all her glory.

This project is a MVC, Ruby on Rails web application created to save books and leave/share reviews amongst a community.

**Why a book review app?**

As an avid reader, I'm always looking for ways to record and remember books I've read. This app solves that! You can record the book you've read as well as leave a review. You also have the option to invite your friends to share reviews across your community.

**Language and skills implemented**

I built this project using Ruby on Rails and ActiveRecord. My toolset included Visual Studio Code (editor/terminal), GitHub (to store my repository), as well as Postgres for my database. I included a third-party signup/login via Google using OmniAuth.

**Feature Highlight** 

Each user who interacts with this program not only gets to record the books they've read, but they can also share reviews of that book and have access to reviews they didn't write. 

If you are searching the site and see a book title you recognize but haven't read it yet, you can read another person's review to figure out if it's worth reading.

**Hurdles Jumped** 

Building this app was a lot to keep track of because there are so many moving parts.

The biggest hurdle was making sure to create all necessary models, views and controller - and then, break down that logic and move it to helpers or partials.

The error messages received were my guide, and for once I was grateful for those, but the immensity of the application itself often felt overwhelming to keep track of. I kept getting lost in my own work!

After a few days of overwhelm at all there was to do and build, here's what I kept telling myself:
# One step at a time.
My brain had been trying to deal with 50 action steps at once (well, to build the controller means I need to build that route and those 4 views and and and), so I had to stop myself from that line of thought.

Instead, I tried to work in baby steps: build a controller, draw out the routes, map out the views for those routes, repeat. One step at a time.

**What's Next**

My ultimate goal was to build a program that was relatively functional all along. But my secondary goal was to finally learn how to incorporate Bootstrap.

Having accomplished both (ta-da!), I do have a wish-list for when time becomes more abundant:

1) I want to include a search bar, to search amongst the list of books by author and books by title.

2) Could be interesting to connect with a site like Goodreads to have access to more books and more data!

To see it for yourself, head here: [GitHub](https://github.com/AnnaWijetunga/bookshelf)

Thanks so much for reading through! To comment or get in touch, please see the links below. - Anna

Connect with Me [Twitter](https://twitter.com/AnnaWijetunga) [LinkedIn](https://www.linkedin.com/in/annatattan/)
Rails App From Scratch
Tags: codenewbie, rails
Published: 2020-04-21 19:43:05

Originally posted January 2020, but here it is now!

What they say is true - Ruby on Rails is powerful (and magical!). But to really appreciate that power and magic, you'd have to build an app from the ground up. Let's work through that initial setup of creating folders and files to get a Rails app up and running.

Let's build a coupon application, which stores coupon codes and the stores they belong to.

**Create a coupon model** in a folder `models` in a file `coupon.rb`:

```
class Coupon < ActiveRecord::Base

end
```

**Create the table and migrate it.** Go into your `db` folder and create a new folder, `migrate`, and within that folder, a new file, `001_create_coupons.rb`:

```
class CreateCoupons < ActiveRecord::Migration
  def change
    create_table :coupons do |t|
      t.string :coupon_code
      t.string :store

      t.timestamps null: false
    end
  end
end
```

**Migrate** by running `bin/rails db:migrate RAILS_ENV=test` and look at your schema file afterwards to ensure all looks well.

**Create** the `CouponsController` located in the `controllers` folder:

```
class CouponsController < ApplicationController

end
```

**Create the routes** within the folder `config` and the file `routes.rb`:

```
Rails.application.routes.draw do

  resources :coupons, only: [:index, :show, :create, :new]

end
```

The `resources` route maps HTTP verbs to controller actions automatically - just the beginning of the magic

**Start building** out the `CouponsController`:

```
class CouponsController < ApplicationController

    def index
		@coupons = Coupon.all
    end

    def show
		@coupon = Coupon.find(params[:id])
    end
    
    def new

    end
		
    def create
        @coupon = Coupon.new
        @coupon[:coupon_code] = params[:coupon][:coupon_code]
        @coupon[:store] = params[:coupon][:store]
        @coupon.save
        redirect_to coupon_path(@coupon)
    end
		
end
```

**At any point**, type `rails routes` in the terminal to see the created routes. 

**Start mapping out the views** within the folder `views` and folder `coupon` and your file names will look like this:

```
index.html.erb
new.html.erb
show.html.erb
```

**The rest** is ensuring your views display what you intend them to display, using your console for testing, and seeing what your browser displays - errors, empty content or your actual content. 

Cheers to building your own Rails app from scratch, and may you enjoy the power and magic!
Generate ASCII faces
Tags: asciiart, html, typescript, showdev
Published: 2020-04-21 19:41:54

---
title: Generate ASCII faces
published: true
description: Generate ASCII faces with colour
tags: ascii art, html, typescript, showdev
---

[![npm version](https://badge.fury.io/js/ascii-face.svg)](https://github.com/o8e/ascii-face)

A silly package I created whilst working on a side project. I needed faces for profile images, and thought why not have a unique set of text-based generated faces.

> There are 501,600 potential combinations

![Standard](https://raw.githubusercontent.com/o8e/ascii-face/master/assets/img/example-mono.png)

![Colour](https://raw.githubusercontent.com/o8e/ascii-face/master/assets/img/example-color.png)


### Usage

For now it's a default export, so import it however you want.

```bash
npm install ascii-face -s
```

Standard

```js
import facegen from 'ascii-face'
const face = facegen()
// ...
```

Colour

```js
import facegen from 'ascii-face'
const face = facegen(true)
// ...
```
Bubbles
Tags: d3, circle, packing, physics
Published: 2020-04-21 19:39:48

---
title: Bubbles
published: true
tags: d3, circle, packing, physics
---

<p>Experiment with <a href="https://d3js.org/">D3.js</a> to simulate circle packing bubbles.</p>
<p>It was a great way to play with CSS custom properties as well, together with the nice new features from ECMAScript like async / await that made the code so much cleaner.</p>

{% codepen https://codepen.io/gibatronic/pen/MWaaqwR %}
About Ruby Hash#compare_by_identity and Hash#compare_by_identity?
Tags: ruby, hash, documentation
Published: 2020-04-21 19:39:31

---
title: About Ruby Hash#compare_by_identity and Hash#compare_by_identity?
published: true
description: 
tags: ruby, hash, documentation
---

Get more information and more examples at my AboutRuby project:
* [AboutRuby project](https://github.com/BurdetteLamar/AboutRuby/blob/master/core/Hash/api/markdown.md#compare_by_identity)

Here's the write-up over at the Ruby project:
* [Ruby project](https://ruby-doc.org/core-2.7.0/Hash.html#method-i-compare_by_identity)

My main page is [here](https://github.com/BurdetteLamar/AboutRuby#about-ruby).

TL;DR

I've been working on enhancements to the documentation for the Ruby project.  Getting these enhancements posted to the Ruby project has been very slow.  They're not actually meeting resistance;  I know because my many PRs for enhancing class ENV were accepted (though not rapidly).  It's just that everyone is busy.

Anyhow, I'm stashing all this stuff on in my own project, called AboutRuby.  The piecemeal migration from there to the Ruby project is not going to be completed in my lifetime (I'm 77 years old).

So:  I'm going to blow my own horn here on DEV, to encourage you to use the enhanced documentation.
Anna from November 2019
Tags: codenewbie, beginners
Published: 2020-04-21 19:28:57

Believe you me, I'd much rather bury this one, but for nostalgia, I present to you, my original post about how I was found coding. Enjoy.

It's funny where life takes you.

Ever since the tender age of five, my dream job was to become a teacher. I wanted nothing more than to assign homework and bake cookies for my students.

I'm here to tell you I did indeed become a Kindergarten teacher and do both of those things. 

For a while this was the challenging, and quite often syrupy sweet, job I'd always wanted. 

Until it wasn't.

Even though it felt like I was throwing away a perfectly good career and a degree, off I went.

Health Coach, shoe salesperson, personal trainer, and mama.

Each new opportunity had that initial excitement of *new* and *interesting*, followed by a wave of regret for tossing my previous time and efforts.

You may very well guess that becoming a mama changed everything. Shortly after spending the first year home raising my wee babe, I pursued a radically new (for me!) opportunity because I needed to get out of the house! make friends! speak a-n-y-t-h-i-n-g other than baby talk!

I was hired to work for an ed-tech company in New York City. This, my dear readers, ignited the spark.
Free proofreading for dev.to writers
Tags: discuss, writing, meta
Published: 2020-04-21 19:23:39

It's very hard to make a high quality blog post without at least some feedback.

#### Would any writers here be interested in joining a group for mutual proofreading and feedback?

Tools like [Grammarly](https://www.grammarly.com/) can fix our typos and grammar, but an extra pair of eyes going over the text before it is published can make the difference between an average post and a really good one.

Thoughts?
Kick Off: Beyond Bootcamp
Tags: codenewbie, beginners, career, productivity
Published: 2020-04-21 19:17:48

Flatiron's software engineering bootcamp was a hoot, but word on the street is, it's just the beginning.

With graduation so-close-I-can-smell-it, it's time to set new goals to keep the momentum going and also find a job in this bright and shiny field.

Things to figure out:

1) What type of job am I looking for? 

2) With Ruby, JavaScript and a handful of frameworks under my belt, what should I learn next?

No lack of things to do to answer those q's, so I'll scoot off to figure out the details. Catch you next time with the update on where I'm heading next.
How to create different environments in Angular?
Tags: angular, webdev, frontend
Published: 2020-04-21 19:00:19

Hello Everyone 👋,

In a project, there will be a scenario where we have to create different environments. For example for the DEV environment, all the APIs in our app should point to the DEV server endpoint. Similarly for QA, UAT, stage, and prod APIs should change to respective environments. 

First, create different environment files. By default, angular provides us two environment files. One is environment.ts file which is for development and the other is environment.prod.ts file for prod. So whenever we want to use environment variables, just import only environment.ts file to your component/module. Angular will automatically replace respective environment files while building. 

Next, go to angular.json and search for **configurations** object. Inside that create a new object with key as [environment] name. Create an array with key as fileReplacements and replace environment.ts with the respective environment file.

![angular.json](https://dev-to-uploads.s3.amazonaws.com/i/mnjlpzg7btb62qk40gmv.png)

Next, go to package.json and under scripts, add commands like **"build:uat":ng build --configuration=uat"**. Here we need to pass configuration key and that key should match with angular.json configuration.

Run command **npm run build:uat** Angular replaces environment.ts with environment.uat.ts across the application.

Thanks for your time! Have an amazing day✌️
CSS Tips you won't see in most tutorials
Tags: css, webdev
Published: 2020-04-21 18:43:58

CSS tips and tricks you won’t see in most of tutorials.

>If you're learning CSS, I'd suggest you to check this **[CSS Tutorial](https://markodenic.com/css-tutorial/)** first.

##What is CSS?

Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language like HTML. CSS is a main technology of the World Wide Web, alongside HTML and JavaScript.

CSS is designed to enable the separation of presentation and content, including layout, colors, and fonts. This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple web pages to share formatting by specifying the relevant CSS in a separate .css file, and reduce complexity and repetition in the structural content.

## Let's start with the tips!

##* Cursors

Did you know that you can use your own image, or even emoji as a cursor?

{% codepen https://codepen.io/denic/pen/bGVpOPj default-tab=html,result %}

##* Smooth scrolling

Smooth scrolling without JavaScript, with just one line of CSS.

{% codepen https://codepen.io/denic/pen/bGVeYqN default-tab=html,result %}

##* Truncate text

Did you know that you can truncate text with plain CSS?

{% codepen https://codepen.io/denic/pen/LYpZKMg default-tab=html,result %}

##* Truncate the text to the specific number of lines.

You can use “-webkit-line-clamp” property to truncate the text to the specific number of lines. An ellipsis will be shown at the point where the text is clamped.

{% codepen https://codepen.io/denic/pen/pojEKGX default-tab=html,result %}

You can find more HTML/CSS/JS Tips here: [github.com/MarkoDenic/awesome-html-css-js-tip](https://github.com/MarkoDenic/awesome-html-css-js-tips)

If you liked this article, be sure to ❤️ it.

This article is a repost from my blog. Find the original post here: [CSS Tips](https://markodenic.com/css-tips/).

> A bonus: Read more about [CSS line-height](https://markodenic.com/css-line-height/).

Let's keep in touch:
[Blog](https://markodenic.com/)
[Twitter](https://twitter.com/denicmarko)
[Github](https://github.com/MarkoDenic)
[Codepen](https://codepen.io/denic)