Skip to content

Instantly share code, notes, and snippets.

@keeganbrown
keeganbrown / main.js
Created August 12, 2015 20:11
quick and dirty hammer scrolling for GSAP Timeline
$('body').hammer();
$('body').on({
'touchstart': function(e) {
e.preventDefault();
},
'pan': function(e) {
console.log(e);
if (e.gesture.deltaY > 2) {
master.reverse();
} else if (e.gesture.deltaY < -2) {
/******************************************************************************
* File: FactoradicPermutation.hh
* Author: Keith Schwarz ([email protected])
*
* An algorithm for manipulating and generating permutations in lexicographic
* order by using the factoradic number system.
*
* The factoradic number system (also called the factorial number system) is a
* way of writing out numbers in a base system that depends on factorials,
* rather than powers of numbers. In the factoradic system, the last digit is
@keeganbrown
keeganbrown / gist:06cc14a48edcd6b22ee6
Created June 24, 2015 18:35
Quick N Dirty Parallax
function watch_header () {
TweenMax.set('.fixed-header-img-obj', { y: ScrollTop/2, z:0.1 });
}
TweenMax.ticker.addEventListener( 'tick', function () {
watch_header();
});
@keeganbrown
keeganbrown / provision-post.sh
Last active August 29, 2015 14:15
VVV Add themes
#!/bin/bash
for filename in /vagrant_www/wp-content/themes/*; do
echo $(basename "$filename");
rm /srv/www/wordpress-default/wp-content/themes/$(basename "$filename")
ln -s /vagrant_www/wp-content/themes/$(basename "$filename") /srv/www/wordpress-default/wp-content/themes/$(basename "$filename")
done
@keeganbrown
keeganbrown / gist:36ceb9674399f3fd08d2
Created July 29, 2014 18:35
console dump of adobe acrobat doc methods and properties available with javascript
for ( var i in this ) {
console.println( i + " : " + ( typeof this[i]) );
}
hidden : boolean
info : object
layout : string
filesize : number
documentFileName : string
@keeganbrown
keeganbrown / gist:5405c1d959a04cbc3866
Created July 28, 2014 14:28
Console Dump of methods and properties on Acrobat Doc object with Acrobat JavaScript
for ( var i in this ) {
console.println( i + " : " + this[i] );
}
hidden : false
info : [object Info]
layout : SinglePage
filesize : 2421706
documentFileName : TESTING.pdf
path : /Macintosh HD/Users/XXXXXXX/TESTING.pdf
numPages : 2
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@keeganbrown
keeganbrown / A-Pen-by-Keegan-Brown.markdown
Created January 14, 2014 17:15
A Pen by Keegan Brown.
//create an object
var friends = {};
//add people to it
friends.bill = { //observe this declaration as bill is an object of friends
firstName: "Bill",
lastName: "Gates",
number: "(206) 555-5555",
address: ['One Microsoft Way','Redmond','WA','98052']
};