Skip to content

Instantly share code, notes, and snippets.

View dorianmariecom's full-sized avatar

Dorian Marié dorianmariecom

View GitHub Profile
@jodosha
jodosha / benchmark.rb
Created July 22, 2020 07:37
Ruby Method Overloading
require "benchmark/ips"
require_relative "./method_overloading"
class Foo
include MethodOverloading
def call(number)
"foo #{number}"
end
end
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@mmcdaris
mmcdaris / rspec_backtrace_exclusion.md
Last active January 15, 2021 15:02
Exclude gem lines from RSpec backtrace

Purpose

Excludes gem related lines in your rspec backtraces.
Useful when you only want to see backtrace lines from your app and spec code.

example .rspec file

note: path to helper file is relative

# File: .rspec
--require ./tmp/rspec_helper.rb
@gielcobben
gielcobben / optimise-images-terminal.md
Last active April 16, 2024 23:38
Optimise your pngs from the terminal in OSX

JPG:
$ brew install jpegoptim
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

- PNG:
$ brew install optipng
$ find . -name "*.png" -exec optipng -o7 {} \;

@jampajeen
jampajeen / LC_CTYPE.txt
Created November 21, 2015 13:02
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@tomas-stefano
tomas-stefano / Capybara.md
Last active May 21, 2024 02:09
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above