Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
require 'rake'
require 'spec'
require 'spec/rake/spectask'
require 'cucumber/rake/task'
namespace :test do
Spec::Rake::SpecTask.new do |t|
FileUtils.rm('test') if File.exists?('test')
t.spec_files = FileList['spec/*_spec.rb']
t.spec_opts = ['-u']
[[["vubec","f505caece98d82d63e40f6f66181770f"],["vubec","bfbaae1f9dfae6d500c4cb5cedc62694"],["vubec","9f1b01706356447b73d48195ef0f883f"],["vubec","4bca865b33c6a5c3ecbeba22ca1cdf17"],["vubec","3c33b2eb1a58d7aab6421884fb1269f5"],["vubec","36f84b90a217953761520110420e1a8f"],["vubec","165690260330c152c07f6dcee9b76a1a"],["vubec","1099b4329f5685e6d061f75996bc8f42"],["nic","b5ebe765cd25eb319e6d6740abe52ca9"],["nic","0f06538b9aab55cd22a3051b44e0f150"]],[1,1,1,1,1,1,1,1,1,1],false]
diff --git a/db/schema.rb b/db/schema.rb
index d35485f..a9152c3 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -325,7 +325,7 @@ ActiveRecord::Schema.define(:version => 20091127111226) do
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "published"
- t.integer "season_id", :default => 3
+ t.integer "season_id", :default => 1
@pepe
pepe / omg.rb
Created March 18, 2010 08:44 — forked from wycats/omg.rb
require ".bundle/environment"
Bundler.setup
require "action_controller/railtie"
class FooController < ActionController::Base
def bar
self.response_body = "HELLO"
end
end
[2010-05-19 14:10:27] autoconf
autoconf: no input file

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
--trace alias create 1.9.2-head@rails3 phd
rvm 0.1.38 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
+__rvm_parse_args:399> [[ -z '' ]]
+__rvm_parse_args:399> [[ ! -z '' ]]
+__rvm_parse_args:400> [[ ! -z '' ]]
+__rvm_parse_args:400> [[ ! -z '' ]]
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
(rdb:1) p message = registered_mailers[mailer_name].messages[message_name].call(*attributes)
#<Mail::Message:2183856880, Multipart: false, Headers: <From: orders@me-tee.eu>, <To: e@co.cz>, <Subject: translation missing: en, notification, new_order, subject>, <Content-Type: text/html>>
(rdb:1) p Mail::TestMailer.deliveries
[]
(rdb:1) e message.deliver
#<Mail::Message:2183856880, Multipart: false, Headers: <Date: Thu, 12 Aug 2010 16:39:14 +0200>, <From: orders@me-tee.eu>, <To: e@co.cz>, <Message-ID: <4c640792608b9_13659800e092c934b2@LongJingXiHu.local.mail>>, <Subject: translation missing: en, notification, new_order, subject>, <Mime-Version: 1.0>, <Content-Type: text/html>, <Content-Transfer-Encoding: 7bit>>
(rdb:1) p Mail::TestMailer.deliveries
[]
(rdb:1) p Mail.deliver {from 'ec@de.cz'}
#<Mail::Message:2183006440, Multipart: false, Headers: <Date: Thu, 12 Aug 2010 16:41:09 +0200>, <From: ec@de.cz>, <Message-ID: <4c640805ab8dd_13659800e092c9351@LongJingXiHu.local.mail>>, <Mime-Version: 1.0>, <Content-Type: te
@pepe
pepe / mongoid_db_tasks.rake
Created November 9, 2010 08:51
rake tasks for upgrading to mongoid 2.0 in padrino
namespace :db do
namespace :mongoid do
# gets a list of the mongoid models defined in the app/models directory
def get_mongoid_models
documents = []
Dir.glob("app/models/**/*.rb").sort.each do |file|
model_path = file[0..-4].split('/')[2..-1]
begin
klass = model_path.map(&:classify).join('::').constantize