Skip to content

Instantly share code, notes, and snippets.

View THEtheChad's full-sized avatar

Chad Elliott THEtheChad

View GitHub Profile
@THEtheChad
THEtheChad / curry.js
Last active August 29, 2015 14:06 — forked from amatiasq/curry.js
/**
* @param {Function} fn Function to curry.
* @param {Number} lenght The arguments required to invoke the function. Optional. By default is fn.length
* @returns {Function} The currified function.
*/
function curry(fn, length) {
length = length || fn.length;
return function currified() {
// Optimization friendly arguments
<?php
// Licence: Do Whatever The Fuck You Want! http://www.wtfpl.net/about/
// Author: Your bro!
$fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>");
// Do the magic.
$tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate
@THEtheChad
THEtheChad / whenToDropIt.js
Last active August 29, 2015 14:05 — forked from beacrea/whenToDropIt.js
A functional lookup to help you determine what to do when it's hot, based on your sitch. Original by Sir Coty Beasley.
function mySitch(situation){
var holla = 'I got the rolly on my arm and I\'m pouring Chandon.';
if(mySitch.LOOKUP.hasOwnProperty(situation)){
holla = [mySitch.LOOKUP[situation], mySitch.SUFFIX].join(' ');
}
alert(holla);
}
@THEtheChad
THEtheChad / u.js
Created July 13, 2012 00:02 — forked from kputnam/u.js
Functional combinators in JavaScript
var u = (function() {
var id = function(x) { return x; }
var constant = function(x) { return function() { return x; }}
var ap = function(f,g) { return function(x) { return f(x)(g(x)); }}
var slice = function(args, n) { return Array.prototype.slice.call(args, n || 0); }
var attr = function(name) { return function(object) { return object[name]; }}
var bind = function(ctx) { return function(method) { return function() { return method.apply(ctx, slice(arguments)); }}}
var call = function(args) { return function(func) { return func.apply(null, slice(args)); }}
var flip = function(func) { return function(a) { return function(b) { return func(b)(a); }}}
@THEtheChad
THEtheChad / gist:1628672
Created January 17, 2012 20:23 — forked from kaievns/gist:996893
Cubic Bezier function emulator
/**
* Cubic Bezier CSS3 transitions emulator
*
* See this post for more details
* http://st-on-it.blogspot.com/2011/05/calculating-cubic-bezier-function.html
*
* Copyright (C) 2011 Nikolay Nemshilov
*/
function Bezier(p1,p2,p3,p4) {
// defining the bezier functions in the polynomial form