Skip to content

Instantly share code, notes, and snippets.

View jeffrydegrande's full-sized avatar

Jeffry Degrande jeffrydegrande

View GitHub Profile
class Company < ActiveRecord::Base
def update_with_password(params={})
if params[:password].blank?
params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank?
end
update_attributes(params)
end
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
like_this :when => "called",
:like => "this"
like_that(when, signature, is, like, this)
require 'rubygems'
require 'test/unit'
require 'redgreen'
class Card
attr_reader :suite, :value
def initialize(options={})
@suite = options[:suite]
@value = options[:value]
group :development, :test do
gem 'ruby-debug', :platforms => :ruby_18
gem 'ruby-debug19', :platforms => :ruby_19
end
#!/bin/bash
for f in `find . -name \*.rb`; do
grep '^# encoding: UTF-8' $f 2>&1 >/dev/null && continue
pf=$(basename $f)
cp $f /tmp
echo "#encoding: UTF-8" > $f
cat /tmp/$pf >> $f
Ereconsulaat Belo Horizonte
Avenida dos Andradas, 1093
MG CEP 30120-010 Belo Horizonte
Brazilië
+55 31 30486307
+55 31 32264532
[email protected]
Version 0.9.3.27
April 24, 2011
Beta expiration extended to June 1st, 2011
Version 0.9.3.26
February 26, 2011
Beta expiration extended to May 1st, 2011
Version 0.9.3.25
December 26, 2010
Beta expiration extended to March 1st, 2011
Version 0.9.3.24
@subscriber(ApplicationCreated)
def application_created_subscriber(event):
log.warn('Initializing database...')
f = open(os.path.join(here, 'schema.sql'), 'r')
stmt = f.read()
settings = event.app.registry.settings
db = sqlite3.connect(settings['db'])
db.executescript(stmt)
db.commit()
f.close()
function! RunTests(filename)
" Write the file and run tests for the given filename
:w
:silent !echo;echo;echo;echo;echo
exec ":!bundle exec rspec --fail-fast --drb " . a:filename
endfunction
function! SetTestFile()
" Set the spec file that tests will be run for.
let t:grb_test_file=@%