teleren/devto huggingface dataset:
My JS Project
Published: 2021-06-20 04:52:29

For my Javascript Project, I initially worked on an app that allows users to buy and sell books from one another at discount prices. I, being a student, know how expensive books can be, particularly those you use for just a semester! So, that was my initial inspiration for the project. After building the MVP for this project, however, I realized that for the app to be used as intended, a user model was crucial. Given the time constraint to finish the project, I decided not to work on the additional user model and authentications as my intention was to build a simple app with relatively simple functionalities. So, I did what I would never advise anyone to do and switched project ideas!

I decided to create an app called My Devotional, which is an app that allows users to create and save their daily Bible devotions or reflections on scripture that they read that day. As it uses a very similar structure and premise as my initial idea, making the switch was not difficult. I set up the project into two repositories: a backend repo (using rails) and a frontend (using html, css, and javascript)

I set up my rails backend api by first running:

```
rails new <my_app_name> --database=postgresql --api
```

For this app, I only had two models: a category model and a devotion model:

```
class Category < ApplicationRecord
    has_many :devotions, dependent: :destroy
end

class Devotion < ApplicationRecord
   belongs_to :category 
   validates :title, presence: true
end
```

Each model had the attributes as shown in the db schema below:

```
create_table "categories", force: :cascade do |t|
    t.string "name"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "devotions", force: :cascade do |t|
    t.string "title"
    t.string "date"
    t.string "verse"
    t.string "content"
    t.string "image_url"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.bigint "category_id", null: false
    t.index ["category_id"], name: "index_devotions_on_category_id"
  end
	
	add_foreign_key "devotions", "categories"
```

I set up the routes as follows, using namespacing to organize the controllers and allow for version control:

```
Rails.application.routes.draw do
  namespace :api do
    namespace :v1 do
      resources :devotions
      resources :categories
    end
  end
end
```
Once the backend was complete, I linked to to the front end by setting the fetch endpoint to “http://localhost:3000/api/v1/devotions” so that the front end can communicate with the backend.

Overall, although I stuck to just the MVP for this project, I felt like I learned a lot. I look forward to expanding on it further in the future
My Rails Project
Published: 2021-06-20 04:49:33

For my Rails project, I decided to work on a recipe managment app with a bit of a social aspect to it. I created an app where users can create and save some of their favorite recipes and share them with others. Users can also browse through other users’ profiles and recipes. They can add other chefs to their friends and gain inspiration from others. This was my favorite project so far because I had a great time exploring different aspects of the project such as adding recipes to favorites, making friend, using various useful gems….etc.

These are the associations I set up for my two main models:

User:
```
  has_many :recipes, dependent: :destroy
  has_many :comments, :dependent => :destroy
  has_many :commented_recipes, through: :comments, source: :recipe
  has_many :friendships, :dependent => :destroy
  has_many :friends, through: :friendships
  has_many :user_recipes, :dependent => :destroy
  has_many :added_recipes, through: :user_recipes, source: :recipe 
  has_one_attached :avatar

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :validatable

  devise :omniauthable, :omniauth_providers => [:facebook]
 ```

Recipe:
```
 belongs_to :user
  belongs_to :category
  has_many :comments, :dependent => :destroy
  has_many :commented_users, through: :comments, source: :user
  has_many :user_recipes, :dependent => :destroy
  has_many :added_users, through: :user_recipes, source: :user

  has_many :ingredients, dependent: :destroy
  accepts_nested_attributes_for :ingredients, reject_if: :all_blank, allow_destroy: true

  has_many :steps, dependent: :destroy
  accepts_nested_attributes_for :steps, allow_destroy: true

  validates :name, :ingredients, :steps, :category_name, presence: true

  scope :most_commented, -> {left_joins(:comments).group('recipes.id').order('count(recipes.id) desc')}

  has_many_attached :images
```

I also had a few other models, namely:

Comment
Categories
Ingredient
Step
Friendship
User_Recipe

Some of the gems I found to be great were:

Devise - The first model I set up was my user model. Devise worked great for setting up user authentication. After adding the devise gem to my gemfile and running bundle install, I used $ rails generate devise:install to install devise. Next, I generated the user model by using $ rails generate devise MODEL and ran rails db:migrate to set up the user table

Facebook omniauth - I also integrated devise with facebook omniauth to give users the option to sign in using their facebook account. I found this resource to be quite useful in setting up the integration

Bootstrap - Bootstrap was great for styling the page. In fact, I used boostrap to create styled views for the user instead of using devise:views

Cocoon - I used gem cocoon to set up my nested forms. Ingredients and instructions were nested into the new recipe creation form.

Font-awesome-rails - I also used this gem to add some icons for styling purposes.

Overall, this was a fun project and I hope to expand on it in the future!
Daily Developer Jokes - Sunday, Jun 20, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-06-20 04:48:34

---
title: "Daily Developer Jokes - Sunday, Jun 20, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Sunday%2C%20Jun%2020%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258999910d.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did 10 get paid less than "10"?

___A:___ There was workplace inequality.
 -->
My Sinatra Project
Published: 2021-06-20 04:46:36

For my second project, I build a sinatra app called EduTasks, an app students can use to keep track of upcoming assignments, tasks, and reminders related to courses they are enrolled in. I chose this idea because I’m a student myself and with all classes being virtual at the moment, having a place to track all tasks, classes and due dates collectively would be beneficial to me and I assume to others as well.

The app is a CRUD, MVC app using Sinatra and a simple Content Management System (CMS) using the tools we have learned in Module 2. It uses four basic types of functionality: Create, Read, Update, and Delete. It also uses a Model-View-Controller design pattern that divides the logic of the program into 3 section and each section of the code has its own distinct purpose. So, I set up the following:

A user can create an account and can create courses
A user can view his/her account information and can view courses they are enrolled in
A user can edit his/her own account as well as courses they are enrolled in
A user can delete his/her account as well as delete any courses
To set this up, I set up the following association:

```
class User < ActiveRecord::Base
    has_secure_password
    has_many :courses
end

class Course < ActiveRecord::Base
    belongs_to :user
end
```

Some gems and resources I found to be useful are:

Corneal Gem - I used this gem to set up the scaffolding for the project.
Sintra-Flash: - I used this gem to set alerts and notices to the user. (eg. incorrect password, account doesn’t exist, password too short, etc)
Sass - I found this to be useful for styling css.
Boostrap - I actually ended up not using this since I watching this tutorial and ended up using sass instead, but it’s a great resource for styling.
bcrypt - this was useful for encrypting passwords
Overall, this was a fun project and one I hope to expand with additional features!

My walkthrough video of the current status of the project can be found here.
How to write a README file for your Github Profile?
Tags: github, opensource
Published: 2021-06-20 04:46:06

https://tech4e.medium.com/how-to-write-a-readme-file-for-your-github-profile-d386069b8d48

Resources YOU can follow-

    1. https://www.markdownguide.org/basic-syntax/#code

    2. https://github.com/eddiejaoude/eddiejaoude
 
    3. https://github.com/praveenscience/praveenscience 

    4. https://rahuldkjain.github.io/gh-profile-readme-generator/

    5. https://www.makeareadme.com/
Give new ideas time (100 Bytes Of Wisdom: Day 58)
Tags: career, journey, advice
Published: 2021-06-20 04:45:47

---
title: Give new ideas time (100 Bytes Of Wisdom: Day 58)
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

![Give new ideas time ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ihq35vjvaeppb3z0akc.png)

Often, new ideas feel wrong. They challenge the way you've been doing something and often cause a realisation within you that maybe you don't know everything. For some people, that can be heartbreaking. Often new ideas mean that you're not finished learning, something that can be very upsetting if you've fallen into a trap of thinking you're fully trained for this ever changing industry. My advice here is to give new ideas time. Think on them, reflect on them, consider their pros and cons. Do your best to avoid having a knee-jerk reaction just because it's new to you. Every tool you use today and feel proficient with was once a new idea. Imagine if that didn't get adopted...

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
Settling the editors key bindings war
Tags: editor, keyboard, keymap, binding
Published: 2021-06-20 04:34:59

---
title: Settling the editors key bindings war
published: true
description: on looking for the perfect key bindings that across all the editors and OSs
tags: editor,keyboard,keymap,binding
cover_image: https://i.postimg.cc/LsRG4HK8/Image-Resizer-ashx-n-http-i-nextmedia-com-au-News-noise.jpg
---

This SO question, [Key bindings war in my brain](https://softwareengineering.stackexchange.com/questions/28468/key-bindings-war-in-my-brain), best summarized the problem I'm facing and am trying to solve:

> How many key bindings are there in your brain? I personally use Intellij Idea as my primary IDE for development, but sometimes switch to Eclipse and Netbeans a bit, and sometimes I use Jedit, Notepad++, Emacs, Vim.
> 
> I am always trying to find a perfect key bindings that I can use crossing all the editors. What's your idea to solve this problem?

The question was asked over 10 years ago, and there is still no perfect solution to the problem. What's worse is that there is now another big player in the field now -- we need to add Microsoft Code to the above long list as well now. 

There may be no perfect solution for anyone, but for me, having to constantly switch between Emacs, Jed, Goland, IntelliJ Idea, and Microsoft Code, I'm going to let them all to use the same keyboard mapping and bindings. 

The most difficult part is not Goland, IntelliJ Idea, and Microsoft Code, contrary to people might think, but Emacs itself, as Emacs itself has no official standard for key mapping and bindings. For example, the other day I just realized that I have three different way for comment-or-uncomment: `C-c ;`, `M-#`, and `M-;`. Same for indents lines  and/or region, I have defined at least three different ways as well. 

Both Microsoft Code and IntelliJ has Emacs compatible mode which use Emacs key bindings. This post just collect them into a single place and put them side by side (if dev.to is restricting the blog width so you cannot see the full table width, you can also view it [here](https://gist.github.com/suntong/a8fd09192dd7354c2fb8a9cfd4e7edc0)): 

{% gist https://gist.github.com/suntong/a8fd09192dd7354c2fb8a9cfd4e7edc0 %}

PS. 

If you are interested in how these key bindings are collected, check out

- [Collecting Awesome-Emacs Keymaps](https://github.com/go-easygen/easygen/wiki/Advanced-Templating-1,-List-Awesome-Emacs-Keymaps), and
- [Collecting IntelliJ-Emacs Keymaps](https://github.com/go-easygen/easygen/wiki/Advanced-Templating-2,-IntelliJ-Emacs-Keymaps) which covers combining the two as well
#AcreditaNoProcesso
Published: 2021-06-18 09:30:30

Falar para pessoas que a gente conhece,  respeita, nem é tão dificil.

Mas o desafio hoje vai ser falar para pessoas que a gente conhece, te respeita e que vão caminhar com você de dentro da inciativa privada.

Pela primeira vez farei algo assim, que junta ações sociais com o setor privado. Sempre me mantive longe e aceitando toda ajuda possível, mas nunca de dentro realizando algo pelo social. Me sinto a vontade por estar cercado de gente boa e que confio, por isso me envolvo.

O processo é bom, esta sendo bem conduzido e o melhor, as emoções envolvidas são as melhores.

Cuidamos para que mesmo que em algum momento a gente escorregue pro limbo do "comum" , que é fazer o mesmo que muitos ja fizeram, ou seja, privilegiando 1%, mesmo entre os 10% dos mais necessitados, eu costumo dizer:

"Ainda assim vale, nós aqui do purgatório, salvar uma vida ali do inferno."

É tipo assim, tem boa intensão, cheira boa intensão, ainda que nossos corações e ambientes em que estamos inseridos, o capital, possa nos arrastar para a vala comum, e estará tudo bem, nós teremos feito algo bom e com resultados incríveis. Digo isso para dizer que estou em paz com a decisão.

Então me resta torcer pelos envolvidos, me dedicar para fazer acontecer. E como ativista que sou, pedir pra papai do céu nos dá aquela inspiração para podermos engajar, com histórias reais, o maior número de almas nessa caminhada que se inicia.

Só acredita no processo.

#AcreditaNoProcesso
Learn the Right Way to build React apps in Deno in 10 minutes [Aleph.JS]
Tags: deno, react, webdev, tutorial
Published: 2021-06-20 04:12:57

Hey all 👋, you must have read about Deno, the new backend #javascript runtime recently. I was hacking around with it in one of my older videos, and I wondered if we can build #ReactJs apps on it. Turns out we can!

Using AlephJs, one can build a React app in Deno while using the exact same API as #NextJS, ie,
- pages
- components
- api, etc

In my new video, I'll teach you how to:
- Create websites using Deno and React
- Understand how to import BOTH deno and node components and use them
- Customize some code to show how to use AlephJS

If you like the content, follow me [on Twitter](https://twitter.com/thewritingdev) for similar videos.

{% youtube SDTedmFhnQc %}
Day 4 of #100DaysOfCode!

Tags: javascript, beginners, 100daysofcode, codenewbie
Published: 2021-06-20 04:11:39

<h3>Today's progress🚗 </h3>
Mainly did exercises on freeCodeCamp and learned about `objects`. I enjoy doing the problems on here because they explain it well and are simple enough to grasp.
 
<h3>What I learned</h3>

So what are `objects` in programming? In programming, objects helps to model real-world objects. Just like in the real-world when we observe an object we can provide details of what the object is and what it can do. For instance, let's think of a *car*. A car has a ton of detail information we can provide. Let's call these *qualities*. A car has qualities such as `color`, what the `model` is, the brand of the car `make` , and the model `year`. 

 
object = **car**
object's qualities include:  
* color
* make
* model
* year

In programming, we can do the same thing. We can create an object and provide it with qualities or in programming *properties*.

Let's take the above example and write it in code. 

Define an object and name it car.
```javascript
let car = {
}
```

Now inside the object we want to create *properties*(qualities) for the car.
```javascript
let car = {
  color: 'black',
  make: 'Lexus',
  model: 'IS 250',
  year: '2014'
}
```
Now that we have an object with properties. We can go ahead and access these properties by using a `Dot` notation. First we call the object *car*, then use `.` and then whatever *property* we want to access. For example...
```javascript
car.make

console.log(car.make)
// output: Lexus
```
This will access the make property of the car object. When we do a `console.log` the output will be *Lexus*.
Flutter & Dart Tips - Week In Review
Tags: beginners, flutter, codenewbie, dart
Published: 2021-06-20 04:00:36


Hello Reader,

Welcome to the 2nd post in the "Week In Review" series, where I share the Flutter\Dart tips I tweeted last week.


1- You can use the services library to hide the status bar.

```dart

    import 'package:flutter/services.dart';

    void main() {
        SystemChrome.setEnabledSystemUIOverlays([]);
    }

```

2- The http package contains a set of functions and classes to consume HTTP resources. The example below use the http package to make http request

```dart

    import 'package:http/http.dart' as http;

    http.get(some_api_url).then((http.Response res) {
        final data = json.decode(res.body);
        print(data);
    });

```

3- You can use the FadeInImage widget & transparent_image package to display a transparent placeholder waiting for the image to fade in as it gets loaded.

```dart

    import 'package:transparent_image/transparent_image.dart';

    ...

    FadeInImage.memoryNetwork(
        placeholder: kTransparentImage, 
        image: someImageUrl,
        fit: BoxFit.fill,
    ),

```

4- To add icons to TextFields use "icon", "prefixIcon" and "suffixIcon" from InputDecoration

```dart

    TextField(
    decoration: InputDecoration(
        icon: Icon(Icons.email)
        ),
    ),

    ...
    
    TextField(
    decoration: InputDecoration(
        prefixIcon: Icon(Icons.email)
        ),
    ),

    ...

    
    TextField(
    decoration: InputDecoration(
        suffixIcon: Icon(Icons.email)
        ),
    ),

```

5- The cursor of TextField is Customizable. The example below will set the purple.

```dart

    TextField(
        cursorColor: Colors.purple,
        cursorRadius: Radius.circular(8.0),
        cursorWidth: 8.0,
    ),

```

6- To pack the children of a Row close together, set its mainAxisSize to MainAxisSize.min

```dart

    Row(
        mainAxisSize: MainAxisSize.min,
        children: [
            Icon(Icons.star, color: Colors.orange[500]),
            Icon(Icons.star, color: Colors.orange[500]),
            Icon(Icons.star, color: Colors.orange[500]),
            Icon(Icons.star, color: Colors.black),
            Icon(Icons.star, color: Colors.black),
        ],
    ),

```



See you next week. 👋🏻

> Follow me on <a href="https://twitter.com/_Mo_Malaka_">Twitter</a> for more tips about #coding, #learning, #technology...etc.

> Check my Apps on <a href="https://bit.ly/3h05gQ7">Google Play</a>

<span>Cover image <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/coder?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a> </span>
Top 5 Django projects that can get you a job.
Tags: python, django, career, programming
Published: 2021-06-20 02:04:22

Hello Devs, In this Post I'm gonna show you some top Django projects that can get you a job very easily and that Django projects look awesome on your resume.

```
Post Link:- https://pythondjangogeek.com/django/top-5-django-projects-that-can-get-you-a-job/

Linkedin:- https://www.linkedin.com/in/shivamrohillaa/
```

Here are the top 5 Django projects that can provide you a job very easily:-

1) Personal Portfolio in Django

![screencapture-shivamrohilla-herokuapp-2021-06-20-07_00_24](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d75o2kh8zk5bye6fyjx8.png)
 
Create a personal portfolio website in Django and post your projects on your personal portfolio and show that portfolio to any company and mention that portfolio on your resume and host that portfolio on free web hosting like Heroku or python anywhere if you want to learn how to host Django app on Heroku so here is a link:- 

https://webdevcodes.com/python/deploy-your-django-application-on-heroku/

Mention all your skills and write something about yourself on that portfolio and the most important thing is please download premium templates so that they look more impressive.


2) CRUD Based Application in Django (Basic Student Information App)

and the second one is a Basic student information application based on Django in which you can add, delete or update the data of students with pagination.

Source Code:- https://github.com/ShivamRohilllaa/students
![screencapture-studentsinform-herokuapp-2021-06-18-20_26_28](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqylqf81gzzut3wgxv78.png)
 
3) Blog Application in Django
and the third one is blog application, please create a blog application with multiple features like comment system, like and post views, companies like these types of application.

Example:- https://webdevcodes.com/

![screencapture-webdevcodes-2021-06-20-07_00_46](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcn9s0bfk79618s53pzg.png)
 

4) E-commerce Application in Django

and the fourth one is the Ecommerce application in Django, so that's the most important application, and most startup companies like these types of applications, if you build an e-commerce application in Django and mention this on your resume so no one can stop you to get a job as Django Developer.

5) E-learning Application in Django

and the last one is the E-learning application and that's the advanced application if you build this application and mention it in your resume so you can easily get a job as a Django Developer in any company and that project is a little bit advanced so here is the source code of e-learning project

Source Code:- https://github.com/ShivamRohilllaa/E-learning-Django- 

Shivam Rohilla | Python Developer

Thank You
#100DaysOfSwift: Day 4 and 5 
Tags: ios, swift, beginners
Published: 2021-06-20 01:55:56

Yesterday I completed day 4 but I got a bit sick and didn't have the energy to post on here. However,I went over loops! For, while, infinite and exiting loops with break and skipping over items with continue. 

Today, I halfway got through functions. I got up to writing throw functions. I have a few more sections left that I will go over tomorrow. One thing that Paul wrote was to take your time and thats what I have to remind myself to do. I feel myself about to rush through the material when I need to take my time like I did the previous days. 

Until tomorrow !