Skip to content

Instantly share code, notes, and snippets.

Avatar

Calvin Tennant calvintennant

View GitHub Profile
View Follow erbody
Array.prototype.slice.apply(document.querySelectorAll('.not-following > .js-follow-btn')).forEach(function(buttonEl) {$(buttonEl).click()})
View .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Example aliases
View jquery-2.0.3.js
/*!
* jQuery JavaScript Library v2.0.3
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@calvintennant
calvintennant / Class.js
Last active Dec 19, 2015
Simple JavaScript Inheritance: http://ejohn.org/blog/simple-javascript-inheritance/. Updated to play nice with Require.js.
View Class.js
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
define(function() {
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};
@calvintennant
calvintennant / alakazam.js
Last active Dec 16, 2015
Alakazam images!
View alakazam.js
alakazamPage = 1;
function alakazam(magic) {
var params = {
feature: 'popular',
consumer_key: '47HixZoC9snmw0OoJ6pHnky64gJ3WRBtx1IS3gRV',
callback: 'callback',
image_size: 3,
page: alakazamPage
},
uriParams = '',
View gist:5347894
var container;
var camera, scene, renderer;
var text, parent;
var targetRotation = 0;
var targetRotationOnMouseDown = 0;
var mouseX = 0;
@calvintennant
calvintennant / gist:4151151
Last active Oct 13, 2015
500px api connection
View gist:4151151
/**
* Function generates parts of URI paramaters.
* @param param_name as String.
* @param root as String representing the root paramater in an array.
*/
encodeParamName = function(param_name, root) {
if (root) return encodeURIComponent(root + '[' + param_name + ']');
else return encodeURIComponent(param_name);
};
@calvintennant
calvintennant / gist:4050040
Created Nov 10, 2012
jQuery dosen't like SVG css properties like 'fill' and 'stop-opacity' so, I wrote this to piggyback it with my own. @todo make this into a proper jQuery library.
View gist:4050040
/**
* Function takes the style attribute and generates an object that
* represents it's CSS properties.
* @param styleAttr as String
* @return style as Object
*/
getStyle = function(styleAttr) {
var style = {};
styleAttr = styleAttr.split(';');
for (var i = 0; i < styleAttr.length; i++) {
View .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases