config/database.yml
test:
adapter: sqlite3
database: ":memory:"
config/spring.rb
PS1='\[\e[35m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]:\[\e[93m\]\w\[\e[m\]$(__git_ps1 \("%s"\)) \[\e[92m\]\t\[\e[m\] \$' |
#!/bin/sh | |
if [ $# -eq 0 ]; then | |
echo "Please provide arguments at least 1 argument. You use the command as following" | |
echo "sptest test_file" | |
echo "sptest test_file test_case" | |
else | |
if [ $# -eq 2 ]; then | |
test_case=$2 | |
test_case=${test_case// /_} |
dpkg-query -l | grep -i audio | grep -oP '[rci]{2}\s{2}\K(\w*[\:\-\.]*\w*)*' | perl -e 's/\n/\s/g' -pi |
RAILS_VERSION = '4.2.0' # switch '4.1.8' '4.2' | |
# Remember to rm Gemfile when switch version. | |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', '#{RAILS_VERSION}' | |
gem 'sqlite3' | |
gem 'pg' | |
gem 'byebug' |
ENV['RAILS_ENV'] = 'development' | |
require File.expand_path('../../config/environment', __FILE__) | |
RAILS_VERSION = Rails.version | |
ITERATIONS = 5 | |
# Database contains : | |
# 10_000 issues | |
# 30 categories | |
# 3 trackers |
Here the result of the benchmark :
user system total real
Iteration n: 1
Rails 4.1.8 : 1 relation 0.490000 0.020000 0.510000 ( 0.531127)
Rails 4.1.8 : 2 relations 0.530000 0.020000 0.550000 ( 0.554869)
Rails 4.1.8 : 1 nested relation 0.570000 0.020000 0.590000 ( 0.607984)
Iteration n: 2
logger.formatter = ->(severity, datetime, progname, msg) do | |
"#{datetime.strftime('%Y-%m-%d %H:%M:%S')} - #{sprintf('%-5s',severity)} - #{msg}\n" | |
end |
require 'Benchmark' | |
ITERATION = 100_000 | |
Benchmark.bm(27) do |bm| | |
bm.report('TEST 1') do | |
ITERATION.times do | |
# test 1 content | |
end |
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:\"%C(yellow)%h %C(cyan)%ad %C(white)| %s%C(green bold)%d %Creset%C(magenta)[%an]\" --graph --date=rfc | |
type = cat-file -t | |
dump = cat-file -p |