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 / settings.json
Last active November 10, 2023 14:28
VSCode Settings
{
// Editor Configurations
"editor.fontSize": 12,
"editor.fontFamily": "Fira Code",
"editor.rulers": [100,130],
"editor.tabSize": 2,
"editor.parameterHints.enabled": false,
"editor.renderLineHighlight": "gutter",
"editor.lineHeight": 26,
"editor.suggestSelection": "first",
import { useCalendar } from '@h6s/calendar';
import { useMachine } from '@xstate/react';
import { Button as AriaButton } from 'ariakit/button';
import clsx from 'clsx';
import { isSunday, isSameDay, addMonths, isFuture, isPast, setDate } from 'date-fns';
import format from 'date-fns/format';
import isWithinInterval from 'date-fns/isWithinInterval';
import { FC, useCallback, useMemo } from 'react';
import Select from '@components/forms/components/Select';
@jjcodes78
jjcodes78 / docker-compose.yml
Created April 24, 2022 06:27
Grafana Stack (Grafana + Prometheus + Loki + Promtail + Node Exporter)
version: '3.8'
networks:
monitoring:
driver: bridge
volumes:
prometheus_data: {}
services:
@ansaso
ansaso / google_calendar_color_map.md
Last active April 29, 2024 14:59
google calendar color mapping. name (string) to id (integer).

intro

As of 2020-07-27 The default google calendar api response does not include the user visible names:

google calendar color choice.

Below is a json map for all the default colors. Please note:

  • colorId empty for event with default color
  • different colorId for the same color in Calendar and Event (ex. Tomato: 11 and 3)
  • there is no consistent logic in the enumeration of the colors
@pgrimaud
pgrimaud / encrypt.php
Last active August 4, 2025 13:18
Instagram enc_password generator
<?php
$data = file_get_contents('https://www.instagram.com/data/shared_data/');
$json = json_decode($data);
$password = 'password'; //fuck-itdoesntwork;
$publicKey = '8dd9aad29d9a614c338cff479f850d3ec57c525c33b3f702ab65e9e057fc087e';// $json->encryption->public_key;
$keyId = 154; //$json->encryption->key_id;
$version = 10; //$json->encryption->version;
server {
server_name testdeploy.rocketseat.com.br;
location / {
proxy_pass http://127.0.0.1:3333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@sgreben
sgreben / apk flags.md
Created April 13, 2018 13:09
apk flags

apk

apk-tools 2.8.2, compiled for x86_64.

usage: apk COMMAND [-h|--help] [-p|--root DIR] [-X|--repository REPO] [-q|--quiet] [-v|--verbose] [-i|--interactive] [-V|--version] [-f|--force]
           [--force-binary-stdout] [--force-broken-world] [--force-non-repository] [--force-old-apk] [--force-overwrite] [--force-refresh] [-U|--update-cache]
           [--progress] [--progress-fd FD] [--no-progress] [--purge] [--allow-untrusted] [--wait TIME] [--keys-dir KEYSDIR] [--repositories-file REPOFILE]
           [--no-network] [--no-cache] [--cache-dir CACHEDIR] [--arch ARCH] [--print-arch] [ARGS]...
@DiegoPinho
DiegoPinho / nodemailer.js
Created February 6, 2018 16:31
Enviando e-mail usando Node.js
'use strict';
const nodemailer = require('nodemailer');
// Generate test SMTP service account from ethereal.email
// Only needed if you don't have a real mail account for testing
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: 'smtp.ethereal.email',
@keithweaver
keithweaver / s3-file-upload.js
Last active August 21, 2024 13:31
S3 File Upload to AWS S3
const AWS = require('aws-sdk');
const Busboy = require('busboy');
const BUCKET_NAME = '';
const IAM_USER_KEY = '';
const IAM_USER_SECRET = '';
function uploadToS3(file) {
let s3bucket = new AWS.S3({
accessKeyId: IAM_USER_KEY,
@rjz
rjz / crypto-aes-256-gcm-demo.js
Last active July 23, 2025 11:23
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) => {
// The `iv` for a given key must be globally unique to prevent