Skip to content

Instantly share code, notes, and snippets.

View trptcolin's full-sized avatar

Colin Jones trptcolin

View GitHub Profile
We couldn’t find that file to show.
@places = [
{:address=>'Dothan,AL',:description=>'Dothan is awesome'},
{:address=>'Athens,GA',:description=>'Athens is awesome'},
]
[Tue Jan 13 11:59:12 2009] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Tue Jan 13 11:59:12 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[ pid=12103 file=ApplicationPoolServer.h:535 time=01/13/09 11:59:12.771 ]:
*** WARNING: Could not create FIFO '/tmp/passenger_status.12103.fifo': Permission denied (13)
Disabling Passenger ApplicationPool status reporting.
[Tue Jan 13 11:59:12 2009] [error] *** Passenger could not be initialized because of this error: Could not connect to the ApplicationPool server: Connection reset by peer (104)
[Tue Jan 13 11:59:12 2009] [notice] Digest: generating secret for digest authentication ...
[Tue Jan 13 11:59:12 2009] [notice] Digest: done
[Tue Jan 13 11:59:12 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[ pid=12107 file=ApplicationPoolServer.h:535 time=01/13/09 11:59:12.870 ]:
#!/bin/bash
if [[ -z $1 ]]; then
echo "Usage: $0 takes one argument, the project name."
exit 0
else
project=`basename $1`
fi
action="cd /srv/websites/$project; sudo -S rake db:migrate"
echo $action
#!/bin/bash
if [[ -z $1 ]]; then
echo "Usage: $0 takes one argument, the project name."
exit 0
else
project=`basename $1`
fi
action="sudo mongrel_rails cluster::restart -C /etc/mongrel_cluster/$project.yml"
def valid_phone
[self.home_phone, self.mobile_phone, self.work_phone].each do |phone|
if !phone.blank?
return phone
end
end
return ''
end
@trptcolin
trptcolin / gist:75377
Created March 7, 2009 16:24
count the signatures on the Software Craftsmanship Manifesto
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# the solution is only this simple since the last row doesn't get padded to fill out the table
doc = Nokogiri::XML(open('http://manifesto.softwarecraftsmanship.org'))
puts doc.css("#signatory_table td").length
// before:
bestScore = Math.max(bestScore, -minimax(child, depth - 1, otherPlayer);
// after:
otherPlayerScore = minimax(child, depth - 1, otherPlayer);
maxOtherPlayerScore = Math.max(otherPlayerScore, maxOtherPlayerScore);
bestScore = -maxOtherPlayerScore;
(load "/Users/colin/lib/test-manager/load.scm")
(define (factor-list index product factors)
(cond ((< product 2)
'())
((= 0 (modulo product index))
(cons (cons index factors) (factor-list index (/ product index) factors)))
(else
(factor-list (+ index 1) product factors))))
(load "/Users/colin/lib/test-manager/load.scm")
(define (is-proper-factor? product possible-factor)
(and
(not (= product possible-factor))
(= 0 (modulo product possible-factor))))
(define (has-proper-factors? product test-factor)
(and (> product test-factor)
(or