Skip to content

Instantly share code, notes, and snippets.

View dorianmariefr's full-sized avatar
💭
GitHubbing

Dorian Marié (perso) dorianmariefr

💭
GitHubbing
View GitHub Profile
@jodosha
jodosha / benchmark.rb
Created July 22, 2020 07:37
Ruby Method Overloading
View benchmark.rb
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
View 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
View rspec_backtrace_exclusion.md

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 May 31, 2023 13:30
Optimise your pngs from the terminal in OSX
View optimise-images-terminal.md

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
View LC_CTYPE.txt
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 November 21, 2023 00:06
Capybara cheatsheet
View Capybara.md

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above