Skip to content

Instantly share code, notes, and snippets.

View pboling's full-sized avatar
🏓
Ping me if you need me!

Peter Boling pboling

🏓
Ping me if you need me!
View GitHub Profile
@teamon
teamon / Gemfile
Created April 17, 2014 08:39
Mount Grape API at rails root
source "http://rubygems.org"
gem "railties", '4.0.3', require: %w(action_controller rails)
gem "grape"
@emorikawa
emorikawa / gist:a091dfded1643ef86299
Created July 30, 2014 18:37
Convert RSpec `should` syntax to newer `expect` syntax
command! ShouldToExpect %s/\(^\s\+\)\(.\+\)\.should \(.\+\)/\1expect(\2).to \3/

Keybase proof

I hereby claim:

  • I am tpitale on github.
  • I am tpitale (https://keybase.io/tpitale) on keybase.
  • I have a public key whose fingerprint is 6C17 F481 4889 B9AD 61EC 7719 A2EA 6E3E FD48 2FE3

To claim this, I am signing this object:

@nateberkopec
nateberkopec / gist:11dbcf0ee7f2c08450ea
Last active March 24, 2023 21:59
RubySpec is dead, long live RubySpec!

Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.

When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me

Long story short, Celluloid versions 0.17+ have a memory leak.

The Reason behind this is that completed Celluloid threads are never cleaned up.

We have discovered that our Sidekiq process is leaking memory when we have a lot of tasks that were failed because of exceptions. Unfortunately, having a lot of failed tasks is specific for our application — we do have a lot of small queued jobs to work with social network APIs and other external services.

You can reproduce the problem with this: https://gist.github.com/gazay/3aa78e515ab05cb79f76

@marcotc
marcotc / sidekiq_retry_time.csv
Created February 14, 2017 18:16
Sidekiq retry exponential backoff formula times
Retry count Retry Time Total Cumulative Time Total Cumulative Days
0 0:00:00 0:00:00 0.0
1 0:00:16 0:00:16 0.0
2 0:00:31 0:00:47 0.0
3 0:01:36 0:02:23 0.0
4 0:04:31 0:06:54 0.0
5 0:10:40 0:17:34 0.0
6 0:21:51 0:39:25 0.0
7 0:40:16 1:19:41 0.1
8 1:08:31 2:28:12 0.1
@schovi
schovi / sidekiq.rb
Created March 17, 2017 22:38
Configure sidekiq via ENV variables
Sidekiq.configure_server do |config|
ENV["SIDEKIQ_NAMESPACE"] && config.options[:namespace] = ENV["SIDEKIQ_NAMESPACE"]
ENV["SIDEKIQ_CONCURRENCY"] && config.options[:concurrency] = ENV["SIDEKIQ_CONCURRENCY"].to_i
ENV["SIDEKIQ_VERBOSE"] && config.options[:verbose] = ENV["SIDEKIQ_VERBOSE"] === 'true'
ENV["SIDEKIQ_LOGFILE"] && config.options[:logfile] = ENV["SIDEKIQ_LOGFILE"]
ENV["SIDEKIQ_PIDFILE"] && config.options[:pidfile] = ENV["SIDEKIQ_PIDFILE"]
config.options[:strict] = true
if ENV["SIDEKIQ_QUEUES"]
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@GuilleLeopold
GuilleLeopold / generate_engines.rb
Created March 11, 2020 18:51
generate_engines
task :generate_engine do
# Get name sent from console
name = ENV['name'].downcase
# Store useful paths
engine_path = "engines/#{name}"
dummy_path = 'spec/dummy'
lib_files_path = 'lib/tasks/files'
dummy_relative_path = "#{engine_path}/#{dummy_path}"