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/sh | |
export CFLAGS="-march=core2 -O3 -pipe -fomit-frame-pointer" | |
VERSION="1.9.3-p327" | |
curl https://raw.github.com/gist/1688857/2-$VERSION-patched.sh > /tmp/$VERSION-perf | |
rbenv install /tmp/$VERSION-perf |
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
var instances = session.getInstances(); | |
instances.sort(function(a, b) | |
{ | |
var date1 = parseInt(a.date.replace(/-/g, "")); | |
var date2 = parseInt(b.date.replace(/-/g, "")); | |
if (date1 < date2) | |
{ | |
return -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
<LocationMatch "wp-content/.*\.php$"> | |
Order allow,deny | |
Deny from all | |
Satisfy All | |
</LocationMatch> |
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
if [ -z "$WINDOW" ]; then | |
screen -q -list | |
if [ $? -gt 8 ]; then | |
echo -n "Screen found. Re-attach? [Y/n]: " | |
read response | |
case $response in | |
N*|n*) | |
echo "Okay. Type screen -R -U -D later..." | |
;; | |
*) |
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
#<Transaction _id: 5032980c67896cb5e500001d, _type: nil, event_id: BSON::ObjectId('5032732167896caf2e000001'), transaction_type: "auth", transaction_currency: "USD", attendee_id: "503297e767896cb5e5000014", invoice_id: "503297e767896cb5e5000016", success: nil, message: "Cancelled: Data format problem", complete: false, receipt_id: nil, reference_num: nil, response_code: nil, iso: nil, auth_code: nil, trans_time: nil, trans_date: nil, trans_type: nil, trans_amount: nil, card_type: nil, trans_id: nil, timed_out: nil, bank_totals: nil, ticket: nil, authorization: nil, parsed_message: "Approved"> |
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
e = Essentials::Event.create( {:start_date => "Thu Jul 19 00:00:00 UTC 2012", :group_name => "Boston Sites Program", :group => Essentials::Program.first.id.to_s, :location => "borkbork", :end_time => nil, :created_at => "Thu Jul 19 18:28:36 UTC 2012", :body => " asdfasdf ", :title => "bork", :updated_at => "Thu Jul 19 18:39:20 UTC 2012", :user_type => "grantee", :highlighted => false, :time_zone => "Mountain Time (US & Canada)", :program => nil, :summary => "asdfasdf", :start_time => "Thu Jul 19 19:00:00 UTC 2012", :active => false} ) | |
start_with_zone = ActiveSupport::TimeWithZone.new(e.start_time.getutc, ActiveSupport::TimeZone.new(e.time_zone)) | |
if e.start_time && e.end_time | |
end_with_zone = ActiveSupport::TimeWithZone.new(end_time.getutc, ActiveSupport::TimeZone.new(time_zone)) | |
"#{start_with_zone.strftime('%H:%M %Z')} - #{end_with_zone.strftime('%H:%M %Z')}" | |
else | |
"#{start_with_zone.strftime('%H:%M %Z')}" |
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
# ======================================================================= | |
# INCORRECT | |
# ======================================================================= | |
class Foo | |
# don't expect this to be an instance variable. it is not!! it is the | |
# java equivalent of: public static colours = new Array() | |
colours: [] | |
addColour: (colour) => |
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
# Download the latest pic of the day from NASA and delete or archive any | |
# previous ones in a specified directory. Optionally create a copy of the most | |
# current picture to allow OSX to pick up pictures as wallpapers | |
# | |
# Steve Challis 2011 | |
# http://schallis.com/2011/mar/20/nasa-astronomy-picture-of-the-day-background/ | |
# Get a fresch picture from NASA | |
todays_pic=`ruby -rubygems latest_nasa_photo.rb` |
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
ayv_deploy_dir="/Users/${USER}/Sites/ayv/deploy" | |
make_soup() | |
{ | |
current_branch=`git status | head -n 1 | awk '{print $4}'` | |
echo "Pushing $current_branch to soup... (Press Ctrl-c to abort)" | |
sleep 2 | |
git checkout soup | |
git fetch upstream && git merge upstream/soup | |
git merge $current_branch && git push upstream soup || git reset --hard |