Skip to content

Instantly share code, notes, and snippets.

View jeffrydegrande's full-sized avatar

Jeffry Degrande jeffrydegrande

View GitHub Profile
#!/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
$.Twitter = function (options) {
var options = $.extend({
username: '',
success: function () { }
}, options);
if (options.username == '')
return false;
$.event.trigger ('twitter_loading');
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
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')
module AuthenticatedTestHelper
def login_as!(user=Factory(:account))
activate_authlogic
AccountSession.create(user)
user
end
end
<?php
function include_my_javascripts() {
if (is_page('video')) {
wp_enqueue_script('video.js')
} else (if is_page('contato')) {
wp_enqueue_script('validation.js')
}
}
class Gateway
def self.authorize
end
def self.charge
end
def self.url
end
end
# 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
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
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