Skip to content

Instantly share code, notes, and snippets.

View cristibalan's full-sized avatar

Cristi Balan cristibalan

View GitHub Profile
---
vendor/plugins/factory_girl:
squashed: true
url: git://github.com/thoughtbot/factory_girl.git
type: git
revision: c88fc365179a0d92a42fd7ed08edb055427f90d4
branch: master
remote: braid/vendor/plugins/factory-girl
vendor/plugins/forgot_password:
squashed: true
# Para salvar a altura e largura das imagens enviadas pelo plugin paperclip, utilize o callback abaixo
#
# class Document < ActiveRecord::Base
#
# has_attached_file :document, :styles => { :medium => "300x300>" }
#
# before_save :save_dimensions
#
# def save_dimensions
# if document.image?
commit 59efeb32bef98a97000ffe81baec6c434ab32647
Author: Cristi Balan <evil@che.lu>
Date: Tue Oct 21 19:50:04 2008 +0300
unscrew teh app. <3 railsrumble organizers
diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb
index f99efaa..edeb94b 100644
--- a/app/controllers/conferences_controller.rb
+++ b/app/controllers/conferences_controller.rb
#!/usr/bin/env ruby -w
##
# By Mike Clark
#
# From http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc
#
# Watches files and runs a command when any of them are modified.
#
# Can use Ruby's Dir[] to get file glob. Quote your args to take advantage of this.
#!/bin/sh
# braid plugin install
# usage: braidpi git://github.com/moo/boo.git
PLUGIN=$1
braid add -p "$PLUGIN" && ruby "vendor/plugins/`basename -s .git $PLUGIN`/install.rb"
# by Joel VanderWerf
require 'hpricot'
module Webby
class Renderer
attr_reader :page
end
module Filters
# from http://pastie.org/426366
require 'hpricot'
module Webby
class Renderer
attr_reader :page
end
module Filters
# To use: add relpath to the end of the list of filters in the layout. It won't
require 'net/http'
module Rack
class GistInline
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
require 'iconv'
require 'rubygems'
require 'mail'
s = Mail::SubjectField.new("From", 'Subject: =?ISO-8859-1?Q?Re=3A_ol=E1?=')
s.decoded # => "Re: ol\341" (LATIN1 bytes)
Iconv.conv("UTF8", "LATIN1", s.decoded) # => "Re: ol\303\241" (UTF8 bytes)
Mail::Encodings.unquote_and_convert_to(s.value, 'UTF8') # => "Re: ol\303\241" (UTF8 bytes)