Skip to content

Instantly share code, notes, and snippets.

View diegoazh's full-sized avatar
😁
I may be slow to respond.

Diego A. Zapata Häntsch diegoazh

😁
I may be slow to respond.
View GitHub Profile
@diegoazh
diegoazh / bash-colors.md
Created May 30, 2022 19:28 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@diegoazh
diegoazh / Include-in-Sequelize.md
Created March 25, 2022 17:25 — forked from zcaceres/Include-in-Sequelize.md
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@diegoazh
diegoazh / countries.json
Created February 26, 2021 22:21 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@diegoazh
diegoazh / installing-postman.md
Created September 14, 2020 10:25 — forked from ba11b0y/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@diegoazh
diegoazh / Install_robo3t_Ubuntu.md
Created September 11, 2020 11:23 — forked from abdallahokasha/Install_robo3t_Ubuntu.md
Install Robo3t on Ubuntu18.04 and make a desktop icon for it

Install Robo3t On Ubuntu 18.04

Download the package form Robo3t or using wget
wget https://download.robomongo.org/1.2.1/linux/robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
Extract here using

tar -xvzf robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@diegoazh
diegoazh / dynamic.yaml
Created May 14, 2020 19:44 — forked from Mau5Machine/dynamic.yaml
Traefik Dynamic Configuration File
## Setting up the middleware for redirect to https ##
http:
middlewares:
redirect:
redirectScheme:
scheme: https
@diegoazh
diegoazh / docker-compose.yml
Created May 14, 2020 19:44 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@diegoazh
diegoazh / yarn_with_wercker_build.yml
Created May 19, 2019 20:48 — forked from devillecodes/yarn_with_wercker_build.yml
yarn with wercker - build step
build:
steps:
- script:
name: install yarn
code: npm install -g yarn
- script:
name: report yarn version
code: yarn --version
- script:
name: set yarn cache