Skip to content

Instantly share code, notes, and snippets.

@JacksonGariety
JacksonGariety / gist:7383017
Created November 9, 2013 08:13
Hurr tuh durr un urray in bursh.
# Hurr tuh durr un urray in bursh.
#!/usr/bin/bash
# nurm yurr urray
typeset -A MYARRAY
#ghrvv rt shrm durrta
MYARRAY[0]="wat"
MYARRAY[1]="huh"
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jackson Gariety http://jacksongariety.com/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@JacksonGariety
JacksonGariety / uhm
Created January 3, 2014 06:16
foobar
angular.injector(['ng']).invoke(function ($rootScope) {
// If I use this method, the function never fires, hmmmm
$rootScope.$on('$viewContentLoaded', function() {
console.log("foo")
})
// If I use this one, the entire app fails to render
$rootScope.$evalAsync(function() {
console.log("foo")
@JacksonGariety
JacksonGariety / gist:8295918
Last active February 15, 2019 16:14
OS X Configuration
1. oh-my-zsh (`$ curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh`)
2. Homebrew (`$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"`)
3. gitsomepizza ZSH theme. (https://github.com/jacksonGariety/gitsomepizza)
4. Emacs 24 (`$ brew install Emacs`)
5. [TotalSpaces 2](http://totalspaces.binaryage.com)
- Fastest space switching
function s(a,l){l='length';if(a[l]<2)return a;var s='slice',b=~~a[l]/2,c=s(a[s](0,b)),d=s(a[s](b)),e=[],f=0,g=0;while(f<c[l]&&g<d[l])c[f]<d[g]?e.push(c[f++]):e.push(d[g++]);return e.concat(c[s](f)).concat(d[s](g))}
function a(e,l){l='length';if(e[l]<2)return e;var t=a(e.slice(0,e[l]/2)),n=a(e.slice(e[l]/2)),r=[];while(t[l]&&n[l]){r.push(t[0]<n[0]?t.shift():n.shift())}return r.concat(t).concat(n)}
var fields = [document.querySelector('#field-1-id'), document.querySelector('#field-2-id')]
fields.forEach(function (field) {
field.addEventListener('keydown', function (event) {
var total = 0
fields.forEach(function (field) {
total += field.value
})
document.querySelector('#calculated-field-id').value = total
})
APICache.store = Moneta.new(:File, :dir => 'moneta')
repos = APICache.get("starred", :fail => []) do
repos = []
# GET
Octokit.starred(Octokit.user.login).each do |repo|
repos << [
repo.name.yellow || '',
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building polling-service 0.0.12-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-sources) @ polling-service ---
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks
var empty = 'path/to/_empty.js'
var b = browserify().add(empty).transform(function (file) {
if (file !== empty) return through()
return through(function (data) {}, function () {
this.queue('(function(){window;})();')
this.queue(null);
})
}).bundle(function (err, src) {