Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# prereq: ffmpeg and some video files
# https://gist.github.com/jsturgis/3b19447b304616f18657
# one-liner infinite loop from
# https://stackoverflow.com/questions/1289026/syntax-for-a-single-line-bash-infinite-while-loop
while true; do ffmpeg -i some_video_file.mp4 -c:v libx265 -preset placebo -f null /dev/null; sleep 2; done
@tonysan
tonysan / headless.md
Created May 16, 2016 09:00 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

#If you're on Ubuntu or working with a Linux VM...

Step 1: Install the Ubuntu dependencies needed:

SSH into your server as a root or do sudo -i.

Then install necessary software:

apt-get update
@tonysan
tonysan / bitwise-hacks.js
Last active March 12, 2019 05:57 — forked from leodutra/bitwise-hacks.js
Fast Int Math + Bitwise Hacks For JavaScript
// http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
// http://jsperf.com/bitwise-vs-math-object
// http://united-coders.com/christian-harms/results-for-game-for-forfeits-and-the-winner-is/
// https://mudcu.be/journal/2011/11/bitwise-gems-and-other-optimizations/
// https://dreaminginjavascript.wordpress.com/2009/02/09/bitwise-byte-foolish/
// http://jsperf.com/math-min-max-vs-ternary-vs-if/24
"use strict";
var PI = Math.PI;