Skip to content

Instantly share code, notes, and snippets.

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
!!! XML
!!!
%html
%head
%title
= javascript_include_merged :base
= stylesheet_link_merged :base
%body= yield
#!/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'
#!/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
#
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)
#-*- 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"
# Mechanize tests with Orkut/Twitter
# @author Davis Zanetti Cabral
# Orkut usage example:
# >> require 'jum_proxy'
# >> orkut = JumProxy::Sites::Orkut.new("daviscabral@gmail.com", "pa$$w0rd", "pt-BR")
# >> orkut.scraps
#
# Twitter usage example:
# >> require 'jum_proxy'
@alobato
alobato / user.rb
Created February 28, 2012 15:04 — forked from rkellermeyer/user.rb
Using Redis to log categories that a user can follow
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
@alobato
alobato / deploy.rb
Created March 5, 2012 14:35 — forked from bkutil/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
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(',')
@alobato
alobato / Clean to Code.md
Created July 2, 2012 17:49 — forked from rossnelson/Clean to Code.md
Lion, Xcode, GIT, RVM, Passenger, Mysql, ImageMagick

2012-01-15

  • 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