Skip to content

Instantly share code, notes, and snippets.

@robrant
robrant / dumpall.j2
Created November 7, 2016 13:56
Ansible play for debugging a whole load of useful variables. Might be an issue with one of the template filters on 2.2
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}
GROUP NAMES Variables ("group_names"):
--------------------------------
@bs1180
bs1180 / form.js
Last active September 4, 2015 14:02
Dynamic forms in redux-form
export default class FormWrapper {
render () {
const Form = makeForm(['name', 'age', 'sex']);
return (
<div>
<Form />
</div>
@martin-hewitt
martin-hewitt / gist:2e022bba0775c8ac1e39
Created January 20, 2015 10:55
Docker Stack - Ghost, piwik & ownCloud under SSL'd nginx
# Get a server, somehow. Mine runs CentOS 7
# All commands to be run as root, so either sudo su, or add sudo to each one
# Install Docker
yum install docker
# This nginx proxy listens to the main Docker socket for containers starting
# and stopping. It then reads the VIRTUAL_HOST environment variable for that
# container and creates a proxy route for each one. Containers without a
# VIRTUAL_HOST environment variable will be ignored. This fork also allows
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@froots
froots / example.js
Created November 1, 2012 08:29
console.log during an Underscore.js chain()
_.chain(myData)
.flatten()
.log()
.reverse()
.log()
.filter(function(item) { return item.active; })
.value();
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
Around methods:
method_missing, method_added, singleton_method_added, method_removed, singleton_method_removed, method_undefined, singleton_method_undefined
Around classes and modules
inherited, append_features, included, extend_object, extended, initialize_copy, const_missing
Marshaling
marshal_dump, marshal_load
Numbers
coerce, induced_from