This file contains hidden or 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 | |
# small script to check on your protocolo | |
require 'rubygems' | |
require 'mechanize' | |
require 'hpricot' | |
url = 'https://servicos.dpf.gov.br/SincreWeb/protocolo' | |
agent = WWW::Mechanize.new |
This file contains hidden or 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
$.Twitter = function (options) { | |
var options = $.extend({ | |
username: '', | |
success: function () { } | |
}, options); | |
if (options.username == '') | |
return false; | |
$.event.trigger ('twitter_loading'); |
This file contains hidden or 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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
CALSCALE:GREGORIAN | |
PRODID:iCalendar-Ruby | |
BEGIN:VEVENT | |
SEQUENCE:0 | |
DTEND:20091013T090000 | |
DTSTART:20091013T080000 | |
UID:2009-08-29T15:21:07-03:00_804996795@foobar | |
DTSTAMP:20090829T152107 |
This file contains hidden or 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 'open-uri' | |
require 'nokogiri' | |
require 'icalendar' | |
require 'date' | |
class RailsSummit | |
include Icalendar | |
def initialize | |
@doc = Nokogiri::HTML(open('http://www.railssummit.com.br/pt-BR/schedule'), nil, 'UTF-8') |
This file contains hidden or 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
module AuthenticatedTestHelper | |
def login_as!(user=Factory(:account)) | |
activate_authlogic | |
AccountSession.create(user) | |
user | |
end | |
end |
This file contains hidden or 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 | |
function include_my_javascripts() { | |
if (is_page('video')) { | |
wp_enqueue_script('video.js') | |
} else (if is_page('contato')) { | |
wp_enqueue_script('validation.js') | |
} | |
} |
This file contains hidden or 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 Gateway | |
def self.authorize | |
end | |
def self.charge | |
end | |
def self.url | |
end | |
end |
This file contains hidden or 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
# Import your 'Today' list from Things into PomoDo; | |
require 'rubygems' | |
begin | |
require 'appscript' | |
rescue LoadError | |
puts "You need to install the rb-appscript gem" | |
exit | |
end |
This file contains hidden or 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 'digest/md5' | |
module Authlogic | |
module CryptoProviders | |
class Wordpress | |
class << self | |
ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; | |
def matches?(crypted, *tokens) | |
stretches = 1 << ITOA64.index(crypted[3,1]) | |
plain, salt = *tokens |
This file contains hidden or 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
namespace :heroku do | |
desc "writes a .gem config file for heroku based on the applications' gem config" | |
task :gems => :environment do | |
File.open(File.join(Rails.root, '.gems'), 'w') do |f| | |
Rails.configuration.gems.each do |gem| | |
f.write "#{gem.name} #{"--version #{gem.requirement}" if gem.requirement}\n" | |
end | |
end | |
end | |
end |
OlderNewer