This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'json/ext' | |
iterations = 1_000_000 | |
hash = { who: 'Me', first_name: 'Alexey', last_name: 'Black', title: 'Doctor', | |
birthdate: Time.now, favorite_color: 'transparent', car: 'BMW', hands: 2, | |
city: 'Quanzi', planet: 'Third' } | |
Benchmark.bm(27) do |bm| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BetterErrors.editor = ->(file, line) { "x-mine://open?file=#{file}&line=#{line}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ESC="\033" # This is the escape sequence | |
NO_COLOR="$ESC[0m" | |
IRED="$ESC[1;31m" # ANSI color code for intense/bold red | |
IGRN="$ESC[1;32m" # ANSI color code for intense/bold green | |
# From http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/ | |
# I had to change 'git-symbolic-ref' to 'git symbolic-ref' | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ["${ref#refs/heads/}"]" # I wanted my branch wrapped in [], use () or <> or whatever |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows to post coverage data to remote services like Codeclimate & Coversall and use simplecov locally | |
# to view coverage locally, run: rake spec COV=true | |
# add file on the top for spec_helper: require 'coverage_reporters.rb' | |
require 'simplecov' | |
require 'coveralls' | |
require "codeclimate-test-reporter" | |
reporters = [ | |
(Coveralls::SimpleCov::Formatter if Coveralls.will_run?), | |
(CodeClimate::TestReporter::Formatter if CodeClimate::TestReporter.run?), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.smtp_settings = { | |
:address => 'smtp.gmail.com', | |
:port => 587, | |
:domain => 'gmail.com', | |
:user_name => '', | |
:password => '', | |
:authentication => 'plain', | |
:enable_starttls_auto => true | |
} |
NewerOlder