Skip to content

Instantly share code, notes, and snippets.

View ku1ik's full-sized avatar
👋

Marcin Kulik ku1ik

👋
View GitHub Profile
line = "name is \"Foobar\" " + "..."
begin_regexp = /"/ # string-begin-token
inside_regexp = /\"/ # escaped-char-token
end_regexp = /"/ # string-end-token
% ./script/rails c
/home/kill/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/whiny_nil.rb:29: uninitialized constant ActiveRecord::Base (NameError)
from /home/kill/.bundle/ruby/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `polyglot_original_require'
from /home/kill/.bundle/ruby/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
from /home/kill/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/railtie.rb:11
from /home/kill/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `instance_exec'
from /home/kill/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `run'
from /home/kill/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rail
Loading development environment (Rails 3.0.0.beta1)
ruby-1.8.7-p174 > User.first.memberships
=> []
ruby-1.8.7-p174 > User.first.memberships
=> [#<AccountMembership @id=1 @created_at=Thu, 17 Dec 2009 13:18:38 +0100 @updated_at=Thu, 17 Dec 2009 13:18:38 +0100 @type=AccountMembership @user_id=1 @account_id=1 @permission=<not loaded>>]
ruby-1.8.7-p174 > ProjectMembership
=> ProjectMembership
ruby-1.8.7-p174 > User.first.memberships
=> [#<AccountMembership @id=1 @created_at=Thu, 17 Dec 2009 13:18:38 +0100 @updated_at=Thu, 17 Dec 2009 13:18:38 +0100 @type=AccountMembership @user_id=1 @account_id=1 @permission=<not loaded>>, #<ProjectMembership @id=3 @created_at=Thu, 17 Dec 2009 13:51:31 +0100 @updated_at=Thu, 17 Dec 2009 13:51:31 +0100 @type=ProjectMembership @user_id=1 @account_id=2 @project_id=<not loaded> @permission=<not loaded>>, #<ProjectMembership @id=10 @created_at=Thu, 17 Dec 2009 15:33:49 +0100 @updated_at=Thu, 17 Dec 2009 15:33:49 +0100 @type=ProjectMembership @user_id=1 @account_id=3 @project_id=
require "korundum4"
class MyHighlighter < Qt::SyntaxHighlighter
def highlightBlock(line)
puts "highlightBlock"
setCurrentBlockUserData(Qt::TextBlockUserData.new)
end
end
class MyEdit < Qt::TextEdit
block_data_bug.rb:6: [BUG] Segmentation fault
ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]
-- control frame ----------
c:0007 p:0038 s:0021 b:0021 l:000020 d:000020 METHOD block_data_bug.rb:6
c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC :method_missing
c:0004 p:0013 s:0011 b:0011 l:000010 d:000010 METHOD /usr/lib/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:469
c:0003 p:0116 s:0008 b:0008 l:00133c d:000d8c EVAL block_data_bug.rb:26
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
require "korundum4"
class MyHighlighter < Qt::SyntaxHighlighter
@@data = []
def highlightBlock(line)
old_data = currentBlockUserData
new_data = Qt::TextBlockUserData.new
@@data << new_data
setCurrentBlockUserData(new_data)
class DataMapper::Adapters::AbstractAdapter
def reset_runtime
0.0
end
end
class OpenIDStrategy < Warden::Strategies::Base
def authenticate!
if resp = request.env['rack.openid.response']
if resp.status == :failure || resp.status == :missing
fail! "OpenID authentication failed"
end
use Rack::Session::Cookie
use Rack::OpenID
use RailsWarden::Manager do |manager|
manager.default_strategies :openid
manager.failure_app = ExceptionsController
end
class OpenIDStrategy < Warden::Strategies::Base
def authenticate!
Started POST "/users/activate?token=427386044816010515fc0ef12a57c0a02b856a1a" for 127.0.0.1 at 2010-03-30 15:44:09
!!! before IS DEPRECATED (found at UsersController:88): use before_filter
!!! css_include_tag IS DEPRECATED (found at ....:63): use stylesheet_link_tag
!!! js_include_tag IS DEPRECATED (found at ....:68): use javascript_include_tag
!!! js_include_tag IS DEPRECATED (found at ....:68): use javascript_include_tag
!!! partial IS DEPRECATED (found at ....:40): use render :partial
!!! url IS DEPRECATED (found at ....:14): use login_path
Rendered layouts/_session_info.html.erb (14.8ms)
Rendered layouts/_google_analytics.html.erb (0.4ms)
Rendered users/activate.html.erb within layouts/application (48.4ms)