Skip to content

Instantly share code, notes, and snippets.

Fabien Jakimowicz jakimowicz

Block or report user

Report or block jakimowicz

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 jakimowicz on github.
  • I am fabienj (https://keybase.io/fabienj) on keybase.
  • I have a public key ASByKnw5AnNkQo_niieSOPGHqHRIFvLnq7IBvQlsYEEEUQo

To claim this, I am signing this object:

@jakimowicz
jakimowicz / the % notation in ruby.md
Last active Aug 6, 2019
%Q, %q, %W, %w, %x, %r, %s, %I, %i
View the % notation in ruby.md

%Q, %q, %W, %w, %x, %r, %s, %i

Perl-inspired notation to quote strings: by using % (percent character) and specifying a delimiting character.

Any single non-alpha-numeric character can be used as the delimiter, %[including these], %?or these?, %~or even these things~.

Strings

% or %Q

@jakimowicz
jakimowicz / mongo_mapper.rb
Last active Dec 26, 2015 — forked from bhbryant/retry.rb
auto-failover ReplicaSet config for MongoMapper, by way of ruby driver. without any change to the connection. You just need to require the files before initiating the connection.
View mongo_mapper.rb
require 'lib/mongo/retry'
require 'lib/mongo/repl_set_connection'
@jakimowicz
jakimowicz / redmine gitlab sync
Created Nov 15, 2012
simple (and dirty) sync between redmine issues and gitlab issues
View redmine gitlab sync
#!/usr/bin/env ruby
require 'faraday'
require 'json'
require 'gitlab'
module Redmine
Host = nil
APIKey = nil
View delayed_jobs_queue_size.rb
#!/usr/bin/env ruby
# by Helder Ribeiro 2009
# by Fabien Jakimowicz 2010
#
# Plugin to monitor delayed_jobs' queue size
# Gives updates with number of jobs that haven't been started yet
# plus the ones that failed and are still rescheduled for another run
#
# Parameters supported:
#
View passenger_rails_processes_memory.rb
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category passenger
graph_title rails processes memory
graph_vlabel megabytes
graph_info This graph shows the average, min and max memory consumption made by rails processes.
graph_order max average min
max.label max
View passenger_nginx_memory_status.rb
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category passenger
graph_title memory
graph_vlabel megabytes
graph_info This graph shows the memory consumption made by passenger processes, passenger and nginx.
graph_order nginx passenger rails
rails.label rails
View passenger_status.rb
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category passenger
graph_title status
graph_vlabel count
graph_info This graph shows how much passenger process are working, available and how much queries are waiting.
max.label max processes
max.draw AREA
You can’t perform that action at this time.