Skip to content

Instantly share code, notes, and snippets.

View fbernier's full-sized avatar
👷‍♂️

François Bernier fbernier

👷‍♂️
View GitHub Profile
@karimmtarek
karimmtarek / gist:b66461bf1588e29bc2ce
Last active August 7, 2017 13:40
Montreal Ruby Shops
@jcipar
jcipar / brewing-salts.glpk
Last active August 29, 2015 14:15
GLPK code to find appropriate mineral additions.
/**
This is a program that automatically determines appropriate mineral additions for brewing water.
I was playing with Bru'n Water, trying to determine how to adjust my water (Boston MWRA), and
was frustrated with the somewhat manual trial-and-error process. With this program I type in my
current and desired water profiles, and it automatically determines a suggested list of
salt additions. It solves the problem of salt additions, but it is not a replacement for tools
like Bru'n Water: it does not verify the water report, and everything regarding pH is completely
out-of-scope.
@keithtom
keithtom / no_animations.rb
Last active September 22, 2019 06:49
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
# Copyright (C) [2014] by Keith Tom <keith dot tom at gmail>
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE
module Rack
# disable CSS3 and jQuery animations in test mode for speed, consistency and avoiding timing issues.
# Usage for Rails:
# in config/environments/test.rb
# config.middleware.use Rack::NoAnimations
class NoAnimations
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
Ruby 2.1.0 in Production: known bugs and patches
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
While testing the new build for rollout, we ran into a number of bugs. Most of
these have been fixed on trunk already, but I've documented them below to help
anyone else who might be testing ruby 2.1 in production.
@naruse I think we should backport these patches to the ruby_2_1 branch and
release 2.1.1 sooner rather than later, as some of the bugs are quite critical.
I'm happy to offer any assistance I can to expedite this process.
@acapilleri
acapilleri / gist:6898533
Last active December 25, 2015 01:49
Rails App ruby 2.1 MRI vs Rubinius 2.0
Server:
iMac
Mac10,1
Intel Core 2 Duo
3,06 GHz
Cache L2: 3 MB
RAM: 8 GB
bus: 1,07 GHz
source "https://rubygems.org"
gem "toml", :git => "git://github.com/jm/toml", :ref => "479353753fc71173e9a8f778a9c3c20a0f92d189"
gem "json"
@raggi
raggi / bm_dci_pounding.rb
Last active September 22, 2016 23:19
Show the effects of method cache damage from runtime extend, as it relates to extend vs. delegate for DCI.
require 'benchmark'
number_of_rails_methods = 300
@rails = Class.new do
number_of_rails_methods.times do |i|
class_eval <<-RUBY
def call#{"%02d" % i} # def call01
end # end
RUBY
class LeakWatcher
include Celluloid
def initialize
@file = File.open("actor_list", 'w+')
@track = Hash.new { |h,k| h[k] = 0 }
every(10) { print_actors }
end
def print_actors