Skip to content

Instantly share code, notes, and snippets.

View arieljannai's full-sized avatar

Ariel Jannai arieljannai

View GitHub Profile
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active April 18, 2024 21:00
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@hofmannsven
hofmannsven / README.md
Last active April 19, 2024 13:17
Git CLI Cheatsheet
@amberj
amberj / setup-local-replit.sh
Created March 14, 2013 23:30
A bash script to automate the installation/setup of repl.it on local system.
#!/bin/bash
#
## @file setup-local-replit.sh
## @author Amber Jain
## @section DESCRIPTION A bash script to automate the installation/setup of repl.it on local system
## @section LICENSE ISC
#################
# Documentation #
@millermedeiros
millermedeiros / example.js
Last active September 10, 2022 03:06
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
@peterjmit
peterjmit / benchmark.sh
Created October 10, 2012 10:49
Bash Benchmark Script (using time)
#!/bin/bash
# REQUIRES SUDO
# Benchmark runner
repeats=20
output_file='benchmark_results.csv'
command_to_run='echo 1'
run_tests() {
# --------------------------------------------------------------------------