Skip to content

Instantly share code, notes, and snippets.

View draeton's full-sized avatar

Matthew Kimball-Cobbs draeton

View GitHub Profile
@draeton
draeton / Object.extend.js
Created August 16, 2011 04:14
extend objects or functions from right to left with properties from other objects
(function () {
var toString = Object.prototype.toString,
slice = Array.prototype.slice,
/**
* determines type of passed argument
*/
toType = function (thing) {
return toString.call(thing).match(/\s(\w+)/)[1].toLowerCase();
@draeton
draeton / fibonacci.js
Created August 3, 2011 12:26
Fibonacci generator
(function (window, undefined) {
var Math = window.Math,
a = [0, 1];
if (!Math.fibonacci) {
Math.fibonacci = function (n) {
var i;
if (a[n] === undefined) {
@draeton
draeton / jquery.getUrlVars.js
Last active January 4, 2025 15:34
returns object with url variables
/**
* jQuery.getUrlVars
*
* Copyright 2013, Matthew Cobbs
* MIT Licensed
*/
/*global jQuery */
(function (window, $) {
"use strict";