Skip to content

Instantly share code, notes, and snippets.

@JarLowrey
JarLowrey / benchmark_ruby_string_id_creation.rb
Created July 16, 2017 20:34
Benchmark for Ruby String ID creation
require 'benchmark'
#RESULTS - 100k iterations
# user system total real
# 0.590000 0.000000 0.590000 ( 0.594802) <- create_id_num - int to radix
# 0.270000 0.000000 0.270000 ( 0.267420) <- create_id_str - choosing random characters
@radix = ('0'..'9').to_a + ('a'..'z').to_a + ['$','-','_','+','!','*','(',')',','] #URL safe, lowercase characters
def self.custom_radix_to_s val, digits
@JarLowrey
JarLowrey / vs_code_settings.json
Created April 9, 2018 01:33
Visual Studio Code personal settings
{
"terminal.integrated.shellArgs.linux": [ //login shell
"--login"
],
"files.associations": {
"*.html.md.erb": "markdown", #Middleman
// "*.jsx": "javascript"
}
}