teleren/devto huggingface dataset:
My Transition Into The World Tech.
Tags: beginners, programming
Published: 2022-04-18 02:26:35

Hi, I’m Chris, 

I’ve always enjoyed coding and have spent countless nights studying different programs in my spare time. I have also spent the last decade working jobs that are less than fulfilling :(. I thought I had found my purpose in truck driving until a terrible accident brought that career to a <u>screeching halt</u>. As a **father of 3** the show must go on.![A flexing Emoji](https://c.tenor.com/UGURug9mK6QAAAAM/sports-sportsmanias.gif "Hustle Harder!") I worked at a car wash until it shut down during the pandemic. It was during this time that I landed a job at the *Amazon Fulfilment Center*, my present employer. 

___
___


>While life is not short of its challenges, I am so grateful for the opportunity Amazon afforded me, to be able to join the [Flat Iron school](https://www.flatironschool.com). The chance to have a real career and create a future for my family is not a responsibility I take lightly.
___
___

I remember watching coding videos on YouTube for hours. Studying JavaScript and Python. It all seemed so unobtainable and terribly out of reach for me at the time, because I lacked direction.![A Traffic Sign Icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbhnopepet0is9en4asi.png)I can now see the light at the end of the tunnel. That light is filled with promise and a way to provide for my family in the best way possible. The future for me and my family is looking very bright indeed.![A Light Bulb With A Brain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rqwwd5gpn5pi6cmv50s.png)
Looking for feedback on an early-stage no-code backend product
Tags: nocode, programming, discuss, startup
Published: 2022-04-18 02:26:10

Hey all! I'm building [SheetBase](https://www.sheetbase.io?ref=devto), a platform for using Google Sheets (more planned in the future) as a scalable backend for no-code apps built in Webflow, Retool, Softr, etc. The goal here is for SheetBase to eventually be the go-to choice in managed no-code/low-code backends.

I'm in the pre-build stage currently, and I've only built a tiny POC (and will probably throw that code away anyway), so I'm looking for any feedback from any perspective.

Thanks so much in advance!
Commission Calculator
Tags: beginners, javascript, chartsjs
Published: 2022-04-18 01:37:29

![commission calculator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xez0fkyi84w0rgsqprmy.png)

These beautiful charts were created with [Chart.js](chartjs.org/docs/latest/charts/doughnut.html). [Chart.js](https://www.npmjs.com/package/chart.js) is easy to use and makes creating beautiful charts and graphs of all different types simply quick.

![configuration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pspz07nsn8w0oys4hlr.png)

Updating the charts dynamically is as easy as updating innerHTML. Everything gets updated and it's beautiful! I absolutely loved working with this. It definitely pushed me out of my comfort zone and ensured I knew how to organize my data as well as manipulate it in order to get the correct outputs I wanted to display. But, overall, it was a wonderful learning experience.

![update numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fio9b6b7c54p9p1d3hv.png)

![update chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3s28bwerndi6to7o1w7n.png)

Happy coding!
Organize a sua vida com Google Keep
Tags: braziliandevs, trans
Published: 2022-04-18 01:30:17

## Por que EU precisei me organizar?

Conforme mais tempo eu organizava comunidades e produzia conteúdo, mais ideias, projetos e prazos começaram a aparecer para mim.

No começo eu conseguia lidar bem com essas tarefas só organizando na minha cabeça, mas conforme elas foram aumentando, eu não conseguia mais. Então tive que buscar um aplicativo que me permitisse anotar as minhas tarefas, e organiza-las, e com isso, encontrei o [Google Keep](https://keep.google.com).

Então se você está passando pela mesma situação que eu passei, recomendo dar uma lida nesse artigo.

## O quê é o Google Keep

[Google Keep](https://keep.google.com) é uma plataforma do Google de anotações. Ele permite adicionar anotações em forma de cartões, como se fossem *post-it's* na sua tela.

![Captura de tela do Google Keep, mostrando a sua interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnu3ivcore96lfrk9925.jpg)

## Características do Google Keep

O Keep tem uma interface bem simples e direta, mostrando as suas tarefas na tela inicial, e nesse formato de *post-it's*  que eu pessoalmente gosto muito.

Também há a possibilidade de criar notas simples, com apenas um título e descrição, ou também notas com listas de tarefas (que é a função que eu mais utilizo).

Uma outra funcionalidade que eu gosto muito são os marcadores. Com esses marcadores podemos separar tarefas em categorias, como por exemplo "trabalho", "estudo", "lazer",etc.

O Keep tem outras diversas funcionalidades que poderiam ser abordadas aqui nesse artigo, mas, eu acho melhor você começar a usar, e descobrir se o Keep funciona bem para você organizar as suas tarefas!

## Finalização

Nesse artigo, te apresentei o [Google Keep](https://keep.google.com), e porque eu acho uma plataforma tão boa para organizar as suas tarefas.

Muito obrigada por ler ❤️🏳️‍⚧️ e me segue nas redes, é tudo [@lissatransborda](https://twitter.com/lissatransborda) 👀
Easiest Way to Deploy HuggingFace Transformers
Tags: webdev, beginners, machinelearning, nlp
Published: 2022-04-18 01:28:58

You must know transformers. Well, I don’t mean autobots, Bumble Bee, but the famous machine learning structure.
You probably have used the huggingface transformers models. But have you ever deployed them?

With [Pinferencia](https://github.com/underneathall/pinferencia), just add three more lines and your model goes online!

> Never heard of [Pinferencia](https://github.com/underneathall/pinferencia)? It’s not late. Go to its [GitHub](https://github.com/underneathall/pinferencia) to take a look. Don’t forget to give it a star if you like it.

---


![codes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f24dqznx252mqte2mtl.jpg)

## HuggingFace transformer pipeline

How do you use HuggingFace transformer pipeline?

```python
from transformers import pipeline

vision_classifier = pipeline(task="image-classification")


def predict(data):
    return vision_classifier(images=data)
```

![hfimg](https://cdn.pixabay.com/photo/2018/08/12/16/59/parrot-3601194_1280.jpg)

And you can predict a image with its url:

```python
predict("https://cdn.pixabay.com/photo/2018/08/12/16/59/parrot-3601194_1280.jpg")
```

Result:

```python
[[{'score': 0.9489120244979858, 'label': 'macaw'},
  {'score': 0.014800671488046646, 'label': 'broom'},
  {'score': 0.009150494821369648, 'label': 'swab, swob, mop'},
  {'score': 0.0018255198374390602, 'label': "plunger, plumber's helper"},
  {'score': 0.0017631321679800749,
   'label': 'African grey, African gray, Psittacus erithacus'}]]
```

## Deploy

Now deploy it with Pinferencia, just add three lines and save as `app.py`

```python
from transformers import pipeline
from pinferencia import Server

vision_classifier = pipeline(task="image-classification")


def predict(data):
    return vision_classifier(images=data)


service = Server()
service.register(model_name="vision", model=predict)
```

Now go to the terminal and run

```bash
uvicorn app:service --reload
```

Your service is online! Go to http://127.0.0.1:8000 and check out the API.
Now you can send a request:

```bash
curl --location --request POST 'http://127.0.0.1:8000/v1/models/vision/predict' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "data": "https://cdn.pixabay.com/photo/2018/08/12/16/59/parrot-3601194_1280.jpg"
    }'
```

The result:

```python
[[{'score': 0.9489120244979858, 'label': 'macaw'},
  {'score': 0.014800671488046646, 'label': 'broom'},
  {'score': 0.009150494821369648, 'label': 'swab, swob, mop'},
  {'score': 0.0018255198374390602, 'label': "plunger, plumber's helper"},
  {'score': 0.0017631321679800749,
   'label': 'African grey, African gray, Psittacus erithacus'}]]
```
Or just use the interactive UI Pinferencia provides:


![Predict](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r916dln2a5kwck7si2r7.jpg)


![Results](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gett9msv7ajyxdqoa53l.jpg)

Simple enough, huh?

---

If you like Pinferencia go https://github.com/underneathall/pinferencia/star and give it a star.
Interactive Cards
Tags: showdev, interactive, javascript
Published: 2022-04-18 01:25:47

I'm currently working on a new personal project and decided to give glassmorphic cards a looking into. Though what I found was very inspirational, I decided to go a different route for my approach. The result ended looking like so:

![my card](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu1ec4459wwta5kxv728.png)

For my card's design and functionality, I used [vanilla-tilt.js](https://www.npmjs.com/package/vanilla-tilt) - "a smooth 3D tilt javascript library forked from [Tilt.js (jQuery version)](https://github.com/gijsroge/tilt.js)"

![script](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs1u7hzz2smihphsx4mx.png)

![VailliaTilt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/faovhbyvlw6b3vd1fg6c.png)

I wanted a very nice shadow on the card and added such styles in my stylesheet:

![stylesheet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3aoudwfryix6zy5xb1cv.png)

I think having the word "RESULTS" on the side was a nice touch that gave the card more personality. With it being in the corner where there isn't much text overlapping, there is a very distinct look it gives off. I may think about making the word a shade lighter and make it a little more reflective in the future depending on how the rest of the card ends up looking when it gets populated.
 
![content stylesheet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6ykqjtqbujgek0vvkgf.png)

There are a lot more options from [vanilla-tilt](https://www.npmjs.com/package/vanilla-tilt) that I did not use:

![other options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcmbimveg7s91m00swfy.png)

What do you think? Always appreciate feedback

Happy coding!
Beginner Python Game: Connect Four
Tags: beginners, python, githunt
Published: 2022-04-18 01:06:00

As my second project, I wanted to try recreating a simple game to expand my knowledge on basic python.


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

The code here was mainly contained in a couple different functions that each controlled a different part of the game, such as a function to drop a piece into a column and a function to check for a winner.

[Link to Github](https://github.com/HaseebGarfinkel/Connect-Four)

As I am still a very new programmer, I would really appreciate any advice and tips you could give me in the comments. 

Thank you!
Automate Realm App Rebuilds
Tags: mongodb, realm, bash, tooling
Published: 2022-04-18 00:35:20

I'm currently developing a macOS/SwiftUI app that persists data with [Realm Database](https://realm.io) and [Realm Sync](https://www.mongodb.com/realm/mobile/sync). If you haven't used it before, Realm Sync is a magical service that keeps data in sync across devices and persists the data to a MongoDB Atlas cloud database through a BaaS (Backend-as-a-Service). I'm using it in my app because I want to use the same app on multiple devices, and have my data sync magically between the devices.

The great thing about Sync is that it doesn't require much code for developers to use. If you're already using Realm to store your data, using Realm Sync to share it across devices is *almost* as simple as [opening the database with a Sync configuration instead of a local configuration](https://www.mongodb.com/docs/realm/sdk/swift/examples/configure-and-open-a-realm/#open-a-synced-realm). There are a few more details to handle - some additional error handlers to write - but overall, it "just works" and handles [conflict resolution](https://www.mongodb.com/docs/realm/sync/learn/conflict-resolution/) and the hard parts of syncing data for you.

The less awesome part about Sync is the fact that there isn't a good path to migrate ["breaking" schema changes](https://www.mongodb.com/docs/realm/sync/data-model/update-schema/). The Realm Sync BaaS doesn't have a concept of a versioned schema, so making "breaking" schema changes requires jumping through hoops and you should generally try to avoid it.

One problem: while developing my very own Realm Sync app, I'm making breaking schema changes frequently. Probably every other day, if not more often, I realize I need a new property or something that is currently a required property has to be optional - or a different type - for Reasons. 

In order to deal with this during development, I'm just deleting my Realm App backend, deleting the database from MongoDB Atlas (which blows away all of my existing data - which is fine because I can't easily use it after making a breaking schema change), and creating a new Realm App. Then I have to configure the new Realm app's authentication, permissions, etc.

This is a bit of a pain, so I wrote my very first bash script to automate this process. The script itself is 17 lines - 2 of which are comments to help devs figure out what to put in one of the other lines. The [README](https://github.com/dacharyc/realm-development-tools/blob/main/rebuild-sync-app/README.md) is 361 lines. Can you tell I write documentation for a living?

If you're also developing Realm Sync applications, I hope you find this helpful!

The script is available on GitHub at [realm-development-tools/rebuild-sync-app](https://github.com/dacharyc/realm-development-tools/tree/main/rebuild-sync-app). PRs are welcome if you spot an issue or easy improvement. I'll add error handling someday, but have lost enough of my Sunday to this rabbit hole...
Bullet Impact Simulation Using Phaser and Matter
Tags: javascript, programming, gamedev, todayilearned
Published: 2022-04-18 00:28:03

Phaser JS is an open source JavaScript game framework for creating 2d HTML5 game. It is shipped with two physics engine: arcade and matter. While arcade is the one used in the official tutorial of phaser and relatively simple (collision, gravity, etc). Matter is a library of its own and can be used for more complex physics involving mass, density, force, friction, etc

Matter has its own [documentation](https://brm.io/matter-js/docs/), but also has a documentation on Phaser API docs. So understanding how to use it on Phaser is quite challenging for me as for some things you can use the docs at phaser, but for other things, such as the body module, I need to read the matter docs instead. After some struggle, I managed to create a simple simulation of two bodies colliding with a collision detector. I hope it can be helpful for those who want to try making something in phaser using matter engine

Source code with demo link:
https://github.com/RussianMartabak/matter-impact
The Cryptography In Cryptocurrency
Tags: web3, blockchain, bitcoin, ethereum
Published: 2022-04-18 00:12:45

First, I want to thank Patrick McCorry for making all of this knowledge available to myself and others.

Second, I'd like to assert that I'm writing from a Bitcoin and Ethereum paradigm, but these principles apply to most blockchains.

## Overview

We'll be looking at cryptography's role in cryptocurrency. Cryptography is not always used for data privacy. In cryptocurrency, it's used for protecting integrity, verifying transactions, and authenticating users- simply put, traceability. We won't be going over user authentication in this blog- but stay tuned!

## The Hash Function

Q: What is a cryptographic hash function?
A: A function that can be used to map data (preimages) of arbitrary size to fixed-size values (hashes). The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. Any change made to the preimage will result in a totally unique hash.

### Three Properties The Hash Function

1. Preimage Resistance
    - Given a hash (h), it should be difficult to find any preimage (p) such that h=hash(p). This property guarantees that the hash will give no clue as to what the preimage actually is.

2. Second Preimage Resistance
    - Given a preimage (p1), it should be difficult to find a different preimage (p2) such that hash(p1)=hash(p2). This property guarantees you can't change your mind after making a public commitment.

3. Collision Resistance
    - It should be difficult to find two different preimages (p1) (p2) such that hash(p1)==hash(p2). This is very similar to second preimage resistance except that collision resistance pertains to hash tables (maps), and second preimage resistance pertains to public commitments.

## The Chain In Blockchain

In Bitcoin and Ethereum, each block appended at the end of the blockchain has a block header that contains a hash of the previous block's header as a way of pointing to the block that came before it. This creates a weighted blockchain where the heaviest (longest) chain is considered to be the "real" blockchain.

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

## Verifying Transactions In The Blockchain

Each block header comes with a hash tree root that is a commitment to all transactions in the block (a hash of hashes of transactions).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25pa7m1s432jnedzjs2x.png)

Verifying that a transaction was confirmed in the blockchain is simply a matter of requesting information from a SPV (Simplified Payment Verification) client. The request to a SPV client carries with it the transaction we want to verify, the block id where the transaction is located, and a couple hashed transactions from the same block that will enable us to re-compute the hash tree root. If the re-computed hash tree root is equal to the original, then it's safe to say that this transaction was indeed verified and confirmed.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38wmopk3e878ay1h71tx.png)
The Tyranny of the Rocket Equation
Tags: adventofcode, algorithms, computerscience, programming
Published: 2022-04-17 23:57:48

## [Advent of Code 2019 Day 1](https://adventofcode.com/2019/day/1)

## Task: Solve for X where...
```
X = the sum of the fuel requirements
```

### Example input
```
12
14
1969
100756
```
It represents:
- The mass each module

## Part 1

### A written description of my working algorithm
```
Split the input at each newline character to generate an array of strings
Coerce each string to a number
For each number, accumulate a number - starting at 0
  Add to the accumulating number the sum of that number and the current number divided by 3, rounded down, and decremented by 2
Return the accumulated number
```

### A visual depiction of my working algorithm
![Algorithm visualization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wb8bxj0pz252hoxt4ts9.gif)

## Part 2

### A written description of my working algorithm
```
Sub-routine: Recursive Fuel
- Accept a number as input
If the number is less than or equal to 0
  Return 0
Else
  Return the sum of the input number and the number returned from calling this sub-routine with the number resulting from dividing the input number by 3, rounding down, and decrementing by 2

Split the input at each newline character to generate an array of strings
Coerce each string to a number
For each number, accumulate a number - starting at 0
  Add to the accumulating number the number returned from calling Recursive Fuel with the number resulting from dividing the current number by 3, rounding down, and decrementing by 2
Return the accumulated number
```

### A visual depiction of my working algorithm
![Algorithm visualization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sa3571dist18q336s6e.gif)

Reduction. Recursion. Ready for the next one.
Terminal-based Game - BlackJack
Tags: showdev, programming
Published: 2022-04-17 23:30:30


It's been a challanging few days but I've pushed through and completed this game. Recently, I began a program on Codecademy to build up my confidence as a programmer. Upon completing the first section of coursework, we were given a project to write a terminal-based game. I went with Blackjack and here is a sample of my game!


![Demo of terminal-based blackjack game](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1a5m4yd7ho5w359d60px.gif)

As explained in the readme on github, this program is a very standard version of blackjack. Players alternate turns, beginning with the main player and ending with the dealer. The player may hit or stand. If the player busts, the dealer immediately wins.
If the player manages to get blackjack they win or they'll have to outplay the dealer.

You can check out my code if you'd like at [my github repo](https://github.com/gbloom2010/terminal-based-game)

Hopefully, this won't be the last you hear from me!
See you all around!
Greg
OCAPI-Proxy v2.1.4
Tags: javascript, salesforce, node, middleware
Published: 2022-04-17 22:53:43

OCAPI-Proxy v2.1.4

https://www.npmjs.com/package/ocapi-proxy
https://github.com/johnfacey/ocapi-proxy

Description:

This project serves as a Node.js based proxy server that will forward requests to an Salesforce Commerce Cloud OCAPI instance. This can be used for purposes such as testing 3rd party apps using OCAPI as well as integration for mobile/browser apps. 

Feel free to use this as a middleware solution or build your own middleware on top of it for your needs.

Purpose: 

I have worked on many OCAPI projects and learned that this was a great way to test OCAPI calls as well a way to do more Node.js integrations with the Salesforce Platform.

![User Interface - OCAPI-Proxy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wppweo3vuo6h741kohgu.png)

Base Features include:

Proxying calls to an SFCC interface.
Auto generation of default config file on installation.
Configuration of Proxy(8080) and UI(80) ports default.
Universal Google Analytics tagging by config.json.
Extensive logging.
Sample Postman Suite included.
NPM deployable.


![Sample Postman Suite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pev2golyphp6cdmxokkk.png)


https://www.npmjs.com/package/ocapi-proxy
https://github.com/johnfacey/ocapi-proxy
Day 9: Writing is harder than I thought
Tags: productivity, journaling, day
Published: 2022-04-17 22:39:49

Hi!
writing is hard, probably why many don't write 
I finally started writing on my first guide/tutorial article and I made huge progress where I can't see any reason I would not publish it tomorrow But writing is so hard!! even harder than I thought it would be.
You spend like a day or two learning about a concept and since you will be making an article/teaching about that concept you are supposed to have at least a decent understanding about it and to really understand something it takes time
you then have to find a way to structure your article that it is easy to follow not looking like you were just throwing random words and you may understand something but to explain it especially orally take a lot of time. these adding refinements grammar checks, you end up spending another day on article of 4000 words which is unbelievable
I thought I could write an article a day (a serious one/ a tutorial one) but it is very time consuming especially when you are starting out. but I'm happy that I'm now on like 80% into finishing my first one and I can't wait to share it to with the world I noticed that I learned a lot especially diving into documentations trying to find resources I hope by the time I finish the first article I will be equipped with more tips to use when I start the second
Let's see how it will come along tomorrow

Signing off...