Skip to content

Instantly share code, notes, and snippets.

View thisgeek's full-sized avatar

Christopher Joslyn thisgeek

View GitHub Profile
class Pig {
function oink() {
print "Oink";
}
}
abstract class Decorator {
protected $obj;
function __construct($object) {
$this->obj = $object;
jQuery.fn.resizeWithWindow = function(options) {
var settings = $.extend($.fn.resizeWithWindow.defaults, options),
element = $(this);
adjustSize(element);
$(window).resize(function() {
adjustSize(element);
});
function adjustSize(targets) {
jQuery.fn.hideOnClickOutside = function () {
target = jQuery(this);
jQuery(document).one('click', function() {
target.hide();
});
target.click( function(event) {
event.stopPropagation();
});
return target;
}
@thisgeek
thisgeek / cookie.js
Created January 11, 2012 19:04
AMD Cookie.js
@thisgeek
thisgeek / Growl iChat.scpt
Created January 19, 2012 17:12
Growl iChat
# From http://scriptingosx.com/2010/11/ichat-notification-with-growl/
property growlAppName : "Growl iChat"
property notificationNames : {"Buddy Became Available", ¬
"Buddy Became Unavailable", ¬
"Message Received", ¬
"Completed File Transfer"}
property defaultNotificationNames : {"Buddy Became Available", ¬
"Buddy Became Unavailable", ¬
"Message Received", ¬
@thisgeek
thisgeek / ioad.sh
Created January 20, 2012 02:51
Install on Android Devices
#!/bin/bash
APK=$1
if [ ! -f `which adb` ]; then
echo 'You need to install the Android SDK before running this script.';
exit;
fi
if [ ! -c $APK ]; then
echo 'Please provide an .apk file to install.'
@thisgeek
thisgeek / chromium
Created January 30, 2012 16:28
Chromium Updater
#!/bin/bash -e
# Chromium cli wrapper
CHROMIUM_HOME=/Applications/Chromium.app/Contents
ROOT_URL=https://commondatastorage.googleapis.com/chromium-browser-continuous/Mac
DOWNLOAD_URL=https://download-chromium.appspot.com/dl/Mac
function chromium_current {
ack -A1 SCMRevision $CHROMIUM_HOME/Info.plist | ack '<string>(.+)</string>' --output '$1'
@thisgeek
thisgeek / SpecRunner.html
Created February 16, 2012 14:56
Jasmine AMD Spec Runner
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine AMD Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.1.0/jasmine_favicon.png" />
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.1.0/jasmine.css" />
<script src="lib/require.js" type="text/javascript"></script>
$.ajax({
success: function (data) {
console.log("Yay! You gots datums!");
},
error: function (jqXHR, status, error) {
console.log("Error? Handled it.");
},
complete: function () {
console.log("It's over.");
}