Skip to content

Instantly share code, notes, and snippets.

Array.prototype.slice.apply(document.querySelectorAll('.not-following > .js-follow-btn')).forEach(function(buttonEl) {$(buttonEl).click()})
@calvinte
calvinte / .zshrc
Last active December 28, 2015 03:09
# 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
/*!
* 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
@calvinte
calvinte / Class.js
Last active December 19, 2015 23:28
Simple JavaScript Inheritance: http://ejohn.org/blog/simple-javascript-inheritance/. Updated to play nice with Require.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(){};
@calvinte
calvinte / alakazam.js
Last active December 16, 2015 01:19
Alakazam images!
alakazamPage = 1;
function alakazam(magic) {
var params = {
feature: 'popular',
consumer_key: '47HixZoC9snmw0OoJ6pHnky64gJ3WRBtx1IS3gRV',
callback: 'callback',
image_size: 3,
page: alakazamPage
},
uriParams = '',
var container;
var camera, scene, renderer;
var text, parent;
var targetRotation = 0;
var targetRotationOnMouseDown = 0;
var mouseX = 0;
@calvinte
calvinte / gist:4151151
Last active October 13, 2015 06:08
500px api connection
/**
* 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);
};
@calvinte
calvinte / gist:4050040
Created November 10, 2012 05:38
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.
/**
* 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++) {
# 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