Skip to content

Instantly share code, notes, and snippets.

Class.Mutators.jQuery = function(name){
var self = this;
jQuery.fn[name] = function(arg){
if ($type(arg) == 'string'){
var instance = this.data(name);
if($type(instance[arg]) == 'function'){
var returns = instance[arg].apply(instance, Array.slice(arguments, 1));
return (returns == instance) ? this : returns;
}
if(arguments[1] != null){
/*
---
source: http://gist.github.com/133677
provides: document.write
description: jQuery based document.write replacement
requires: jQuery
authors:
- Thomas Aylott -- SubtleGradient.com
$.fn.sprite = function(options){
var defaults = {
frames: 10,
inverse: false,
size: 20,
duration: 400
};
options = $.extend({}, defaults, options);
@ryanflorence
ryanflorence / LICENSE.txt
Created November 9, 2011 15:09 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
function getSomeThings(callback) {
var completed = 0;
var people, tasks;
$.ajax('/data/people.json', {
dataType: 'json',
success: function(data) {
completed++;
people = data.people;
onFinished();
## Puts a big annoying arrow in your window when you're not scrolled down, like a dummy
#
scrollAlert = $("<div style='position: fixed; z-index: 10000; bottom: -10px; left: 10px; font-size: 10em; opacity: 0.5'>⬇</div>")
count = $("<div style='position: fixed; z-index: 10000; bottom: -50px; left: 50px; color: #fff'></div>")
lineCount = 0
showing = false
body = $ document.body
win = $ window