Skip to content

Instantly share code, notes, and snippets.

David Abdemoulaie hobodave

Block or report user

Report or block hobodave

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hobodave on github.
  • I am hobodave (https://keybase.io/hobodave) on keybase.
  • I have a public key ASB60MCZcG0FCMrIMwfy3GSvMVhRoDt9ArW0f7rzE0nb2Qo

To claim this, I am signing this object:

View wut
jruby-9.1.9.0 :008 > Node.singleton_class.singArgumentError: invalid byte sequence in US-ASCII
=== at org/jruby/RubyRegexp.java:1078
each at org/jruby/RubyArray.java:1734
grep at org/jruby/RubyEnumerable.java:578
grep at org/jruby/RubyEnumerable.java:552
select_message at /Users/davida/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/irb/completion.rb:214
block in InputCompletor at /Users/davida/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/irb/completion.rb:192
readline at org/jruby/ext/readline/Readline.java:177
gets at /Users/davida/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/irb/input-method.rb:151
block in eval_input at /Users/davida/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/irb.rb:469
View script.rb
CONCURRENCY = 100 # Ensure adequate pool size in database.yml
barrier = Concurrent::CyclicBarrier.new(CONCURRENCY)
jobs = Array.new(CONCURRENCY) do
lambda do
begin
Node.last
rescue => e
puts e
View script.rb
CONCURRENCY = 100 # Ensure adequate pool size in database.yml
barrier = Concurrent::CyclicBarrier.new(CONCURRENCY)
jobs = Array.new(CONCURRENCY) do
lambda do
ClientNodeDetail.last
end
end
View routes.rb
Rails.application.routes.draw do
scope '/api' do
scope '/v2' do
get 'debug/error_workflows', to: 'debug#error_workflows', as: :v2_debug
# Would like to duplicate :activities and :workflows under here
end
get 'debug/error_workflows', to: 'debug#error_workflows', as: :debug
View gist:4ec4ab54ee9f4c2e267660d66f3fbe63
root 8194 0.0 0.0 20356 2412 - SsJ 7:32PM 0:00.34 sendmail: accepting connections (sendmail)
root 8195 0.0 0.0 20484 1856 - IJ 7:32PM 0:00.33 sendmail: ./v0L4PNp7095367 mx3.mail.icloud.com.: user open (sendmail)
root 15997 0.0 0.0 20484 1860 - IJ 8:02PM 0:00.17 sendmail: ./v0LMtObY043937 mx4.mail.icloud.com.: user open (sendmail)
root 18648 0.0 0.0 20484 1860 - SJ 8:32PM 0:00.13 sendmail: ./v0LHPObd030462 mx5.mail.icloud.com.: user open (sendmail)
root 20033 0.0 0.0 20484 1860 - SJ 9:02PM 0:00.13 sendmail: ./v0LBtNbd017163 mx3.mail.icloud.com.: user open (sendmail)
root 21871 0.0 0.0 20484 1852 - SJ 9:32PM 0:00.13 sendmail: ./v0LJtObZ036581 mx1.mail.icloud.com.: user open (sendmail)
root 23514 0.0 0.0 20484 1856 - SJ 10:02PM 0:00.12 sendmail: ./v0LGPObb027991 mx6.mail.icloud.com.: user open (sendmail)
root 30403 0.0 0.0 20484 1864 - SJ 10:32PM 0:00.12 s
View wut.rb
Rails.cache.fetch(cache_key, expires_in: expires_in, race_condition_ttl: 7.days.to_i)
# JRuby 9.0.5.0, Rails 4.1.13
# ConcurrencyError: Detected invalid hash contents due to unsynchronized modifications with concurrent users
# .org/jruby/RubyMarshal.java:102:in `dump'(undefined
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 669:in `dup_value!'
# …upport-4.1.13/lib/active_support/cache/memory_store.rb: 146:in `write_entry'
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 571:in `handle_expired_entry'
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 291:in `fetch'
View test.rb
require 'rspec'
class Bar
def self.bar(num)
puts "#{num}: Called!"
end
end
class Foo
def self.foo(num = 100)
View sheen.rb
class Sheen
include Celluloid
def initialize(name)
@name = name
end
def set_status(status)
@status = status
end
View gist:680569c241c038473e95
[12] pry(main)> logger = ActiveSupport::BufferedLogger.new('foo.log', :shift_age => false, :shift_size => false)
=> #<ActiveSupport::BufferedLogger:0x007fe3f8af73d0
@log=
#<Logger:0x007fe3f8af7308
@default_formatter=#<Logger::Formatter:0x007fe3f8af7268 @datetime_format=nil>,
@formatter=#<Logger::SimpleFormatter:0x007fe3f8af7010 @datetime_format=nil>,
@level={:shift_age=>false, :shift_size=>false},
@logdev=
#<Logger::LogDevice:0x007fe3f8af71f0
@dev=#<File:foo.log>,
You can’t perform that action at this time.