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
-- I spent all of yesterday re-writing queries for a government project | |
-- because their production database runs MySQL v3 and they won't upgrade. | |
-- MySQL 3 sucks and doesn't even support sub-queries. This is an example of | |
-- how I wasted what little time I have left: | |
-- The original: | |
SELECT p1. * , ( | |
SELECT COUNT( `id` ) | |
FROM `pages` p2 |
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
# Bootstrap the Rails environment, frameworks, and default configuration | |
require File.join(File.dirname(__FILE__), 'boot') | |
require 'git_conf' | |
Rails::Initializer.run(:process, GitConf.new) do |config| | |
# ... | |
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
# Oh. My. God. Love. | |
alias my_server='screen -R -d -m -S my_server ssh my_user@my.server' | |
# With aliases like this in my .bashrc I can just type `my_server` into any terminal and be presented | |
# with that server connection. With enough aliases like this it means that from any terminal, I can just | |
# type `my_server` again and it will disconnect that session from the other window and into my current one. | |
# screen(1) kicks. ass. |
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
Bos-MacBook-Pro:integrity bjeanes (master)$ rake | |
(in /Users/bjeanes/Projects/Clones/integrity) | |
rm -r coverage | |
Loaded suite /usr/bin/rcov | |
Started | |
..................................E....... | |
Finished in 3.123474 seconds. | |
1) Error: | |
test_project_when_building_a_build_sends_notifications_with_all_registered_notifiers(Test::Unit::TestCase::TestProject20863500::TestWhenBuildingABuild20844450): |
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
abstract (1.0.0) | |
actionmailer (2.2.2, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 1.3.6) | |
actionpack (2.2.2, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 1.13.6) | |
actionwebservice (1.2.6) | |
activerecord (2.2.2, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 1.15.6) | |
activeresource (2.2.2, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.4) | |
activesupport (2.2.2, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 1.4.4) | |
acts_as_ferret (0.4.1) | |
addressable (2.0.1, 2.0.0, 1.0.4) | |
alter-ego (1.0.0) |
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
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
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
<VirtualHost *:80> | |
ServerName mingle.mocra.com | |
ServerAlias elevensoftmingle.selfip.com | |
ProxyPassReverse / http://127.0.0.1:8080/ | |
</VirtualHost> | |
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
module BlahPlugin | |
VERSION = '1.0.0' | |
class << self | |
# add plugin to AR only if it hasn't been included before, | |
# which may cause stack-level-too-deep errors if you're aliasing methods | |
# | |
def enable_activerecord | |
return if ActiveRecord::Base.respond_to? :acts_as_blah | |
ActiveRecord::Base.extend BlahPlugin::Macro |
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
function parse_git_deleted { | |
[[ $(git status | grep deleted:) != "" ]] && echo "-" | |
} | |
function parse_git_added { | |
[[ $(git status | grep "Untracked files:") != "" ]] && echo '+' | |
} | |
function parse_git_modified { | |
[[ $(git status | grep modified:) != "" ]] && echo "*" | |
} | |
function parse_git_dirty { |
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
(1..1325).to_a.each do |num| | |
link = "http://www.questionablecontent.net/comics/#{num}.png" | |
`curl #{link} > ~/Pictures/QC/#{num}.png &2>1` | |
puts "#{num} downloaded..." | |
end |