Skip to content

Instantly share code, notes, and snippets.

View macisi's full-sized avatar
🏠
Working from home

Ryan macisi

🏠
Working from home
View GitHub Profile
@antife-yinyue
antife-yinyue / cmd-define-js.sublime-snippet
Created June 29, 2013 05:21
Snippets for Sublime Text
<snippet>
<content><![CDATA[define(function(require, exports, module) {
$0
})]]></content>
<tabTrigger>def</tabTrigger>
<scope>source.js</scope>
<description>define(factory)</description>
</snippet>
@eikes
eikes / imgpreload.js
Created October 20, 2012 23:23
JavaScript image preloader with callback
/*
* Copyright (C) 2012 Eike Send
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@nesk
nesk / LICENSE.txt
Created June 17, 2011 13:31 — forked from 140bytes/LICENSE.txt
Detect CSS 3 transitions support
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Johann PARDANAUD : http://plune.fr
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@stubbetje
stubbetje / base64.js
Created November 9, 2009 14:34
Base64 encode and decode in javascript
var Base64 = {
characters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ,
encode: function( string )
{
var characters = Base64.characters;
var result = '';
var i = 0;
do {