Skip to content

Instantly share code, notes, and snippets.

/*
---
name: DomReady
description: Contains the custom event domready.
license: MIT-style license.
requires: [Browser, Element, Element.Events]
<?php
function flushPause($pause = 0){
echo ob_get_clean();
@ob_flush();
flush();
usleep($pause * 1000000);
}
ob_start();
ob_implicit_flush(false);
flushPause();
<?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>Label</key>
<string>com.subtlegradient.Packager.setupOrUpdatePackages</string>
<key>ProgramArguments</key>
<array>
<string>~/bin/mootools-update-libs.sh</string>
</array>
<div style='background-image: url(&#x27; data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg"><rect fill="#F00" width="100%" height="100%" rx="100%"/></svg> &#x27;);padding: 2em;display: inline-block;text-align: center;'>
I haz a circular!
</div>
@subtleGradient
subtleGradient / safari-get-html.js
Created June 16, 2010 18:51
Node.js JavaScript for Mac OS X. Uses osascript AppleScript to control Safari. Remote control Safari from the terminal!
#!/usr/bin/env node #// -*- Mode: Node.js JavaScript; tab-width: 4; -*-
/*
---
url: http://gist.github.com/441101
name : safari-get-html
description : safari-get-html will rock your socks!
authors : Thomas Aylott
copyright : © 2010 Thomas Aylott
license : MIT
@subtleGradient
subtleGradient / complete.rb
Created June 13, 2010 21:12
Ruby Code Completion framework for TextMate. Supports ENV var, JSON & Plist completion lists & options.
#!/usr/bin/env ruby
=begin
---
url : http://gist.github.com/437012
name : complete.rb
description : "Ruby Code Completion framework for TextMate. Supports ENV var, JSON & Plist completion lists & options."
authors : Thomas Aylott
copyright : © 2008-2010 Thomas Aylott
license : MIT
@subtleGradient
subtleGradient / current_word.rb
Created June 13, 2010 21:04
(Ruby) Get the current word relative to the cursor in TextMate (or with TextMate style ENV vars)
=begin
---
url: http://gist.github.com/437000
...
=end
# When creating a custom regex for Word.current_word, you need to keep a few things in mind:
# The regex matches from your caret, so your caret position will always be the beginning of the line
# Everything before your caret is reversed for the match, so the left of your caret will also match your caret position as ^
# You must use a capture group () for the text you're trying to match
# You must use a capture group () for the text before/after your match
@subtleGradient
subtleGradient / textmate mater cli api.sh
Created May 8, 2010 06:35
proposed api for TextMate CLI scope generator
# generate xml scopes from document using a single language
cat my-document|mater my-language
# generate xml scopes from document
# using a single language
# providing many other languages
# as optional imports
# and scope injection (TM2+ only)
cat my-document|mater -l my-language ~/Library/Application\ Support/TextMate/Bundles/*/Syntaxes/*
# or
/*
---
name: fx
description: very basic animation logic.
authors:
- "[Valerio Proietti](http://mad4milk.net)"
- "[Thomas Aylott](http://subtlegradient.com)"
license: "[MIT](http://mootools.net/license.txt)"
provides: fx
...
@subtleGradient
subtleGradient / listen.moo.js
Created April 30, 2010 21:09
MooTools API idea: Listener to replace Event. Manages all event related things
var myListener;
// Make a Listener instance
myListener = element.listen().relay("a[href^=#]").listen('click').tell(function(event){ event.stop() });
myListener = Butt.listen({
listen: 'kick',
relay: "a[href^=#]",
tell: function(event){ event.stop() },
default
});