Skip to content

Instantly share code, notes, and snippets.

@deleteme
deleteme / CssRule.js
Created March 24, 2012 22:37 — forked from mseeley/CssRule.js
Easily alter CSS rules via JS
// Allows programmatic altering of CSS rules. Turn this class into a flyweight by enabling modification of the underlying rule property.
function CssRule (selector, stylesheet) {
var rules = stylesheet.rules,
len = rules.length,
i = 0,
rule = null;
for (i; i < len; i++) {
rule = rules[i];
if (rule.selectorText === selector) {
<button id='stop'>stop</button>
<button id='start'>start</button>
<div id='count'></div>
<div id="shell">
</div>
<script
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyA_OZRpMaskOiOyodu5PQSbFKrY5hjFRxY&sensor=false"></script>
<script>
var mapMarkup = '<div id="map" style="width: 200px; height: 200px;">loading</div>';
@deleteme
deleteme / .ackrc
Created May 24, 2011 16:59 — forked from squarelover/.ackrc
My ~/.ackrc
--ignore-dir=vendor
--ignore-dir=db/server
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=db/*
--ignore-dir=doc/*
--ignore-dir=coverage
--type-add=ruby=.haml,.rake,.rsel,.sass,.thor,.erb,Gemfile,.feature
--type-set=cucumber=.feature
var Waterfall = Class.create({
initialize: function(){
this.root = $('waterfall');
if (!this.root) return;
this.height = this.root.getHeight();
this.width = '1300px';
this.num = 8;
this.heights = this.tops = new Array(this.num);
this.waterfallEffects = new Array();
this.waterfallImages = '<img src="color.png" />'.times(this.num);
var safeSet = function(key, value){
try {
localStorage[key] = value;
} catch(e) {
localStorage.removeItem(localStorage.key(localStorage.length - 1));
safeSet(key, value);
}
}
# COMMENT OF SCRIPT HERE
# you can make as many tabs as you wish...
# tab names are actually arbitrary at this point too.
---
- tab1:
- cd ~/src/mtg-play-tester-ui/
- gitx
- mvim
- tab2:
- cd ~/src/mtg-play-tester-ui/
// store.js
// a simple wrapper around html5 local storage and cookies
// provides three methods to interact with data
//
// set: key, value
// stores the value in a key
// get: key
// retrieves the value in the key
// expire: key
// removes the data and the key
@deleteme
deleteme / store.coffee
Created July 30, 2010 22:22
A coffeescript wrapper around cookies and localstorage
# store.js
# a simple wrapper around html5 local storage and cookies
# provides three methods to interact with data
#
# it automatically purges data from localStorage if it's full.
#
# set: key, value
# stores the value in a key
# returns the value
# get: key
// store.js
// a simple wrapper around html5 local storage and cookies
// provides three methods to interact with data
//
// set: key, value
// stores the value in a key
// get: key
// retrieves the value in the key
// expire: key
// removes the data and the key
javascript:R=0;%20x1=.1;%20y1=.05;%20x2=.25;%20y2=.24;%20x3=1.6;%20y3=.24;%20x4=300;%20y4=200;%20x5=300;%20y5=200;%20DI=document.getElementsByTagName("img");%20DIL=DI.length;%20function%20A(){for(i=0;%20i-DIL;%20i++){DIS=DI[%20i%20].style;%20DIS.position='absolute';%20DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px";%20DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5);%20void(0);