Skip to content

Instantly share code, notes, and snippets.

@creaktive
creaktive / TerminusBold.dfont
Last active January 6, 2019 13:09
Terminus Powerline for Mac OS X
@SlexAxton
SlexAxton / .zshrc
Last active March 24, 2025 17:35
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
@rob-b
rob-b / gist:3992928
Created November 1, 2012 10:22
git-vary
> cat ~/.bin/git-vary
#!/bin/sh
(
set -e
target=$1
git log --oneline --graph --decorate $(git merge-base $target HEAD)^.. $target HEAD
)
> git checkout some_branch && git vary master
@igrigorik
igrigorik / gist:3148848
Created July 20, 2012 05:24
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@phred
phred / pedantically_commented_playbook.yml
Last active February 26, 2025 14:19
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
<script type="text/javascript">
var uvOptions = {};
(function() {
var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/8vOeVcclRtYPvAvTiIGPlA.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
})();
</script>
@mitchellh
mitchellh / gist:2855234
Created June 1, 2012 21:29
Easy Plugin in Vagrant 1.1
# Just throw this in a Vagrant 1.1 Vagrantfile and you get the
# `vagrant fab` command that does what you expect. The command
# to run in fab should go after "--" in the command line, example:
#
# vagrant fab -- deploy:production
# vagrant fab -- -l
#
# Easy plugins. The future.
class Plugin < Vagrant.plugin("1")
name "fab"
@jacobian
jacobian / authuser.md
Created March 30, 2012 00:35
Upgrading auth.User - the profile approach

Upgrading auth.User - the profile approach

This proposal presents a "middle ground" approach to improving and refactoring auth.User, based around a new concept of "profiles". These profiles provide the main customization hook for the user model, but the user model itself stays concrete and cannot be replaced.

I call it a middle ground because it doesn't go as far as refactoring the whole auth app -- a laudable goal, but one that I believe will ultimately take far too long -- but goes a bit further than just fixing the most egregious errors (username length, for example).

This proposal includes a fair number of design decisions -- you're reading the fifth or sixth draft. To keep things clear, the options have been pruned out and on the one I think is the "winner" is still there. But see the FAQ at the end for some discussion and justification of various choices.

The User model

@datagrok
datagrok / gist:2199506
Last active December 16, 2024 16:14
Virtualenv's `bin/activate` is Doing It Wrong
document.body.addEventListener('error', function(event) {
if ( event.target.nodeName.toLowerCase() == 'img' ) {
// an image on the page failed to load
}
}, true);