Skip to content

Instantly share code, notes, and snippets.

View jdgabriel's full-sized avatar
👋
console.log("Hello World")

Gabriel Duarte jdgabriel

👋
console.log("Hello World")
View GitHub Profile
@jdgabriel
jdgabriel / .zshrc
Last active August 20, 2024 19:11 — forked from callumlocke/.zshrc
ZSH function to auto-switch to correct Node version
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
#Add .NET to $PATH
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
@jdgabriel
jdgabriel / index.js
Created August 24, 2023 18:12 — forked from LindaLawton/index.js
Example for downloading a file from google drive api using Node.js
// npm install googleapis@105 @google-cloud/local-auth@2.1.0 --save
const fs = require('fs');
const fsp = fs.promises;
const path = require('path');
const process = require('process');
const {authenticate} = require('@google-cloud/local-auth');
const {google} = require('googleapis');
@jdgabriel
jdgabriel / crypto-aes-256-gcm-demo.js
Created June 23, 2020 20:17 — forked from rjz/crypto-aes-256-gcm-demo.js
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// Hint: the `iv` should be unique (but not necessarily random).