Skip to content

Instantly share code, notes, and snippets.

View aaronmcadam's full-sized avatar
🎉
Having fun!

Aaron McAdam aaronmcadam

🎉
Having fun!
View GitHub Profile
@paulirish
paulirish / README.md
Created January 4, 2010 02:38
imagesLoaded() jquery plugin
@cowboy
cowboy / qunit-async-test.js
Created February 9, 2010 15:03
Run asynchronous qunit test serially
test( 'async tests', function() {
// My custom async function
function ajax(data, successCallback) {
$.ajax({
url: 'server.php',
data: data,
success: successCallback,
error: function( xhr, textStatus ){
ok( false, textStatus );
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@cowboy
cowboy / textmate_grammar-html_syntaxhighlighter_pre_brush
Created October 7, 2010 17:55
TextMate + Zen Coding + SyntaxHighlighter + this = yay
{ name = 'source.css.embedded.html.syntaxhighlighter';
begin = '(?:^\s+)?(<)((?i:pre))\b(?=[^>]*class=([''"])[^>]*?\bbrush\s*:\s*css\b[^>]*?\3)(?![^>]*/>)';
end = '(?<=</(pre|PRE))(>)(?:\s*\n)?';
beginCaptures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.style.html'; };
};
endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; };
patterns = (
{ include = '#tag-stuff'; },
@aaronmcadam
aaronmcadam / phonegap-android-create.txt
Created October 11, 2010 22:43
Command and instructions for setting up a new phonegap-android project
# IMPORTANT! Use Ruby 1.9.1
# command that works for creating a new phonegap-android project
ruby bin/droidgap classic "C:/android-sdk/android-sdk-windows" TestGap TestGap.com "C:/www" "C:/phonegap/projects/TestGap"
# Open Eclipse and File -> New -> Project. Then choose Android -> Android Project. Give your project a name, click the radio button for "Create project from existing source", and browse to your generated project folder.
# Don't forget to add the phonegap.jar to your project. Expand the libs folder and then right-click on phonegap.jar and choose "BuildPath -> Add to Build Path"
@rmurphey
rmurphey / pubsub-demo.js
Created October 26, 2010 04:59
JS for pubsub screencast
/* traditional way */
(function($) {
$(document).ready(function() {
$('#searchForm').submit(function(e) {
var term = $.trim($(this).find('input[name="q"]').val());
if (!term) { return; }
$.getJSON(
@alunny
alunny / advanced.training.libraries.md
Created October 28, 2010 18:43
PhoneGap Advanced: training libraries
@cowboy
cowboy / com.benalman.manserver.plist
Created November 18, 2010 16:19
manServer in OS X
<?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>KeepAlive</key>
<true/>
<key>Label</key>
<string>manServer</string>
<key>OnDemand</key>
<false/>
@creationix
creationix / streamtest.js
Created January 1, 2011 08:57
A sample client for creationix/jsonparse that consumes the twitter feed and filters out messages and names
var Parser = require('./jsonparse');
var Http = require('http');
var p = new Parser();
// IMPORTANT, put your username and password in here
var username = "yourTwitterUsername", password = "yourPassword";
var client = Http.createClient(80, "stream.twitter.com");
var request = client.request("GET", "/1/statuses/sample.json", {
"Host": "stream.twitter.com",
"Authorization": (new Buffer(username + ":" + password)).toString("base64")
});
@nathansmith
nathansmith / moz-webkit.css
Created March 22, 2011 01:51
Target Firefox and WebKit via hacky CSS.
/*
Read more here:
https://developer.mozilla.org/en/CSS/@-moz-document
For more browser-specific hacks:
http://paulirish.com/2009/browser-specific-css-hacks
*/
@-moz-document url-prefix() {
/* Put your Firefox specific code here. */