teleren/devto huggingface dataset:
13.5 ways of being better than everybody else!
Tags: misc, essay, rant, picture
Published: 2022-01-08 22:23:36

---
title: 13.5 ways of being better than everybody else!
published: true
date: 2022-01-08 22:16:07 UTC
tags: misc,essay,rant,picture
canonical_url: https://siderite.dev/blog/135-ways-of-being-better-than-everybody-else/
---

![You have to learn the rules of the game. And then you have to play better than anyone else. Albert Einstein.](https://siderite.dev/Posts/files/RulesOfTheGame_637772773749714792.jpeg) So you clicked on this post because you thought that:

- I was smart enough to know how to be better than anybody else
- I could summarize all the ways to become so
- I would generously share them with you
- You would understand what I am telling you in 3 minutes or whatever your attention span is now

While I appreciate the sentiment, no, I am not that smart, nor am I that stupid. There are no shortcuts. Just start thinking for yourself and explore the world with care and terror and hope, like the rest of us. And most of all, stop clicking on "N ways to..." links.
.zshrc/-zsh Flutter Installation (zsh: command not found: flutter)
Published: 2022-01-08 22:11:19

_These notes are for personal use, but feel free to use them if they are helpful to you._

This seems to be one of the easiest way to install flutter with .zshrc in terminal (Currently on macOS Monterey)

It also works if you received the following error:
zsh: command not found: flutter

```
So the correct way is to add to .zshrc by typing vim ~/.zshrc

PATH="$PATH:$HOME/Flutter/flutter/bin"

or

export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"

then run source ~/.zshrc or just open a new terminal window

```

[Original source from stackoverflow](https://stackoverflow.com/a/60550543/17875425)
The First Step
Tags: programming, python, angular, beginners
Published: 2022-01-08 22:00:39

Olá, Devs!

Há muito tempo venho pensando em escrever um pouco sobre a minha trajetória e aqui estou, rs.

Pensei em hoje iniciar escrevendo sobre a minha trajetória, mas preciso preparar um pouco minha cabeça e corpo ( I drank some cans of beer), mas dei meu primeiro passo; e por isso, não menos importante, quero deixar este passo registrado, depois de 2 anos procrastinando a publicar algo sobre minha trajetória, onde poderei ajudar as pessoas a chegarem onde querem, ou ao menos encurtar caminhos, mostrando o que seria prudente a se fazer, bem como o que não seria prudente.

Hoje, quero deixar uma coisa registrada além desse primeiro passo: **TODO PASSO É MOTIVO PARA CELEBRAR.**

Celebre com você mesmo, cada passo, cada conquista, cada barreira ultrapassada/quebrada. 

Você não está sozinho. Conte comigo.

Por hoje é só!

Um abraço a todos!

Ricardo Neves.
@ricardodcn
Why you should Code
Tags: beginners, productivity, codenewbie
Published: 2022-01-08 21:55:07

If this would be my first post then it is worth it for anyone who is giving up learning to code (especially to my friend Timi from his word "why should I code") 

Well, you should code based on the fact that...
>“Everybody in this country should learn to program a computer because it teaches you how to think.” From Steve Jobs

You should code because...
>“All of my friends who have younger siblings who are going to college or high school - my number one piece of advice is: You should learn how to program.” From Mark Zuckerberg

You should code because...
>"Coding is fun to solve puzzles, and sometimes it creates an opportunity for you and your generation from what you've created. That's the sense of purpose." From Fred Brooks

You should code because...
>"The process of coding programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." From Donald Knuth

You should code because...
> “Whether you want to uncover the secrets of the universe, or you just want to pursue a career in the 21st century, writing code is an essential skill to learn.” From Stephen Hawking

You should code for you...
 >“To be prepared for the demands of the 21st century—and to take advantage of its opportunities—it is essential that more of our students today learn basic coding skills, no matter what field of work they want to pursue." From Todd Park

You should code for...
>"Learning to code is something Africa youths need to dive into. It will help tackle unemployment and the digital skill gap. The new age of software is transforming society, writing codes no longer need a PhD and this is a high paying skill" From Strive Masiyiwa

You should code because 
>"Coding is the language of the future, learn it. Coding is fun, collaborative, and creative" From Reshma Saujani

Note this: You should code because...
>"Coding is like art combined together to make a beautiful stuff that could be of value" From me too you

What more reasons can you give to help him continue writing codes. This could help someone planning to give up ever writing codes.
New "What's Here" for Ruby Hash RDoc
Tags: ruby, hash, documentation
Published: 2022-01-08 21:53:47

---
title: New "What's Here" for Ruby Hash RDoc
published: true
description: 
tags: ruby, hash, documentation
---

As I wrote last week, I've been working on the Ruby documentation. This work includes 20 or so "What's Here" sections, for some of the more important classes and modules. Each is a collection of categorized 1-line descriptions of the methods.

Here's the one for Hash, which is new in 3.1: https://docs.ruby-lang.org/en/3.1/Hash.html#class-Hash-label-What-27s+Here.
Learn SQL: Microsoft SQL Server - Episode 15: Deleting records from a table
Tags: sql, learning, database, programming
Published: 2022-01-08 21:49:50

![Hello-Goran](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxdmfu39ewsvamwxyc9g.gif)

Time for the scariest segment of SQL query statements. As in the previous entry, we need to make sure that we are working with the correct data.

Continuing with our previous episode, we will be working in the **HumanResourcesDepartment** table. This is where we will be performing the delete operation, we will delete the row with the **DepartmentID** = 17. 

To construct a delete statement we need to use the following syntax.

```
delete from [table-name]
where [column-name] = value
```
>Notice how this allows us to wipe out the entire **HumanResourcesDepartment** table if we were to omit the **Where** clause.

![Delete-a-single-record](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2a2sc8y1u5dmd2qm5zz.gif)

We can use any Column-Name in the table to specify which row we want to delete. Generally using a _**key**_ would be safest for deleting a single record in a table.

<em>As a side-note...</em>We can also delete multiple rows simultaneously by specifying a column that has a value present in more than one record or row. For example in the `GroupName` with the value <u>'Executive General and Administration'</u>. If we pass in this value in our **Where** clause it will remove each row containing <u>'Executive General and Administration'</u> in it's `GroupName` column.

#### Be safe

To make this perfectly clear, we need to ensure the row or rows we want to delete are the values specified in the _Where clause_.

<strong>I personally would double-check the row or rows I need to delete by using a Select statement.</strong>

```
Select * from [Table-Name]
Where [column-name] = [value]
```

By using this statement before we perform our delete operation we can confirm that we are working with the correct data.

![select-statement-check-before-delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pw6xygk8h6ask1hfbj8f.gif)

Always make sure you are working with the correct data and never perform a **Delete** operation without a _Where clause_.

Thats all from me, I hope you enjoyed this episode and look forward to the next and final entry on **Learn SQL**.

![relax-man](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vdeaxbsfv994vby89e9n.gif)
Velo by Wix: Query selector for child elements

Tags: wix, velo, javascript
Published: 2022-01-08 21:27:39


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rauqil2tuhytziyixki7.jpg)

_Get the child elements inside a parent node. In this post, we take a look deeper at $w() selector and try to filter children elements by the specific parent node_

Let's suppose we have a few containers with checkboxes in each of them. We don't know how many checkboxes will be in each container at the final design.

Each container has a "select all" named checkbox that allows us to check on/off all checkboxes into a current target container.

We want to provide a good abstract solution for avoiding hard coding of elements' ID. And ensure scaling for any count of the elements in the future.


![Wix Editor - Example of two groups with checkboxes
](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nb25nfhot8qgfqhv2kq9.jpg)

In general, we need to find a way to query select all child elements into a specific parent node. There are exist similar selectors in DOM and CSS.

**More: [Blog Post](https://shoonia.site/velo-query-selector-for-child-elements)**
The EndGame - Fakerjs
Tags: discuss, javascript, fakerjs, opensource
Published: 2022-01-08 20:53:22

About Four (4) Days Ago, the Author of [Fakerjs](https://github.com/marak/Faker.js/) a popular JavaScript library with more than 2 million weekly Download from [NPM](https://www.npmjs.com/package/faker) Deleted the repository and replaced it with one that only has the modified ReadMe **"What really happened with Aaron Swartz?"** and no content, and pushed an empty package to npm as the latest version (6.6.6). 

The name of the new commit is called **ENDGAME** 


## Why I Think He Did It 

[**Marak**](https://marak.com) develops this very useful tool and gives it away for free, receives praise but no money. After realising that there is no money in giving stuff for free with no further plan down the road, gets cranky as others are not giving Marak free services and don't accept applause as a payment method,And says that someone needs to pay for it or take over the development. Declares that will no longer do free work for corporations, but corporations seems to be unimpressed that the free worker will no longer work.

Since no one seems to be interested to pay for work offered for free, Marak launches SaaS of the tool as **[fakercloud.com](https://fakercloud.com)** (Now offline due to hosting renewal), which is a popular strategy and sometime can actually work.

Unfortunately, according to Marak, engineers from Retool copy the SaaS platform and launch it as a part of Retool. Marak realising what has happened offers the CEO of Retool to sell the fakercloud.com to them. The CEO ghosts Marak, maybe because doesn't want give evidence for a lawsuit or maybe doesn't see the point of purchasing a product that the internal engineers already build.

He Wrote A blog Post [About it](https://marak.com/blog/2021-04-25-monetizing-open-source-is-problematic) 
you can read it here since his blog is down 
[https://web.archive.org/web/20210516172305/https://marak.com/blog/2021-04-25-monetizing-open-source-is-problematic](https://web.archive.org/web/20210516172305/https://marak.com/blog/2021-04-25-monetizing-open-source-is-problematic)

As a result, Marak gets angry and deletes everything and posts conspiracy theory memes and links everywhere. As this tool is a popular one and people depend on it, NPM suspends Marak's account and continues to provide latest working version that Marak gave them for free.

## What Impact Does This Have To The Opensource ?

leave a comment below 

crawled from [here](https://news.ycombinator.com/item?id=29837473)

Want Contribute to Marak, Here is his [open collective for faker](https://opencollective.com/fakerjs)
Seat Selection of a Movie Theater 🎥
Tags: javascript, webdev, css, html
Published: 2022-01-08 20:23:26

In this project I am creating a seat selector UI for a movie theater. We will have a dropdown picker to select a movie, a legend to display if a seat is vacant, selected, or already reserved, a drawing of a theater and also some text to display the number of seats selected by the user and the total cost of the tickets.👓

**<u>Project Requirements🚩</u>** 
- Select the movie choices and seats in a theater in order to purchase tickets.🎫
- Display UI with movie select, screen, seats, legend & seat info.🖥️
- User can select a movie/price.💸
- User can select/deselect seats..💺✔️
- User can not select occupied seats. 🈯
- Number of seats and price will update.🆕
- Save seats, movie and price to local storage so that UI is still populated on refresh.👀

## Source Code 👇
Github ➡️ https://github.com/itsahsanmangal/Tickets-for-Movie-Theater

## Deploy 👇
Netlify ➡️ https://stoic-jang-c6ed81.netlify.app/
Simple way to do device fingerprinting
Tags: javascript, security
Published: 2022-01-08 20:21:25

Device fingerprint is a unique identifier for a specific device the most common uses for it are fraud detection and user validation.

There is no clear way to get this unique identifier instead, we will try to generate a string out of some information collected from the user.

Fingerprinting can be on the client-side (browser) or on the backend, we will do the backend way because it doesn't limit us by the user device or the features enabled on it.

You can use a lot of parameters to generate this identifier, in my case I'm trying to detect if the user is trying to log in from a different device or browser to the same account, for this simple case I will use a combination of IP address, user agent and params(credentials + CSRF token)

You can add more parameters to this combination like cookies or other headers.

I used here md5 as a hashing algorithm to generate the fingerprint but you can use a different one.


```javascript
const md5 = require('crypto-js/md5')
const requestIp = require('request-ip');

const ip = requestIp.getClientIp(req);
const useragent = req.headers['user-agent'];
const params = request.body;
const fingerprint = md5(ip + useragent + JSON.stringify(params)).toString();
```
Comparing frontend libraries
Tags: javascript, react, angular, vue
Published: 2022-01-08 19:53:52

I just want to highlight two great services. They provide some very interesting statistics which might help you to choose a library among competitions. If you haven't seen yet go check it out:

https://www.npmtrends.com/:
![npmtrends compare angular vue react svelte](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/navsonx5f0vflmnokiaj.png)



https://openbase.com/:
![openbase vue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zpzp8c4ajqtow13vpsy.png)
Import database to docker with terminal
Tags: linux, docker, sql, database
Published: 2022-01-08 19:33:04

Hey, this is Mohammad Hassani :smiley:

if you are developing with Linux and wanna import database to docker with terminal you can use this tutorial...

###It's just 4 steps

#1) copy database to _data folder:
first of all you should copy your .sql file to `var/lib/docker/volumes/blog_blogmysql/_data`

in terminal:
```bash
cp DATABASE.sql var/lib/docker/volumes/blog_blogmysql/_data
```
// Replace DATABASE to your database file name

#2) execute docker
now your database is ready to import, in this step execute docker in terminal,
(docker desktop is not supported in Linux but you can install [dockstation](https://dockstation.io/) for Linux, they are similar. and then you can execute there)

also in terminal:
```bash
docker exec -it CONTAINERNAME bash
```
// Replace CONTAINERNAME to your container name like `site_mysql_1`

#3) Bring up mysql
now open mysql in terminal:
```bash
mysql -uroot -p DATABASENAME
```

- if you dont have database in container you can use
```bash
mysql -uroot -p
```
and then:
```bash
CREATE DATABASE DATABASENAME;
```
// Replace DATABASENAME to your database name

#4) source .sql file
ok! everything is set now and ready to go...
in terminal:
```bash
source var/lib/mysql/DATABASE.sql
```
it maybe take some time depends on your .sql file size and your computer.

## better way
- you can use this code instead of step 3 and 4:
```bash
mysql --init-command="set autocommit=0" DATABASENAME < var/lib/mysql/DATABASE.sql
``` 
that's it!

_if you have another way, leave a message :)_

Be happy! ;)

<a href="https://www.buymeacoffee.com/mohammadhassani"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--epLLqT_x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gn0quro9llouuhzkxbj.png" alt="buy me a coffee" loading="lazy" width="170" height="37"></a>
🤓 What Would You Add to this Discord Server?
Tags: discuss, beginners, opensource, startup
Published: 2022-01-08 19:05:56

We just created a discord server and we need to know what you think about it. Please leave comments about what we should add, get rid of, and what you would want the server to become!

[See the Server Here](https://discord.gg/r2JnDXvrWt)
Simple Reading of JSON file in Golang.
Tags: go, webdev, beginners, tutorial
Published: 2022-01-08 19:02:57

Hi,

Today I am going to write simple tutorial about reading file in Golang.

Let's say you want to read json file, you can read using golang [os ReadFile](https://pkg.go.dev/os#ReadFile).

The json file we are reading is same as in our golang code file.

``user.json``

```json
{
    "id": "0000001",
    "name": "user",
    "email": "user.email.com",
    "phoneNumber": "+0001"
}
```

``main.go``

```golang
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"log"
	"os"
)

// User is sample object
type User struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Email       string `json:"email"`
	PhoneNumber string `json:"phoneNumber"`
}

func main() {
	// provide the file path to read from
	b, err := os.ReadFile("user.json")
	if err != nil {
		log.Fatalf("Failed to read file: %v\n", err)
	}

	// where to store the file contents
	var u User
	json.NewDecoder(bytes.NewBuffer(b)).Decode(&u)

	// printing the file contents or use it for
        // other purposes.
	fmt.Printf("%#v", u)
}

```

This way can de-serialize to our native Golang types and use them like passing it other functions or doing some computation on it.

Thank you.
10-Second Scrabble Game.py
Tags: python, beginners, codenewbie
Published: 2022-01-08 19:02:10

Hey y'all. This would be my first post here and the first program I've ever made without having my hand held, which was a first for me and also quite nice.
I made this program as a project submission for Codeacademy. They provided me with suggested projects, but I had this idea for a quick-time scrabble game for a while and I figured out how to make one using the knowledge that Codeacademy taught me. I was very ecstatic about this little project from the beginning to the end, and I'm happy to say that I enjoyed writing this program far more than whatever I had to work on as an undergrad. 

This program is quite ugly, but the purpose of it is to run a terminal game that provides the player with 7 random letters. The player will have 10 seconds to type out as many words as they can using only the letters provided. The letters will accumulate points and the player also has the chance to re-scramble the list if they had an unlucky first draw. 
 
The github link is: https://github.com/danielm799/10-Second-Scrabble-Game
Visual Design - Week 1 Review
Tags: design, uiweekly, beginners
Published: 2022-01-08 18:33:04

Hello, hello, hello ! I'm taking a pivot from coding and taking a free visual design course to learn more about UI design. The free course I am taking is through [pathunbound](https://www.pathunbound.com/school-of-design/)Check it out! 

_Goal: To blog at the end of each week as a review._ 
_
**Week 1:Visual Design Tools - Starting with Figma!**

Visual Design improves a digital product by focusing on images, typography, layout, and color allowing the user to easily navigate the product. The overall design should be based on the user's needs. 

**Figma **

Frames are art boards with preset dimensions of a desktop, different models of iPhones and Androids. You can create your own frame and set your own dimensions as well. 

Effects consist of a drop shadow, inner shadow, layer blur, and background blur. Layer Blur affects the layer you have selected like an image and you can set the level of blur. Background blur affects what is directly behind a shape and not the layer. 

Components are used to create a shape that you will displayed multiple times on an app or website. An example would be a button that will be used in several places. Creating a component and using it instances will make it easier if there needs to be a change made to all of them. The change will be made to the component and all of its instances will update. You can create different components(example, different versions of a button) and use a slash naming scheme (button/small/secondary/icon/disabled/). All the button components can be selected and combined into a variant.  

Variants(Component sets)
Steps to create a variant:
1. Create a shape
2. Add properties to it
3. Name it using the slash naming scheme: button/checked/small/
4. Click the component button
5. Create a variant from the right panel 
6. Select the new variant and rename
7. Rename the property to describe the variant options 

Example, state(property), unchecked(variant), checked(variant). You are allowed to toggle between the two variants.

Vectors allow you to see all the nodes on a shape or text so you can make more detailed adjustments. CMD + E allows you to see the vector. 

Boolean Operators are four formulas used to combine shapes. Intersect only includes what overlaps, exclude doesn't include what overlaps on both sides, union doesn't include the center that overlaps and subtract only shows the bottom layer of the two shapes combined. 

Until next time!
Unified component structure for my EmberJS projects
Tags: ember, javascript
Published: 2022-01-08 18:32:15

Long living projects often times have a lot of experimental "styles" or "techniques" or even just "ad-hoc structure" in them. My projects are no exception.

Today I decided that I will force an unified structure for all the component files within said projects. My (currently) preferred way of nesting folders/files is: `components/foo/bar/baz/index.{js,hbs}`.

It requires `ruby` on your environment and setting `COMPONENT_DIRECTORY` variable. Hope this might help someone.

```ruby
#!/usr/bin/env ruby
#
# Unifies component structure
#  - components/foo.hbs -> components/foo/index.hbs
#  - components/foo.js -> components/foo/index.js
#  - components/bar/template.hbs -> components/bar/index.hbs
#  - components/bar/component.js -> components/bar/index.js

COMPONENT_DIRECTORY='../your/app/or/addon/directory'

Dir.chdir(COMPONENT_DIRECTORY)

Dir.glob('./components/**/*.{hbs,js}').each do |entry|
  matches = %r{(.*)\/(.*)\.(hbs|js)$}.match(entry)
  next if matches[2] == 'index'

  is_weird_syntax = ((matches[2] == 'template') || (matches[2] == 'component'))

  new_folder = if is_weird_syntax
                 matches[1]
               else
                 File.join(matches[1], matches[2])
               end

  Dir.mkdir(new_folder) unless File.exist?(new_folder)
  new_file = File.join(new_folder, "index.#{matches[3]}")
  File.rename(entry, new_file)
  puts "#{entry} => #{new_file}"
end
```

-----

Photo by <a href="https://unsplash.com/@ronaldordeoliveira?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Ronaldo de Oliveira</a> on <a href="https://unsplash.com/s/photos/rake?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>