Skip to content

Instantly share code, notes, and snippets.

@jonforums
jonforums / 0001-update-convenience-gem-override.patch
Created September 1, 2010 17:59
Overwrite the new missing DevKit convenience message gem override upon DK install
diff --git a/resources/devkit/dk.rb b/resources/devkit/dk.rb
index e04c1dd..b1bc04a 100644
--- a/resources/devkit/dk.rb
+++ b/resources/devkit/dk.rb
@@ -271,9 +271,15 @@ EOT
if File.exist?(target)
content = File.read(target)
- unless content.include?('DevKit')
+ case
@jonforums
jonforums / build_config.rb
Created September 2, 2010 18:29
RubyInstaller build overrides
# custom build config overrides
if ENV['OVERRIDE'] then
puts '[INFO] Overriding official build settings...'
TDM_EDGE = {
:url => :url_1,
'gcc-4.5.0-tdm-1-core.tar.lzma' => 'gcc-4.5.1-tdm-1-core.tar.lzma',
'gcc-4.5.0-tdm-1-c++.tar.lzma' => 'gcc-4.5.1-tdm-1-c++.tar.lzma'
}
MINGW_EDGE = {
@jonforums
jonforums / devkitvars.ps1
Created September 3, 2010 21:19
devkitvars for PowerShell
# convenience script residing in the DevKit root dir used for
# manually configuring a PowerShell environment to use the
# DevKit for compiling native Ruby extensions
echo "Adding DevKit to PATH..."
$devkit = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Definition)
$env:path = "$devkit\bin;$devkit\mingw\bin;$env:path"
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
--- a/runtime/doc/if_ruby.txt
+++ b/runtime/doc/if_ruby.txt
@@ -197,17 +197,28 @@
when needed. When you don't use the Ruby interface you don't need it, thus
you can use Vim even though this library file is not on your system.
-You need to install the right version of Ruby for this to work. You can find
-the package to download from:
-http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html
@jonforums
jonforums / gist:731350
Created December 7, 2010 01:57
Ruby build helper
require 'ostruct'
require 'rake/clean'
# remove CLEAN defaults since this is a "global" Rakefile which means
# the defaults could recursively delete from other peer project dirs
CLEAN.clear
FLAVORS = [
"TRUNK",
"TRUNKP",
@jonforums
jonforums / 0001-generic-gcc-builds.patch
Created December 19, 2010 19:15
Build patch for ANSICON
diff --git a/ANSI.c b/ANSI.c
index bb64c99..ddc5abc 100644
--- a/ANSI.c
+++ b/ANSI.c
@@ -1281,7 +1281,8 @@ void OriginalAttr( void )
// and terminated.
//-----------------------------------------------------------------------------
-__declspec(dllexport) // to stop MinGW exporting everything
+// use __declspec(dllexport) or -Wl,--exclude-all-symbols to stop MinGW
puts 'Press a key to begin...'; gets
n = 3
fname = File.expand_path(File.join(File.dirname(__FILE__), '..', 'input/lesmiserables.txt'))
Benchmark.bmbm do |bm|
bm.report 'Big file each_line:' do
n.times do
count = 0
File.open(fname, 'r').each_line do |line|
@jonforums
jonforums / JRuby 1.6.0RC2 (2011-02-09 5434c72 and 2011-02-25 c813123) results
Created February 4, 2011 20:39
figuring out MRI and JRuby's use of system()
C:\Users\Jon\Documents\RubyDev\sandbox>jruby --1.9 -Xlaunch.inproc=false system_ruby.rb --start
[INFO] doing some work via system()...
jruby 1.6.0.RC2 (ruby 1.9.2 patchlevel 136) (2011-02-09 5434c72) (Java HotSpot(TM) Client VM 1.6.0_24) [Windows 7-x86-java]
[INFO] OK, I'm back from the working case.
[INFO] playing with processes via system()...
[INFO] starting 1st system using '--start' style
*** FAIL: both hang with 1st system after starting .exe, never return ***
C:\Users\Jon\Documents\RubyDev\sandbox>jruby --1.9 -Xlaunch.inproc=false system_ruby.rb --cmd-start
@jonforums
jonforums / slowhello.c
Created February 19, 2011 22:08
VTune instrumented mini-app
/* build with:
* cl /Zi /Oy- slowhello.c user32.lib
* -or-
* gcc -g -o slowhello.exe slowhello.c -luser32
*
* -or to profile with VTune-
* rename libittnotify.lib to libittnotify.a
* gcc -Wall -DVTUNE_BUILD -ggdb3 -O0
* -Ic:/devlibs/vtune/include -Lc:/devlibs/vtune/lib32
* -o slowhello.exe slowhello.c -luser32 -littnotify
@jonforums
jonforums / gist:866432
Created March 11, 2011 19:34
Evaluating CherryPy 3.2's new tools.auth_digest and Mercurial
#! /usr/bin/env python
# coding: utf-8
import os
import sys
class Options(object):
pass
def main(options):