I hereby claim:
- I am otobrglez on github.
- I am otobrglez (https://keybase.io/otobrglez) on keybase.
- I have a public key whose fingerprint is 4FE7 0346 C546 B9C0 31D9 B91B 0441 9BCA 2621 C2E3
To claim this, I am signing this object:
# You have coordinate in array and you want to calculate coordiante that is away from it by length_degree and direction_degree | |
def move point, length_degree=10, direction_degree=0 | |
[ | |
point[0]+length_degree*Math.cos(direction_degree*Math::PI/180), | |
point[1]+length_degree*Math.sin(direction_degree*Math::PI/180) | |
] | |
end |
class Hash | |
# This is monkey patch to convert keys to symbols. | |
def keys_to_symbols! | |
self.keys.inject({}) { |i,k| | |
i.merge!({k.to_sym => self.values_at(k).first}) } | |
end | |
end |
[cs] | |
path = /home/zver/cs | |
public = yes | |
writable = yes | |
printable = no | |
guest ok = yes | |
create mask = 0644 | |
directory mask = 0755 | |
force create mode = 0644 | |
force directory mode = 0755 |
require 'minitest/spec' | |
require 'minitest/autorun' | |
# Simulating existing structure | |
module Animal | |
def self.included who | |
who.extend ClassMethods | |
end | |
module ClassMethods |
I hereby claim:
To claim this, I am signing this object:
// successful jobs grouped by type maped by req/sec | |
r.db('qm_production').table('jobs') | |
.filter({'last_event_type': 'success'}) | |
.map(function(doc) { | |
return { | |
'ds_type': doc('ds_type'), | |
'last_event_type': doc('last_event_type'), | |
'res_sec': doc("stats_event_response_count").div(doc('stats_run_duration')), | |
'req_sec': doc("stats_event_request_count").div(doc('stats_run_duration')) | |
}; |
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
*[master][~/opalab/citysocialize_api]$ rake db:seed rvm:ruby-1.9.3-p194@citysocialize_api | |
rake aborted! | |
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/api/net_http_adapter.rb:72:in `request' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/api.rb:50:in `get' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/resource.rb:319:in `find' | |
/Users/otobrglez/opalab/citysocialize_api/app/models/plan.rb:39:in `recurly_plan' | |
/Users/otobrglez/opalab/citysocialize_api/app/models/plan.rb:21:in `update_from_recurly' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__443529181208233123__save__306707287606003360__callbacks' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@cit |
/Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault | |
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0] | |
-- Control frame information ----------------------------------------------- | |
c:0066 p:---- s:0274 b:0274 l:000273 d:000273 CFUNC :connect | |
c:0065 p:0011 s:0271 b:0271 l:000800 d:000270 BLOCK /Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799 | |
c:0064 p:0031 s:0269 b:0269 l:000268 d:000268 METHOD /Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54 | |
c:0063 p:0026 s:0257 b:0257 l:000256 d:000256 METHOD /Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99 | |
c:0062 p:0485 s:0251 b:0251 l:000800 d:000800 METHOD /Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799 | |
c:0061 p:0011 s:0243 b:0243 l:000242 d:000242 METHOD /Users/otobrglez/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755 |
require 'benchmark' | |
require 'set' | |
a = ["a","b","c","d"] | |
b = ["b","d"] | |
Benchmark.bm do |x| | |
x.report do | |
(a.inject(0) {|s,i| s += b.include?(i)?1:0 } == b.size) | |
end |