This file contains 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
<!-- app/views/layouts/application.html.erb --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- ... --> | |
<% if Rails.application.config.disable_animations %> | |
<%= stylesheet_link_tag('disable_animations') %> | |
<!-- Turn off animations in jQuery --> | |
<script>$.fx.off = true;</script> |
This file contains 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
after_filter -> { sleep(0.25) } |
This file contains 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
// ==UserScript== | |
// @name Campfire Audio Notification | |
// @namespace http://johnpwood.net | |
// @description Play a sound when a message is received from a specific user or when it contains a specific word. | |
// @author John Wood | |
// @homepage http://johnpwood.net | |
// @include *.campfirenow.com/room* | |
// ==/UserScript== | |
try { if ( typeof(Campfire) != "undefined" ) { |
This file contains 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
namespace :question do | |
desc "Update Questions and Tasks to support newly added validations" | |
task :update_for_validations => :environment do | |
ActiveRecord::Base.transaction do | |
# Set question_type to "yesno" for following questions: | |
%w(need_long_term_rental need_short_term_rental find_eye_doctor cleaning need_home).each do |identifier| | |
q = Question.find_by_identifier(identifier) | |
q.update_attributes!(question_type: "yesno") if q.present? | |
end |
This file contains 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
# SSH to one of the production servers | |
capssh -e production | |
# Shortcut for SSHing into one of the production servers | |
capssh production | |
# SSH to the production server that is in the db role | |
capssh -e production -r db | |
# If you only have one server defined, you can connect to it by simply running capssh |
This file contains 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
Installing cocaine 0.5.7 | |
Installing crack 0.4.2 | |
Installing chronic 0.10.2 | |
Installing hitimes 1.2.2 with native extensions | |
Installing bourbon 4.2.3 |
This file contains 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
<?php | |
$PROBY_API_KEY = 'secret'; | |
function do_post_request($url, $data, $headers) { | |
$postdata = http_build_query($data); | |
$header_string = ""; | |
foreach ($headers as $key => $value) { | |
$header_string .= $key . ": " . $value . "\n"; |
This file contains 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 | |
# | |
# DESCRIPTION | |
# Slowly delete a file by truncating it by a small amount every half second | |
# until the file is eventually deleted. This should prevent the system from | |
# freaking out when attempting to delete a single, large file. | |
# | |
# USAGE | |
# fade.sh <file> | |
# |
This file contains 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 | |
# | |
# This script surrounds the command passed in with start and finish notifications | |
# to the Proby task monitoring application. | |
# | |
# | |
# === SETUP | |
# | |
# * Make sure the proby script is executable. | |
# |
This file contains 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 | |
dev_dir=/Users/jwood/dev | |
for d in `ls $dev_dir`; do | |
test -d $dev_dir/$d/log | |
if [ $? -eq 0 ]; then | |
for f in `ls $dev_dir/$d/log/*.log`; do | |
> $f | |
done |
NewerOlder