Skip to content

Instantly share code, notes, and snippets.


Carlos A. F. Santos calfersantos

View GitHub Profile
devjourney / CreateCosmosDbAuthTokenInPostman.js
Created August 31, 2018 23:58
Create an authorization token for CosmosDB in a Postman Pre-test Script
View CreateCosmosDbAuthTokenInPostman.js
var now = new Date().toUTCString();
pm.environment.set("utcDate", now);
var verb = 'GET';
var resourceType = pm.variables.get("resourceType");
var resourceId = pm.variables.get("resourceId");
var text = (verb || "").toLowerCase() + "\n" + (resourceType || "").toLowerCase() + "\n" + (resourceId || "") + "\n" + now.toLowerCase() + "\n" + "" + "\n";
var key = CryptoJS.enc.Base64.parse(pm.variables.get("masterKey"));
var signature = CryptoJS.HmacSHA256(text, key).toString(CryptoJS.enc.Base64);
adamotte / deezer-mp3-download.js
Created July 17, 2017 15:39
Download - stream a deezer song / playlist / album in 320kbps, for educational purposes only ;). Strongly inspired by
View deezer-mp3-download.js
const Promise = require("bluebird");
const request = require("request-promise");
const ID3Writer = require('browser-id3-writer');
const crypto = require('crypto');
const format = require('util').format;
const fs = require("fs");
const http = require('http');
let type = process.argv[2];
mganeko / parse_webm.js
Last active April 23, 2022 13:03
Parse Binary of WebM file with Node.js
View parse_webm.js
// This code parses binary format of WebM file.
// recognizes only some important TAGs
// Limitation:
// This programs reads all binary at once in memory (100MB).
// It is very bad imprementation, but it is still enough for some small WebM file.
// Usage:
// node parse_webm.js filename
threepointone /
Last active February 3, 2023 06:59
Notes on Durable Objects. Part 1 - Migrations.

Note: Since writing this, I've been pointed to some exciting new research/tooling called Project Cambria I'll likely have to rewrite this article taking that into account. Leaving this up for posterity's sake.

(This series isn't meant to be a primer/tutorial, though we might do something regarding it in the future. For official documentation and starters, see

Further - these are my personal views; I expect to be wrong about a lot of them. Indeed, I'm not paying much attention to presenting these well at the moment, simply writing down thoughts. As such, expect these writeups to change often, particularly as the platform takes shape. I'm also mostly a front end guy, so don't get mad if I get it very wrong. Give me feedback! Always happy to learn and make changes.)

Durable Objects are a fascinating new storage primitive from cloudflare for their workers platform. There's a lot of 'cool'

ipepe /
Last active March 29, 2023 02:20
Installing headless chrome on Ubuntu.
# from
# and
# and
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox
kevincennis /
Last active June 2, 2023 06:06
V8 Installation and d8 shell usage

Installing V8 on a Mac


  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)