Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / docparser.php
Created August 17, 2008 04:34
Yuffster's MooTools CheatSheet Generator
<?php
// By Yuffster
function getDox($file) {
$docs = file_get_contents("docs/$file.md");
$funcPatt = "/(.*?)?(Function|Method): (.*?) ?{(#.*?)}?\n/";
$argPatt = "/^[-*1-9]+.*?\(\*(.*?)\*(, optional)?/";
//This docs array will be for all the files and classes.
@subtleGradient
subtleGradient / git-info.sh
Created August 22, 2008 03:27
git-info by Duane Johnson
#!/bin/bash
# http://gist.github.com/6731
# author: Duane Johnson
# email: duane.johnson@gmail.com
# date: 2008 Jun 12
# license: MIT
#
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
#!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'pp'
class HTMLDoc
attr_reader :html
attr_reader :doc
/*IE6 specific code to get hover working for any element*/
#nav li,
.something-that-should-support-hover {
_azimuth: expression(
this.onmousedown = this.onmousedown || new Function("this.className += ' active'"),
this.onmouseup = this.onmouseup || new Function("this.className = this.className.replace('active','')"),
this.onmouseenter = this.onmouseenter || new Function("this.className += ' hover'"),
this.onmouseleave = this.onmouseleave || new Function("this.className = this.className.replace('hover','')"),
'inherit'
);
@subtleGradient
subtleGradient / shim.css
Created August 26, 2008 22:35
IE6 SHIM Fix -- For the Select box showthrough bug
* html .shimmed {
_azimuth: expression(
this.shimmed = this.shimmed || 'shimmed:'+this.insertAdjacentHTML('beforeBegin','<IFRAME style="filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);position:absolute;top:0px;left:0px;width:100%;height:100%" frameBorder=0 scrolling=no src="javascript:'+"''"+'"></IFRAME>'),
'inherit'
);
}
@subtleGradient
subtleGradient / operators.js
Created September 1, 2008 18:53
Complete list of js operators
/* Precedence Operator type Associativity Proximity */ //Individual operators ;
/* 1 member left-to-right both */ a . b ;
/* 1 member left-to-right inside + left */ a [ b ] ;
/* 1 new right-to-left right */ new b ;
/* 2 function-call left-to-right inside + left */ a ( b ) ;
/* 3 decrement n/a right-or-left */ -- b ;
/* 3 decrement n/a right-or-left */ a -- ;
/* 3 increment n/a right-or-left */ ++ b ;
/* 3 increment n/a right-or-left */ a ++ ;
/* 4 bitwise-not right-to-left right */ ~ b ;
Class.Mutators.Binds = function(self, method_names) {
if( method_names === true){
method_names = [];
for (var property in self)
if(typeof self[property] == 'function')
method_names.push(property);
}
$splat(method_names).each(function(method_name){
var fn = self[method_name];
/*Fix the PNG background image so that the contents can still be clicked*/
* html .png-fix-box {
background: none;
_azimuth: expression(this.bgd = this.bgd || 'bgd:'+this.insertAdjacentHTML('afterBegin','<div class="bg"></div>'),'inherit');
}
* html .png-fix-box .bg {
display:inline;
position: absolute;
top: 0px;
left: 0px;
function $mergeAdd(){
var mix = {};
var obs = Array.flatten(arguments);
for (var i = 0, l = obs.length; i < l; i++){
var object = obs[i];
if ($type(object) != 'object') continue;
for (var key in object){
var object_prop = object[key], mp = mix[key];
if(mp && $type(object_prop) == 'object' && $type(mp) == 'object')