Skip to content

Instantly share code, notes, and snippets.

View derekclee's full-sized avatar

Derek Lee derekclee

View GitHub Profile
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 23, 2024 21:35
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@mudge
mudge / gist:786953
Last active November 3, 2021 08:59
How to pass blocks between methods in Ruby < 3.0.0 without using &block arguments.
# UPDATE: The ability to call Proc.new without a block was removed in Ruby 3.0.0
# See https://bugs.ruby-lang.org/issues/10499 for more information.
# So you might have heard that this is slow:
#
# def some_method(&block)
# block.call
# end
#
# Compared to: