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
# This is for voting for the budgetsketch project on http://cinciinnovates.com | |
# You can vote daily. This stupid simple mechanize script will simply submit | |
# your vote. You still have to confirm the vote from your email inbox. I | |
# figure a cron job to submit my vote keeps me from forgetting to vote daily | |
# and I (as a human) am still confirming; so not cheating. YMMV | |
require 'rubygems' | |
require 'mechanize' | |
require 'pp' | |
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
wr () { ruby script/server webrick ${1:+--port $1} ; } | |
mr () { if [ -e log/mongrel.pid ]; then | |
echo do not wait for 'mongrel_rails restart' >/dev/null | |
mrs $1 $2 | |
fi | |
echo "== Starting Mongrel as daemon${1:+ for $1}${2:+ on port $2}" | | |
tee -a log/${1:-${RAILS_ENV:-development}}.log | |
mongrel_rails start --daemonize ${1:+-e $1} ${2:+-p $2} ; | |
i=1 | |
while [ $i -le 15 -a ! -e log/mongrel.pid ]; do |
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
wr () { ruby script/server webrick ${1:+--port $1} ; } | |
mr () { if [ -e log/mongrel.pid ]; then | |
echo do not wait for 'mongrel_rails restart' >/dev/null | |
mrs $1 $2 | |
fi | |
stubbornPID=$(sudo -p 'sudo password: ' lsof -n -P -t -i tcp:${1:-3000}) | |
if [ -n "${stubbornPID}" ]; then | |
echo Try to kill stubborn process with PID ${stubbornPID} | |
kill -s INT ${stubbornPID} | |
fi |
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
class Database::Report | |
def self.to_s | |
puts | |
resort_count = Resort.count | |
puts "Resorts : #{resort_count}" | |
advert_count = Advert.count | |
puts "Adverts : #{advert_count}" | |
user_count = User.count | |
puts "Users : #{user_count}" | |
users = User.find(:all) |
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
class ResetPasswordController < ApplicationController | |
skip_before_filter :login_required | |
def show | |
user = User.find_by_reset_password_code(params[:id]) | |
self.current_user = user if user && user.reset_password_code_until && Time.now < user.reset_password_code_until | |
redirect_to logged_in? ? "/users/#{user.id}/edit" : "/login" | |
end | |
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
class Cb2rm::CareerBuilder | |
require 'defaultDriver' | |
def session_token | |
@session_token ||= session.sessionToken | |
end | |
def session | |
@session ||= begin_session.cB_BeginSessionResult | |
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
michaelguterl@diminishing:~/www/rm-integrity$ rip list | |
rip: plugin not loaded (/usr/local/lib/ruby/site_ruby/1.8/rip/commands/hooks.rb) | |
-> undefined method `use' for module `Rip::Commands' | |
ripenv: integrity | |
bcrypt-ruby (2.0.5) | |
bob (b2f5af7) | |
bobette (c47b2d1) | |
data_objects (0.10.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
michaelguterl@diminishing:~$ cat $RIPDIR/integrity/lib/bob.rb | |
require "fileutils" | |
require "pathname" | |
require "yaml" | |
require "logger" | |
require "time" | |
require "addressable/uri" | |
require "bob/buildable" | |
require "bob/builder" |
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
michaelguterl@diminishing:~/www/rm-integrity$ cat init.rb | |
$LOAD_PATH.unshift(File.expand_path("/home/michaelguterl/.rip/integrity/lib")) | |
require "integrity" | |
Integrity.new( | |
:database_uri => "sqlite3:integrity.db", | |
:export_directory => File.expand_path("./builds"), | |
:log => File.expand_path("./bob.log"), | |
:build_all_commits => true | |
) |
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
michaelguterl@diminishing:~/www/rm-integrity$ rip env use integrity && rip list | |
rip: plugin not loaded (/usr/local/lib/ruby/site_ruby/1.8/rip/commands/hooks.rb) | |
-> undefined method `use' for module `Rip::Commands' | |
ripenv: using integrity | |
rip: plugin not loaded (/usr/local/lib/ruby/site_ruby/1.8/rip/commands/hooks.rb) | |
-> undefined method `use' for module `Rip::Commands' | |
ripenv: integrity |