Skip to content

Instantly share code, notes, and snippets.

Avatar

Calvin Tennant calvintennant

View GitHub Profile
@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);
};
View gist:5347894
var container;
var camera, scene, renderer;
var text, parent;
var targetRotation = 0;
var targetRotationOnMouseDown = 0;
var mouseX = 0;
@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 = '',
@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(){};
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
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 instagram
https://api.instagram.com/v1/media/popular?client_id=0d9085d9f9c249faa9abc68f8b2e8ed5
View index.html
<!doctype HTML>
<html>
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.css">
<link rel="stylesheet" href="styles.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
View gist:dac5caf8638ec3ed398f
https://api.instagram.com/v1/users/10206720/media/recent?client_id=585d00be2af34a26b0e1caa6995cf19f