Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / MooTools Dependency System.markdown
Created December 9, 2009 04:53
MooTools Dependency System

MooTools Dependency System

  • Package
    • tag
      • group (filename)
        • Provide

Package has many tags
Package/tag has many groups
Package/tag/group has many provides

@subtleGradient
subtleGradient / Aylott.md
Created December 9, 2009 17:24
Aylott Classic Anim

MooTools Dependency Syntax

:<space>, : and / are interchangeable.

Which makes all these options equivilent:

  1. Package: tag: Component
  2. Package: tag:Component
  3. Package: tag/Component
  4. Package:tag: Component
@subtleGradient
subtleGradient / History.Routing.js
Created December 16, 2009 15:18
Harald Kirschner's (http://digitarald.de/) MooTools History (replaces HistoryManager)
/**
* History.Routing
*
* @version 2.0
*
* @license MIT License
* @author Harald Kirschner <mail [at] digitarald.de>
* @copyright 2008 Author
*/
@subtleGradient
subtleGradient / Array.prototype.apply.js
Created December 21, 2009 18:07
String.prototype.call && Array.prototype.apply
Array.prototype.apply = function(bind, args){
var array = new Array(this.length);
for (var i=0; i < this.length; i++) {
if ('call' in this[i] && typeof this[i].call == 'function'){
try {
if (typeof this[i] == 'function')
array[i] = this[i].apply(bind, args);
else array[i] = this[i].call.apply(bind, args);
continue;
Object.fromQueryString = function(queryString){
queryString = String(queryString);
if (!queryString) return {};
queryString = queryString.split('?');
if (queryString.length > 1) queryString = queryString.slice(1);
queryString = queryString.join('?');
var object = {};
var vars = queryString.split('&');
if (vars.length) for (var i=0, this_var; this_var = vars[i]; i++){
this_var = this_var.split('=');
// Using this HTML
/*
<div id=root>
<b id=3 class="foo bar">
<b id=2 class=bar>
<b id=1 class=foo></b>
</b>
</b>
</div>
*/
@subtleGradient
subtleGradient / toggle_app
Created January 1, 2010 19:13
toggle_app — Toggle the visibility of any app on Mac OS X — Use with Quicksilver or something to toggle with shortcut keys
#!/usr/bin/env bash
#
# toggle_app
# Toggle the visibility of any app on Mac OS X
# Use with Quicksilver or something to toggle with shortcut keys
#
# by: Thomas Aylott -- SubtleGradient.com
# license: MIT
#
@subtleGradient
subtleGradient / Brilliance Black (Inverted).tmTheme
Created January 3, 2010 22:52
Brilliance Black, My Little Pony (Brilliance White), Brilliance Dull TextMate Themes in the `tmTheme` format. By Thomas Aylott (SubtleGradient). These themes were designed so that logically similar things will have similar colors. These are extremely rich
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Thomas Aylott</string>
<key>comment</key>
<string>Thomas Aylott ㊷ subtleGradient.com</string>
<key>name</key>
<string>Brilliance Black (Inverted)</string>
@subtleGradient
subtleGradient / commonjs_app.js
Created January 4, 2010 14:36
CommonJS: Extending native prototypes from a module
require('footools').setup(Array, Boolean, Function, Number, RegExp, String);
"bar".foo(); // no Fail