I hereby claim:
- I am kdisneur on github.
- I am kdisneur (https://keybase.io/kdisneur) on keybase.
- I have a public key whose fingerprint is 6788 1927 15C5 4ABA 18BA 8564 6D50 AEFB 5386 EAB3
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report('String') { 1_000_000.times { "ma_valeur" } } | |
x.report('String to_sym') { 1_000_000.times { "ma_valeur".to_sym } } | |
x.report(':String') { 1_000_000.times { :"ma_valeur" } } | |
x.report('sym') { 1_000_000.times { :ma_valeur } } | |
end | |
# user system total real |
require 'benchmark' | |
class A | |
def double_with_hash_param(h) | |
h[:value] * 2 | |
end | |
def double_with_reused_hash_param(h) | |
h[:value] | |
h[:value] * 2 |
require './lib/ordinal_array' | |
require "benchmark" | |
number_values = (0...999).sort_by{rand} | |
number_letters = [ | |
:first, :second, :third, :fourth, :fifth, :sixth, :seventh, :eighth, :ninth, | |
:tenth, :eleventh, :twelfth, :thirteenth, :fourteenth, :fifteenth, :sixteenth, :seventeenth, :eighteenth, :nineteenth, | |
:twentieth, :twenty_first, :twenty_second, :twenty_third, :twenty_fourth, :twenty_fifth, :twenty_sixth, :twenty_seventh, :twenty_eighth, :twenty_ninth, | |
:thirtieth, :thirty_first, :thirty_second, :thirty_third, :thirty_fourth, :thirty_fifth, :thirty_sixth, :thirty_seventh, :thirty_eighth, :thirty_ninth, | |
:fortieth, :fourty_first, :fourty_second, :fourty_third, :fourty_fourth, :fourty_fifth, :fourty_sixth, :fourty_seventh, :fourty_eighth, :fourty_ninth, |
syntax on | |
filetype plugin indent on | |
set nowrap | |
set tabstop=2 | |
set autoindent " always set autoindenting on | |
set copyindent " copy the previous indentation on autoindenting | |
set number " always show line numbers | |
set shiftwidth=2 " number of spaces to use for autoindenting | |
set shiftround " use multiple of shiftwidth when indenting with '<' and '>' | |
set showmatch " set show matching parenthesis |
module SpecialAttributes | |
module ClassMethods | |
def attr_special(*attrs) | |
class_attribute :special_attributes | |
self.special_attributes = attrs | |
end | |
def special_attributes | |
self.special_attributes | |
end |
set -sg escape-time 1 | |
set -g base-index 1 | |
set-window-option -g pane-base-index 1 | |
set-window-option -g automatic-rename off | |
# pane configuration | |
bind | split-window -h | |
bind - split-window -v | |
bind h select-pane -L |
#! /bin/sh | |
env=${1:-test} | |
for action in drop create migrate; do | |
RAILS_ENV=$env rake db:$action; | |
done |
color_pattern='#[a-fA-F0-9]{3,6}'; | |
for color in $(find app/assets/stylesheets -iname '*.scss*' -exec grep -oE "${color_pattern}([^_-]|$)" {} \; | grep -oE $color_pattern | sort | uniq); do | |
if [ $color != ':' ]; then | |
echo "couleur: $color, occurences: $(grep -R $color app/assets/stylesheets | wc -l)" | |
fi | |
done |