Skip to content

Instantly share code, notes, and snippets.

View SlexAxton's full-sized avatar

Alex Sexton SlexAxton

View GitHub Profile
@SlexAxton
SlexAxton / pictureshow.txt
Created December 17, 2013 19:25
Lyrics to The Ericks and Melanies "Picture Show"
The Ericks and Melanies - Picture Show
Time is tall as trees we sit in
looking for some bones to fit in
empty words to sticky notions
poetry for familiar motions
pen-strokes waiting to catch our faces
sort them into fashion places
here we hang our knuckles white
cause from up here things seem alright
@SlexAxton
SlexAxton / bash_rc.sh
Created December 11, 2013 00:36
Run this to update chromium to the latest nightly on os x
updatechromium () {
mkdir -p /Applications/Browsers
Platform='unknown'
platform='unknown'
unamestr=`uname`
case "$unamestr" in
('Darwin') Platform="Mac"
platform="mac" ;;
('Linux') Platform="Linux"
platform="linux" ;;
@SlexAxton
SlexAxton / addressScaper.js
Created November 12, 2013 20:18
Scrape some country data
// First run: `npm install request q`
var request = require('request');
var Q = require('q');
var COUNTRIES = ['US'];
var BASE_URL = 'http://i18napis.appspot.com/address/data/'
function scrape(countries, cb) {
var datapromises = countries.map(function(country){
@SlexAxton
SlexAxton / example.mf.json
Last active December 20, 2015 03:49
A messageformat require plugin
{
"error_message_required" : {
"message" : "Required",
"contentType" : null,
"description" : "This is a message displayed to a user that inputs are required.",
"variables" : [],
"photos" : []
},
"error_message_minlength" : {
"message" : "{number, plural, one { # character too short } other { # characters too short } }",
@SlexAxton
SlexAxton / updatechromium.sh
Last active December 15, 2015 02:49
add this function to your .zshrc or .bashrc file to update chromium to the latest nightly with a command.
updatechromium () {
Platform='unknown'
platform='unknown'
unamestr=`uname`
case "$unamestr" in
('Darwin') Platform="Mac"
platform="mac" ;;
('Linux') Platform="Linux"
platform="linux" ;;
(*) if [[ $# = 2 ]]
@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
@SlexAxton
SlexAxton / lol.html
Created January 4, 2013 23:30
The worst JavaScript I've ever mistaken for working code.
<script type="text/javascript">
(function() {
("#URL").change(function() {
if ((this).val()) {
window.open((this).val());
("#formElement").submit();
}
});
});
@SlexAxton
SlexAxton / safeForEach.js
Created April 23, 2012 22:57
Safe forEach in JavaScript
Array.prototype.safeForEach = function ( fn ) {
var len = this.length;
for ( var cur = 0, cur < len; ++cur ) {
for ( var i = 0; i < len; ++i ) {
if ( this.hasOwnProperty[ i ] ) {
if ( i === cur ) {
fn && fn( this[ i ], i, this );
}
}
}
@SlexAxton
SlexAxton / prose.zsh-theme
Created February 23, 2012 08:18
my prose file
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function hg_prompt_info {
hg prompt --angle-brackets "\
< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
@SlexAxton
SlexAxton / Nonminified.js
Created February 8, 2012 22:56 — forked from anonymous/modernizr-2.5.2.min.js
Modernizr 2.5.2 that crashes IE7/8
/* Modernizr 2.5.2 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-shiv
*/
;
window.Modernizr = (function( window, document, undefined ) {
var version = '2.5.2',