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
source 'https://rubygems.org' | |
ruby '2.1.2' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.1.6' | |
# Use PostgreSQL as the database for Active Record | |
gem 'pg' | |
## Assets | |
gem "sprockets-rails", "2.1.3" |
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
irb(main):001:0> f = Folk.first | |
Folk Load (0.2ms) SELECT "folks".* FROM "folks" ORDER BY "folks"."id" ASC LIMIT 1 | |
=> #<Folk id: 1, email: "[email protected]", encrypted_password: "$2a$10$bBJsiFh52QCNi0enN57XeerS2M7Tx8TXWXOgO9xj9pS8...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: "2014-01-27 16:56:02", updated_at: "2014-01-27 16:56:02"> | |
irb(main):002:0> f.add_role :staff | |
Role Load (0.2ms) SELECT "roles".* FROM "roles" WHERE "roles"."name" = 'staff' AND "roles"."resource_type" IS NULL AND "roles"."resource_id" IS NULL ORDER BY "roles"."id" ASC LIMIT 1 | |
Role Exists (27.6ms) SELECT 1 AS one FROM "roles" INNER JOIN "folks_roles" ON "roles"."id" = "folks_roles"."role_id" WHERE "folks_roles"."folk_id" = ? AND "roles"."id" = 2 LIMIT 1 [["folk_id", 1]] | |
(0.2ms) SELECT "roles".id FROM "roles" INNER JOIN "folks_roles" ON "roles"."id" = "folks_ro |
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
$ brew doctor | |
Your system is ready to brew. | |
$ brew --config | |
HOMEBREW_VERSION: 0.9.4 | |
ORIGIN: https://github.com/mxcl/homebrew | |
HEAD: 4f2f733bb54a1523e7f39fa6b5f0f8ddb925e5e7 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit sandybridge |
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
# User model | |
class Usuario < ActiveRecord::Base | |
rolify :role_cname => 'Rol' | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable |
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
#XML | |
$ curl http://something/xml | xmllint —format - | |
#JSON | |
$ curl http://something/json | python -mjson.tool |
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
$ rvm use [email protected] | |
Using /Users/florent/.rvm/gems/rbx-head with gemset rubygems-1.8.11 | |
$ gem -v | |
1.8.11 | |
$ ruby -v | |
rubinius 2.0.0dev (1.8.7 d1c8aa95 yyyy-mm-dd JI) [x86_64-apple-darwin11.2.0] | |
$ time bundle install |
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
$ sequel postgres://mylogin:mypasswd@localhost/bddtest | |
Your database is stored in DB... | |
>> require 'memcache' | |
=> true | |
>> MemCache | |
=> MemCache | |
>> MemCache::VERSION | |
=> "1.5.0.1" | |
>> CACHE = MemCache.new("localhost") | |
=> MemCache: 1 servers, 1 buckets, ns: nil, ro: false |
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
# ruby bench.rb | |
/opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/rlibmemcached.bundle: dlopen(/opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/rlibmemcached.bundle, 9): Symbol not found: _memcached_free (LoadError) | |
Referenced from: /opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/rlibmemcached.bundle | |
Expected in: flat namespace | |
in /opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/rlibmemcached.bundle - /opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/rlibmemcached.bundle | |
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
from /opt/local/lib/ruby/gems/1.8/gems/memcached-0.17.3/lib/memcached.rb:19 | |
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' | |
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' | |
from bench.rb:2 |