Skip to content

Instantly share code, notes, and snippets.

View micha149's full-sized avatar

Michael van Engelshoven micha149

  • Brainbits GmbH
  • Sankt Augustin, Germany
View GitHub Profile
@micha149
micha149 / gist:850628
Created March 2, 2011 07:56
Get diagonal animation steps for a grid (qunit tested)
module("Diagonale");
var getStep = function(index, cols) {
if (index <= cols) {
return index;
}
return index % cols === 0
? index / cols + (cols - 1)
@micha149
micha149 / gist:838423
Created February 22, 2011 09:42
Adding classes to first and last columns via jQuery
for (var i = 0; i < teaserData.length; i++) {
// Create teaser markup
var teaser = $('<div/>').addClass('teaser');
// ...
// Constructing the teaser
// ...
teaser.appendTo(container);
@micha149
micha149 / yqllocalstoragecache.html
Created October 19, 2010 20:04 — forked from codepo8/yqllocalstoragecache.html
YQL and local storage
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0/build/base/base-min.css">
</head>
<body class="yui-skin-sam">
<div id="doc" class="yui-t7">