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
puts RUBY_VERSION | |
a = lambda { puts "Wow man" } | |
a.call('hi') #=> silent ignore | |
b = lambda { |a| puts "hi there" } | |
b.call("hi",2) #=> warning buddy | |
b = lambda { |a,b| puts "foo" } | |
b.call("hi") #=> error |
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
Using pivotal-tracker (0.4.1) from git://github.com/jsmestad/pivotal-tracker.git (at master) /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x007f8566c665b8> (NoMethodError) | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document' | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept' | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream' | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each' | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream' | |
from /Users/gnufied/.rbenv/versions/ruby_192/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept' | |
from /Users/gnufied/.rbe |
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
def save | |
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity | |
requires :firewall_policy_id | |
options = { | |
:firewall_policy => firewall_policy_id, | |
:protocol => protocol, | |
:description => description, | |
:source => source, | |
:source_port => source_port, | |
:destination => destination, |
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
module ActiveRecordBelongsToExtensions | |
def self.included(klass) | |
klass.class_eval do | |
alias_method_chain :find_target, :deleted | |
end | |
end | |
private | |
def find_target_with_deleted | |
klass = @reflection.klass | |
if klass.paranoid? |
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
Add the following code block with the correct options to embed SupportBee in any website | |
<script src="http://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script> | |
<script> | |
var sb_form = SupportBee.Form.initialize({ | |
company: 'techfolder', | |
height: '400px', | |
base_domain: 'supportbee.com', | |
position: 'bottom' | |
}); |
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
cc -I. -I/opt/local/include -I. -I/home/ubuntu/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/x86_64-linux -I. -fPIC -g -O2 -O0 -Wall -Werror -c gherkin_lexer_ar.c | |
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl: In function 'CLexer_scan': | |
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl:198:29: error: the comparison will always evaluate as 'true' for the address of 'raise_lexer_error' will never be NULL [-Werror=address] | |
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl:198:29: error: the comparison will always evaluate as 'true' for the address of 'raise_lexer_error' will never be NULL [-Werror=address] | |
cc1: all warnings being treated as errors | |
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
module Foo | |
class Config | |
def method_missing(*args,&block) | |
method_name = args.first | |
configatron.send(method_name) | |
end | |
def app_domain | |
configatron.app_domain || 'foo.com' | |
end |
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
| | ,---------, | |
K. .H |r'''|'''Y| | |
/ *'.* \ || | || | |
/ \ ||===|===|| | |
/.- -. \ || | || | |
/ |-| _/-/ \ |L.__|__.J| | |
/ \)_) (_() \ '---------' | |
_________________________ | |
-__LLLLLLLLLLLLLLLLL__- |
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
ab -n 5000 -c 30 | |
---- rvm 1.9.3 ----- | |
First run: | |
------------------------------- | |
Requests per second: 115.66 [#/sec] (mean) | |
Time per request: 86.459 [ms] (mean) |
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
if !klass.accessible_attributes.blank? | |
if klass.accessible_attributes.include?(key) | |
params[key] = value | |
end | |
else | |
if !klass.protected_attributes.include?(key) | |
params[key] = value | |
end | |
end |