- Mac OS X 10.7.2
- Homebrew 0.8.1
- Apple Command Line Tools
- ZSH
- Git 1.7.5.4
- RVM 1.10.1
- Ruby 1.9.3
- Passenger 3.0.11
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
require 'rubygems' | |
require 'twitter' | |
auth = Twitter::HTTPAuth.new 'planeta_spfc', 'xxxxxxxxxxx' | |
base = Twitter::Base.new auth | |
base.followers.select { |f| !f.following }.each do |f| | |
begin | |
base.friendship_create f.id | |
rescue |
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
!!! XML | |
!!! | |
%html | |
%head | |
%title | |
= javascript_include_merged :base | |
= stylesheet_link_merged :base | |
%body= yield |
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/env ruby | |
# Raffle script. Uses Quicksilver (http://docs.blacktree.com/quicksilver/what_is_quicksilver) and Applescript | |
# CSV file of attendees was downloaded from EventWax (http://www.eventwax.com/). It needs 2 returns to continue the raffle | |
# - one to bring focus back to the terminal. | |
require 'rubygems' | |
require 'appscript' | |
require 'yaml' | |
require 'fastercsv' |
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/env ruby | |
# | |
# Put this script in your PATH and download from onemanga.com like this: | |
# onemanga_downloader.rb Bleach [chapter number] | |
# | |
# You will find the downloaded chapters under $HOME/Documents/OneManga/Bleach | |
# | |
# If you run this script without arguments, it will check your local manga downloads | |
# and check if there are any new chapters | |
# |
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
require 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
reddit_api_url = "http://www.reddit.com/.json" | |
resp = Net::HTTP.get_response(URI.parse(reddit_api_url)) | |
data = resp.body | |
result = JSON.parse(data) |
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
#-*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'mechanize' | |
require 'kconv' | |
agent = Mechanize.new | |
agent.get('https://login.keio.jp/koid/') | |
agent.page.form_with(:action => 'login') do |form| | |
form.field_with(:name => 'SignOnID').value = "my user ID" |
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
# Mechanize tests with Orkut/Twitter | |
# @author Davis Zanetti Cabral | |
# Orkut usage example: | |
# >> require 'jum_proxy' | |
# >> orkut = JumProxy::Sites::Orkut.new("[email protected]", "pa$$w0rd", "pt-BR") | |
# >> orkut.scraps | |
# | |
# Twitter usage example: | |
# >> require 'jum_proxy' |
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 User < ActiveRecord::Base | |
attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :zipcode | |
attr_accessor :password | |
before_save :encrypt_password | |
validates_confirmation_of :password | |
validates_presence_of :password, :on => :create | |
validates_presence_of :email | |
validates_uniqueness_of :email |
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 "deploy:symlink", "deploy:restart_workers" | |
after "deploy:restart_workers", "deploy:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
OlderNewer