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
| trait Shape { | |
| var x : Int | |
| var y : Int | |
| def draw | |
| def moveTo(newx: Int, newy: Int) = { | |
| x = newx | |
| y = newy | |
| } |
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
| # autocompletion for ruby_test | |
| # # works with tu/tf aliases | |
| # # see also ~/bin/ruby_test.rb | |
| _ruby_tests() { | |
| if [[ -n $words[2] ]]; then | |
| compadd `ruby_test -l ${words[2]}` | |
| fi | |
| } | |
| compdef _ruby_tests ruby_test | |
| alias tu="ruby_test unit" |
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 const_accessor(sym, value, remove=false, freeze=true) | |
| value.deepfreeze if freeze | |
| sym = sym.to_s | |
| down, up = sym.downcase, sym.upcase | |
| sym = up.to_sym | |
| remove_const sym if remove and const_defined? sym | |
| const_set sym, value | |
| class_eval "def #{down}; #{up}; end\ndef self.#{down}; #{up}; end" | |
| 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
| module Sinatra | |
| module Authorization | |
| def auth | |
| @auth ||= Rack::Auth::Basic::Request.new(request.env) | |
| end | |
| def unauthorized!(realm="flixcloud.com") | |
| response['WWW-Authenticate'] = %(Basic realm="#{realm}") | |
| throw :halt, [ 401, 'Authorization Required' ] |
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
| # from lib/ruby/1.8/open-uri.rb at around line 230 | |
| # this only breaks on my mac | |
| http = klass.new(target_host, target_port) | |
| if target.class == URI::HTTPS | |
| require 'net/https' | |
| http.use_ssl = true | |
| # commented this out because we aren't going to verify due | |
| # to the bus 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
| /Users/bryan/Development/ruby/lib/ruby/1.8/i686-darwin9.7.0/openssl.bundle: | |
| /usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7) | |
| /usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7) | |
| /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4) | |
| /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) | |
| /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) |
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 event_sql() | |
| %q{events.id, events.user_id, events.name, events.description, | |
| CONVERT_TZ( CASE | |
| WHEN recur_unit = 'mweek' THEN | |
| NWEEKDAY_DATETIME( | |
| today_time + INTERVAL IF(DAY(now_time) > NWEEKDAY_DAY(now_time, recur_every), 1, 0) MONTH, | |
| recur_every | |
| ) | |
| WHEN recur_unit = 'month' THEN | |
| today_time - INTERVAL (DAY(today_time) - DAY(start_time)) DAY |
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
| has_many_using :memberships, :using=>:group_ids, :group=>'@alias@.user_id', :readonly=>true, | |
| :include=>:user, :conditions=>"users.completed = 1", :with_deleted=>true, | |
| :select=>%q{ | |
| MIN(@alias@.id) id, @alias@.user_id, NULL group_id, NULL primary_email, | |
| BIT_OR(@alias@.desired_personas) desired_personas, | |
| MIN(@alias@.prof_photo_id) pp_photo_id, MIN(@alias@.pers_photo_id) ps_photo_id, | |
| BIT_OR(@alias@.profile_flags) profile_flags, | |
| MIN(@alias@.pers_name_privacy) pers_name_privacy, MIN(@alias@.prof_name_privacy) prof_name_privacy, | |
| MIN(@alias@.pers_birthday_privacy) pers_birthday_privacy, MIN(@alias@.prof_birthday_privacy) prof_birthday_privacy, | |
| MIN(@alias@.hide_relationship_status) hide_relationship_status, MIN(@alias@.hide_looking_for) hide_looking_for, |
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
| [error]: NoMethodError: undefined method `count' for []:Array | |
| [error]: in generator YARD::Generators::AttributesGenerator: /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb | |
| [error]: /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb:10:in `render_method' | |
| /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb:8:in `each' | |
| /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb:8:in `render_method' | |
| /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb:4:in `each' | |
| /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bin/../lib/../templates/default/attributes/html/header.erb:4:in `render_method' | |
| /Users/bryan/Development/ruby/lib/ruby/gems/1.8/gems/yard-0.2.3/bi |