Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@aaronrussell
aaronrussell / jquery.mobile.event.js
Created December 16, 2010 13:36
Slightly modified version of jQuery Mobile's event handlers so can be used standalone without the rest of the framework
/*
* jQuery Mobile Framework : events
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {
$.extend( $.support, {
orientation: "orientation" in window,
@kevinfjbecker
kevinfjbecker / pull-block.html
Created August 12, 2011 11:06
A simple interactive canvas app: the beginnings of a rotate and pull control
<!DOCTYPE html>
<html>
<!--
Created using JS Bin
Source can be edited via /uzuzaj/latest/edit
-->
<!DOCTYPE html>
<html>
@abernier
abernier / jquery.cachefactory.js
Created August 13, 2011 21:54
$.cacheFactory
$.cachedGetScript = $.cacheFactory(function(dfd, url) {
$.getScript(url).then(dfd.resolve, dfd.reject);
});
@tsmallfield
tsmallfield / Deferred
Created April 13, 2012 06:05
deferred
/**
* @return {Object.<function>}
*/
function Deferred() {
/*-------------------------------------------
INIT
-------------------------------------------*/
var queue = [];
/*-------------------------------------------
@abernier
abernier / index.html
Created April 21, 2012 01:05
momentum
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<style>
html, body {height:100%;}
body {
background-color:#269;
background-image: -webkit-linear-gradient(white 2px, transparent 2px),
@max-power
max-power / geolocation_polyfill.js
Created May 3, 2012 06:12
HTML5 Geolocation Polyfill
// requires jquery.js, tested with reqwest.js with jquery compat mode
// uses http://geoplugin.net/json.gp
// lowercase arguments are just string placeholder
// F = Function placeholder
// Z = Cache placeholder
;(function(N,g,c,x,y,u,j,F,Z) {
F=function(s,e){Z?s(Z):$.ajax({url:'//'+u+'.net/'+j+'.gp',dataType:j+'p',jsonp:j+'callback',error:e,success:function(R){Z={};Z[c]={};Z[c][x]=R[u+'_'+x];Z[c][y]=R[u+'_'+y];s(Z)}})}
N[g]=N[g]||{getCurrentPosition:F,watchPosition:F,clearWatch:function(){Z=undefined}}
@Prinzhorn
Prinzhorn / LICENSE.txt
Created May 7, 2012 15:55 — forked from 140bytes/LICENSE.txt
compress hex color string
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Alexander Prinzhorn (@Prinzhorn) https://github.com/Prinzhorn
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
@tsmallfield
tsmallfield / pera1
Created June 9, 2012 13:07
parallax
/**
* @namespace pera1
*/
;(function(win, doc) {
"use strict";
/////////////////////////////////////////////////
/**
@threedaymonk
threedaymonk / grid.js
Created July 5, 2012 16:11
View and test vertical rhythm
(function(){
var isGridActive = false;
var lineHeight = function(){
return parseInt(window.getComputedStyle(document.body).lineHeight, 10);
};
var gridDataURL = function(){
var size = lineHeight();
@lunr
lunr / animator.js
Created July 19, 2012 19:03
Animator: JS to animate a set of images in a 360 rotation -- Works on Touchscreen devices too
$(document).ready(function() {
var speedLimit = 4; // higher allows the spin to jump frames faster. More speed.
var sensitivity = 10; // higher numbers makes it *less* sensitive, i.e. get to the speed limit slower.
var dragCoefficient = 3; // higher numbers = more drag. Slows down faster after a drag-to-spin. % of speed to lose.
$.fn.animator = function() {
var that = this;
that.container = $(this).find('.frame-container');
that.frames = that.container.children();
that.totalFrames = that.frames.length - 1;