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 / js-crypto-libraries.md
Created April 1, 2018 23:14 — forked from jo/js-crypto-libraries.md
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@diegoazh
diegoazh / api.js
Created November 11, 2018 22:47
Api client how a proxy between vue and loopback
// Creé esta clase para no tener que hacer un objeto `api-client` donde repitamos código de axios, ya que los verbos
// http siempre son los mismos, y lo único que cambia son los endpoints y los métodos utilizados después.
/* eslint-disable no-underscore-dangle */
import axios from 'axios';
import base from '../utils/uri-base';
class Api {
constructor() {
this._base = base;
@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
@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 / 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 / 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

@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 / 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 / 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