Skip to content

Instantly share code, notes, and snippets.

View Vasfed's full-sized avatar

Vasily Fedoseyev Vasfed

View GitHub Profile
# benchmark for http://stackoverflow.com/questions/34511759/remove-superstrings-from-an-array/34511965
require 'benchmark'
source = [ "Rough Collie", "Alsatian", "Standard Poodle", "Poodle", "Collie", "Schnauser", "Border Collie", "Chihuahua" ]
n = 100000
Benchmark.bm do |x|
x.report('delete_if+any') {
n.times{
@Vasfed
Vasfed / averages
Created December 10, 2014 16:20
Averages for goalsmashers css bench results
//add averages to http://goalsmashers.github.io/css-minification-benchmark/
//use jquery
var body = document.getElementsByTagName("body")[0];
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";
var f = function(){
@Vasfed
Vasfed / Gemfile
Created December 13, 2012 02:02
Ruby Symbol#to_proc bug example
source :rubygems
gem 'colorize'
gem 'heap_dump', git:'git://github.com/Vasfed/heap_dump.git'
@Vasfed
Vasfed / rvm.sh
Created April 19, 2012 16:42
Fix rvm bundled patch and install ruby 1.9.3-p125 with railsexpress patches
rvm get head
rvm reload
curl https://raw.github.com/Vasfed/rvm-patchsets/master/patches/ruby/1.9.3/p125/railsexpress/02-railsbench-gc.patch > $rvm_path/patches/ruby/1.9.3/p125/railsexpress/02-railsbench-gc.patch
rvm reinstall 1.9.3-p125 --patch railsexpress -n railsexpress
rvm use 1.9.3-p125-railsexpress
echo May be done