Skip to content

Instantly share code, notes, and snippets.

View yourivdlans's full-sized avatar

Youri van der Lans yourivdlans

View GitHub Profile
@arsduo
arsduo / check_changed_coverage.rb
Last active June 9, 2023 19:10
SimpleCov Test Coverage for Files Changed in a Branch
output = `cat #{ENV["CIRCLE_ARTIFACTS"] || "."}/coverage/index.html | grep Changed -A 2 | grep "[0-9\.]*%"`
percentage_match = output.match(/([0-9\.]+)%/)
raise "Unable to determine test coverage change" unless percentage_match
RED = "\033[0;31m"
BOLD = "\033[1m"
NO_COLOR = "\033[0m"
percentage = percentage_match[0].to_f
@kieraneglin
kieraneglin / assert_differences.rb
Created May 27, 2017 04:53
assert_differences
def assert_differences(expression_array, by:, message: nil, &block)
expressions = Array(expression_array)
change_by = Array(by).map(&:to_i)
if expressions.size != change_by.size
raise ArgumentError, 'Each expression must have a corresponding value to change by'
end
exps = expressions.map.with_index do |e, i|
callable = e.respond_to?(:call) ? e : lambda { eval(e, block.binding) }
@xdite
xdite / 42-things.md
Created July 14, 2012 05:11
Ten (42) Things You Didn't Know Rails Could Do
@dideler
dideler / bootstrapping.md
Last active August 22, 2024 17:34
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.