Skip to content

Instantly share code, notes, and snippets.

View jaspreetsidhu's full-sized avatar
🎯
Focusing

Jaspreet jaspreetsidhu

🎯
Focusing
View GitHub Profile
@qntmpkts
qntmpkts / .bashrc
Last active October 13, 2023 20:14
For use on ChromeOS with zsh and oh-my-zsh installed
# /etc/skel/.bashrc
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
exec /usr/local/bin/zsh
@zcaceres
zcaceres / Sequelize-Step-by-Step.md
Last active February 22, 2023 12:53
Let's get an overview of Sequelize!

Sequelize: Step-By-Step

Sequelize is a powerful library in Javascript that makes it easy to manage a SQL database. Sequelize can layer over different protocols, but here we'll use PostgreSQL. At its core, Sequelize is an Object-Relational Mapper – meaning that it maps an object syntax onto our database schemas. Sequelize uses Node.JS and Javascript's object syntax to accomplish its mapping.

Under the hood, Sequelize used with PostgreSQL is several layers removed from our actual database:

  1. First, we write our Sequelize, using Javascript objects to mimic the structure of our database tables.
  2. Sequelize creates a SQL string and passes it to a lower-level library called pg (PostgreSQL).
  3. pg connects to your PostgreSQL database and queries it or transforms its data.
  4. pg passes the data back to Sequelize, which parses and returns that data as a Javascript object.
@ndarville
ndarville / README.md
Last active May 1, 2024 12:28
From CSV to HTML table (Simple)

This code generates an HTML table based from a CSV file. This is from the tutorial by Christophe Viau.

In trying his code example, I discovered that the code doesn't work as-is, so I figured others might like to see a working d3.js example that did not rely on a pre-existing container HTML element.

The code remains the same except for some cosmetic tweaks.

The task of writing the CSS is left as an exercise for the reader.