Skip to content

Instantly share code, notes, and snippets.

View stereobooster's full-sized avatar
🇺🇦
stand with Ukraine

stereobooster

🇺🇦
stand with Ukraine
View GitHub Profile
@stereobooster
stereobooster / Gemfile
Created June 1, 2012 13:11
profile rb-fchange
source :rubygems
gem 'ruby-prof', :git => "https://github.com/wycats/ruby-prof.git"
# gem 'perftools.rb', :git => 'git://github.com/tmm1/perftools.rb.git'
gem 'rb-fchange'
gem 'listen'
@stereobooster
stereobooster / readme.md
Created June 19, 2012 06:31
Underscore string descending sortBy
/**
* Underscore string descending sortBy
* usage:
* Sort by name ascending `_.sortBy(data, string_comparator('name'));`
* Sort by name descending `_.sortBy(data, string_comparator('-name'));`
*/
var string_comparator = function(param_name, compare_depth) {
if (param_name[0] == '-') {
param_name = param_name.slice(1),
compare_depth = compare_depth || 10;
@stereobooster
stereobooster / 0 linux shared
Created June 26, 2012 11:59
Cross compile v8 with scons and MinGW
$ scons os=win32 toolchain=crossmingw library=shared
scons: Reading SConscript files ...
#######################################################
# WARNING: Building V8 with SCons is deprecated and #
# will not work much longer. Please switch to using #
# the GYP-based build now. Instructions are at #
# http://code.google.com/p/v8/wiki/BuildingWithGYP. #
#######################################################
@stereobooster
stereobooster / 0log
Created June 30, 2012 07:02
therubyracer windows mingw scons library static
D:\projects\therubyracer>bundle exec rake compile
mkdir -p tmp/i386-mingw32/init/1.9.2
cd tmp/i386-mingw32/init/1.9.2
D:/tools/ruby-1.9.2-p290-i386-mingw32/bin/ruby.exe -I. ../../../../ext/v8/extcon
f.rb
checking for main() in -lpthread... no
creating Makefile
cd -
cd tmp/i386-mingw32/init/1.9.2
make
@stereobooster
stereobooster / gist:3047670
Created July 4, 2012 14:32
therubyracer cross compilation
i586-mingw32msvc-g++ -shared -s -o init.so exception.o locker.o handles.o message.o backref.o template.o value.o primitive.o constraints.o heap.o function.o object.o string.o init.o array.o v8.o stack.o constants.o trycatch.o script.o invocation.o gc.o accessor.o external.o rr.o date.o context.o signature.o -L. -L/home/test/.rake-compiler/ruby/ruby-1.9.2-p320/lib -L/home/test/projects/v8/libv8.a -L. -Wl,--enable-auto-image-base,--enable-auto-import init-i386-mingw32.def -lmsvcrt-ruby191 -lwinmm -lshell32 -lws2_32
exception.o:/home/test/projects/therubyracer/tmp/i386-mswin32/init/1.9.2/../../../../ext/v8/exception.cc:36: undefined reference to `v8::Exception::Error(v8::Handle<v8::String>)'
exception.o:/home/test/projects/therubyracer/tmp/i386-mswin32/init/1.9.2/../../../../ext/v8/exception.cc:32: undefined reference to `v8::Exception::TypeError(v8::Handle<v8::String>)'
exception.o:/home/test/projects/therubyracer/tmp/i386-mswin32/init/1.9.2/../../../../ext/v8/exception.cc:28: undefined reference to `v8::E
@stereobooster
stereobooster / gist:3235421
Created August 2, 2012 08:27
Track 404 with google analytics
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview', '/404?p=' + encodeURIComponent(document.location.pathname + document.location.search) + '&r=' + encodeURIComponent(document.referrer)]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
@stereobooster
stereobooster / gist:3845607
Created October 6, 2012 17:49
posix-spawn windows error
Run options:
# Running tests:
.........EEE.....FFF.EEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEE.EEEEF.....FEFEEEE.FFF...F...FF.F...F.EEEEEEEEEEEEEEEEFEEEEEEEEEEEEEEEEFE....F.....
Finished tests in 4.093234s, 33.7142 tests/s, 39.0889 assertions/s.
1) Error:
test_input(ChildTest):
@stereobooster
stereobooster / jekyll-yui-css.rb
Created October 26, 2012 15:28
jekyll-yui-css
require 'yui/compressor'
require 'uglifier'
module Jekyll
module Compressor
def output_file(dest, content)
FileUtils.mkdir_p(File.dirname(dest))
File.open(dest, 'w') do |f|
f.write(content)
end