Skip to content

Instantly share code, notes, and snippets.

@jonforums
jonforums / x86-worker.bat
Created October 8, 2012 00:56
RI Jenkins CI slave script
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
:: EDIT THIS CONFIGURATION
:: Remove unnecessary env vars
SET ANDROID_HOME=
SET ChocolateyInstall=
SET GNUWIN=
SET INTEL_LICENSE_FILE=
@jonforums
jonforums / build_summary
Created September 26, 2012 18:58
Building EM on Win7 32bit
# IMPORTANT: ruby built with same mingw-w64 based toolchain as used to build EM
# beware `config.h` diffs due to toolchain header diffs
C:\Users\Jon\Documents\CDev\eventmachine-git>ruby --version && gcc --version
ruby 2.0.0dev (2012-09-26 trunk 37036) [i386-mingw32]
gcc (rubenvb-4.7.2-release) 4.7.2
C:\Users\Jon\Documents\CDev\eventmachine-git>rake compile
...
linking shared-object rubyeventmachine.so
@jonforums
jonforums / WinSDK_71_cmd_line_tools
Created September 20, 2012 14:28
Building ninja on Win7 32bit
C:\Users\Jon\Documents\CDev\ninja-git>cl -h
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
C:\Users\Jon\Documents\CDev\ninja-git>set VCINSTALLDIR="c:\Program Files\Microsoft Visual Studio 10.0\VC"
C:\Users\Jon\Documents\CDev\ninja-git>python configure.py --with-gtest=C:\Users\Jon\Documents\CDev\gtest
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
wrote build.ninja.
C:\Users\Jon\Documents\CDev\ninja-git>ninja ninja_test
@jonforums
jonforums / gist:2882943
Created June 6, 2012 16:06
Exploring Snow Leopard VM on Win7 32bit
#### Revision: 2012-06-06
### Overview
Don't be a leech. Swagger over to the Apple Store and pony up ~$30 for the
retail Mac OS X Snow Leopard install DVD. Don't whine, just do it.
There are a number of blog posts dealing with installing either Snow Leopard or
Lion in VirtualBox. None of them worked for my Win7 Ultimate 32bit Dell Studio
15 system with a paltry 4GB. Yes, I've been holding out a new Ivy Bridge system
@jonforums
jonforums / mruby_hello.c
Created June 3, 2012 23:17
embedded mruby Hello World
/* Copyright (c) 2012 Jon Maken
* License: 3-clause BSD
* Revision: 2012-06-04 14:35:54 -0600
*
* typical Clang/MinGW build recipe:
* set CPATH=C:/devlibs/mruby/include
* set LIBRARY_PATH=C:/devlibs/mruby/lib
*
* clang -Wall -O3 -march=native -o mruby_hello.exe mruby_hello.c -lmruby
*
@jonforums
jonforums / gist:2763401
Created May 21, 2012 17:23
RI, ruby_1_9_3 and mingw64-32-4.6.3
Win7 Ultimate 32bit SP1
C:\Users\Jon\Documents\RubyDev\ruby-git>git log -5 --oneline
5d43f34 merge revision(s) 35451:
e050fc1 merge revision(s) 35434:
ca27aa8 merge revision(s) 35433:
28db237 merge revision(s) 35424:
336c45e merge revision(s) 35422:
C:\projects\rubyinstaller-git>rake ruby19 local=c:\Users\Jon\Documents\RubyDev\ruby-git dkver=mingw64-32-4.6.3
@jonforums
jonforums / xp_gmtime_r.c
Created May 15, 2012 11:49
portable gmtime_r testing
#include <stdio.h>
#include <string.h>
#include <time.h>
#if defined(__MINGW64_VERSION_MAJOR)
/* XXX why isn't this in sec_api/time_s.h? */
# if defined(_USE_32BIT_TIME_T)
# define gmtime_s _gmtime32_s
# else
# define gmtime_s _gmtime64_s
@jonforums
jonforums / download.rb
Created March 26, 2012 01:15
Ruby HTTP/HTTPS/FTP file downloader
#!/usr/bin/env ruby
# An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's
# HTTP implementation.
#
# Author: Jon Maken
# License: 3-clause BSD
# Revision: 2012-03-25 23:01:19 -0600
require 'net/http'
require 'net/https' if RUBY_VERSION < '1.9'
@jonforums
jonforums / hilite_bug.rb
Created January 12, 2012 19:35
Nanoc code highlighting experiment
# run via: ruby [-Ilib] hilite_bug.rb
# ruby [-Ilib] hilite_bug.rb > nanoc_hl.html 2> nokogiri_out.txt
begin
require 'nanoc'
require 'nanoc/filters'
require 'nanoc/helpers'
include Nanoc::Helpers::HTMLEscape
rescue LoadError
require 'nanoc3'
@jonforums
jonforums / file.c.patch
Created December 21, 2011 14:30
TCS merge patch resolution
diff --git a/file.c b/file.c
index 81f28ff..f499aaf 100644
--- a/file.c
+++ b/file.c
@@ -2819,6 +2819,20 @@ ntfs_tail(const char *path)
buflen = RSTRING_LEN(result),\
pend = p + buflen)
+#define EXPAND_PATH()\
+ if ( !(abs_mode & FEP_DIR_EXPANDED) ) { \