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
rake routes | |
(in /home/fps/workspace3/peded) | |
admin_pay_methods GET /admin/pay_methods(.:format) {:action=>"index", :controller=>"admin/pay_methods"} | |
POST /admin/pay_methods(.:format) {:action=>"create", :controller=>"admin/pay_methods"} | |
new_admin_pay_method GET /admin/pay_methods/new(.:format) {:action=>"new", :controller=>"admin/pay_methods"} | |
edit_admin_pay_method GET /admin/pay_methods/:id/edit(.:format) {:action=>"edit", :controller=>"admin/pay_methods"} | |
admin_pay_method GET /admin/pay_methods/:id(.:format) {:action=>"show", :controller=>"admin/pay_methods"} | |
PUT /admin/pay_methods/:id(.:format) {:action=>"update", :controller=>"admin/pay_methods"} | |
DELETE /admin/ |
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 | |
sudo apt-get -y install rubygems | |
sudo gem install crack --source http://rubygems.org | |
exit |
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
#!/usr/bin/ruby | |
count = 0 | |
ARGF.each do |line| | |
count += 1 | |
end | |
puts "#{count} 'loves' for Justin" |
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
#!/usr/bin/ruby | |
#!/usr/bin/gem | |
require 'rubygems' | |
require 'crack' | |
ARGF.each do |line| | |
tweet = line.strip | |
unless tweet.length == 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
<?php | |
$fp = fopen("http://USERNAME:[email protected]/1/statuses/filter.json?track=bieber","r"); | |
while($data = fgets($fp)) | |
{ | |
$time = date("YmdH"); | |
if ($newTime!=$time) | |
{ | |
@fclose($fp2); | |
$fp2 = fopen("{$time}.txt","a"); | |
} |
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
def progress | |
prog = self.assets.where(:ave_pos => {"$size" => 2} ).sort({ :order => -1}).limit(10).all.collect { |a| a.ave_pos unless a.ave_pos.empty? } | |
return prog.compact | |
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
def progress | |
prog = self.assets.collect { |a| a.ave_pos if !a.ave_pos.empty? }.compact! | |
# only show the last 10 positions | |
limited_progress = prog.reverse.slice(0,10) | |
if prog.empty? | |
return [] | |
else | |
return limited_progress | |
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
# Old | |
ship.current_voyage.groups.first.zooniverse_users.include?(self) | |
# New | |
ship.voyages.first.groups.where(:zooniverse_user_ids => self.id).count == 0 ? false : 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
#!/home/ec2-user/.rvm/rubies/ruby-1.9.2-p0/bin/ruby | |
require 'rubygems' | |
require 'aws/s3' | |
require 'fileutils' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'access_key', | |
:secret_access_key => 'secret_key' | |
) |
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
Capistrano::Configuration.instance(:must_exist).load do | |
# example execution 'cap bundle_app -s version=HEAD' | |
desc "Bundle code and push to S3" | |
task :bundle_app do | |
puts "Starting Git archive of #{version}" | |
`git archive -o oldweather.tar #{version}` | |
`gzip oldweather.tar` | |
s3_upload | |
clean_up |