Skip to content

Instantly share code, notes, and snippets.

View sgmonda's full-sized avatar

Sergio Garcia Mondaray sgmonda

View GitHub Profile
@sgmonda
sgmonda / iconmaker.sh
Last active February 23, 2021 06:46
Simple script to convert SVG images into PNGs tinted as white
#!/bin/bash
# Converts provided SVGs into PNGs tinted as white
# Usage:
# $ ./iconmaker.sh in/directory/ out/directory/
IN_DIR=$1
OUT_DIR=$2
TMP_DIR=/tmp
@sgmonda
sgmonda / promiseRunnerExample.js
Last active January 31, 2020 09:55
Promise runner example for sgmonda.com
// Usage: $ node promiseRunnerExample.js <mode>
// Where <mode> can be one of the following: 'serie', 'parallel', 'parallelLimit'
const numbers = Array(50).fill(1).map((_, index) => index);
const getNumber = (num) => new Promise((resolve) => {
const delay = Math.random() * 1000;
const fun = () => resolve(num);
setTimeout(() => {
process.stdout.write(`${num}, `);
@sgmonda
sgmonda / code-print.tex
Last active April 3, 2021 00:29
Simple LaTeX template to print beautiful black&white Javascript source code
\documentclass[a4paper, 12pt]{article}
\usepackage[letterpaper, margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{beramono}
\usepackage{listings}
\usepackage{xcolor}
\newcommand\realnumberstyle[1]{}