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 / 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 / gist:4170081
Created November 29, 2012 16:15
therubyracer Segmentation fault
D:/tools/ruby192/bin/ruby.exe -S rspec ./spec/c/array_spec.rb ./spec/c/constants_spec.rb ./spec/c/exception_spec.rb ./spec/c/external_spec.rb ./spec/c/function_spec.rb ./spec/c/handles_spec.rb ./spec/c/locker_spec.rb ./spec/c/object_spec.rb ./spec/c/script_spec.rb ./spec/c/string_spec.rb ./spec/c/template_spec.rb ./spec/c/trycatch_spec.rb ./spec/mem/blunt_spec.rb ./spec/redjs_spec.rb ./spec/threading_spec.rb ./spec/v8/context_spec.rb ./spec/v8/conversion_spec.rb ./spec/v8/error_spec.rb ./spec/v8/function_spec.rb ./spec/v8/object_spec.rb --tag ~memory --tag ~threads
Run options: exclude {:memory=>true, :threads=>true}
d:/projects/therubyracer/spec/c/array_spec.rb:8: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
-- control frame ----------
c:0031 p:---- s:0107 b:0107 l:000106 d:000106 CFUNC :Set
c:0030 p:0087 s:0102 b:0102 l:002514 d:000101 BLOCK d:/projects/therubyracer/spec/c/array_spec.rb:8
c:0029 p:---- s:0098 b:0098 l:000097 d:000097 FINISH
c:0028 p:---- s:0096 b:0096 l:000095 d:00
@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
@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;