This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Pig { | |
| function oink() { | |
| print "Oink"; | |
| } | |
| } | |
| abstract class Decorator { | |
| protected $obj; | |
| function __construct($object) { | |
| $this->obj = $object; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.resizeWithWindow = function(options) { | |
| var settings = $.extend($.fn.resizeWithWindow.defaults, options), | |
| element = $(this); | |
| adjustSize(element); | |
| $(window).resize(function() { | |
| adjustSize(element); | |
| }); | |
| function adjustSize(targets) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.hideOnClickOutside = function () { | |
| target = jQuery(this); | |
| jQuery(document).one('click', function() { | |
| target.hide(); | |
| }); | |
| target.click( function(event) { | |
| event.stopPropagation(); | |
| }); | |
| return target; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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", ¬ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.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."); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| home = ENV["HOME"] | |
| links = "#{home}/Code/backups/links" | |
| safe do | |
| tar do | |
| ## Backup any directory referenced in the links directory | |
| Dir.entries("#{links}").reject do | |
| |e| ['.', '..'].include?("#{e}") | |
| end.each do |link| |
OlderNewer