Skip to content

Instantly share code, notes, and snippets.

@mauvm
mauvm / gist:5de07085f3b51e117378
Created July 26, 2015 11:57
An "envsubst" alternative for replacing env variables in NGinX site configurations (for using it with Docker)
#!/bin/bash
# NOTE: Brackets are not supported and '$' in values will break the script.
mkdir /etc/nginx/sites-enabled 2> /dev/null
for file in /etc/nginx/sites-available/*.conf
do
TPL=$(cat $file)
for row in $(env)
do
@jcpst
jcpst / mh.zsh-theme
Created August 19, 2015 17:31
Oh My ZSH prompt with git/node/docker-machine awareness
# mh theme
# Modified by Joseph Post
# features:
# path is autoshortened to ~25 characters
# displays git status, short SHA, and clean/dirty
# displays node/npm versions
# displays docker machine name if active.
# prompt
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@NeuroWinter
NeuroWinter / ffmpeg cheatsheet for glitching
Last active March 19, 2025 17:29
ffmpeg cheatsheet for glitching
FFMPEG '-i', file, '-c:v', 'libopenjpeg', "jpeg2000\\" + name + ".jp2"\
Convert image to jpeg2000
ffmpeg -i in.png -c:v libopenjpeg out.jp2
Hex Edit out.jp2
ffmpeg -i in.jp2 -c:v png out.png
General Edit
ffmpeg -i input.avi -c:v mpeg2video -g 999 -q:v 1 output.avi
*edit in avidemux/whatever*
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active March 24, 2025 21:56
Hyperlinks in Terminal Emulators