Skip to content

Instantly share code, notes, and snippets.

View aaronbuchanan's full-sized avatar

Aaron Buchanan aaronbuchanan

View GitHub Profile
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
@aaronbuchanan
aaronbuchanan / gist:5528754
Created May 6, 2013 22:27
clean git history visualizer
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@aaronbuchanan
aaronbuchanan / Gulpfile.js
Created October 19, 2015 17:50 — forked from ddprrt/Gulpfile.js
Gulp: Grabbing JavaScript assets from a CDN to add to your build pipeline
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var request = require('request');
var merge = require('merge2');
var concat = require('gulp-concat');
var buffer = require('gulp-buffer');
/**
* 1. We request the latest jQuery version from the jQuery CDN. The
* request package allows for streaming. What we get in return
@aaronbuchanan
aaronbuchanan / top 100 domain occurrences by email.sql
Created September 1, 2015 03:43
MYSQL statement to parse the domain of an email and show the most common domains
select count(*) as occurrances, substring_index(email, "@", -1) as domain
from users
group by substring_index(email, "@", -1)
ORDER by occurrances DESC
limit 100;
<smil><head><layout><root-layout width="2460px" height="1440px"/><region id="Image" left="0" top="0" width="2460px" height="1296px" fit="meet"/></layout></head><body><par dur="5000ms"><img src="20150815_140057.jpeg" region="Image"/></par></body></smil>
@implementation InterfaceController
{
SRWebSocket *_webSocket;
}
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
}
- (IBAction)didOpen {
$ gource -f -1280x720 --auto-skip-seconds 1 --bloom-multiplier 1.0 --bloom-intensity 1.2 -e 0.2 --background 000000 --background-image gource/bg.png --seconds-per-day .2 --highlight-all-users -o gource/out.ppm
$ ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource/out.ppm -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource/out.mp4
@aaronbuchanan
aaronbuchanan / rename_files_with_prefix.sh
Created July 22, 2014 22:48
rename files with prefix
$ for filename in OrigPrefix*; do echo mv \"$f\" \"${f//OrigPrefix/NewPrefix}\"; done