Skip to content

Instantly share code, notes, and snippets.

View jhbabon's full-sized avatar
🦊

Juan Hernández jhbabon

🦊
View GitHub Profile
@jhbabon
jhbabon / 2.1.3-railsexpress
Last active August 29, 2015 14:07
ruby-build recipe for 2.1.3-railsexpress
build_package_reconfigure() {
test -f configure || autoconf
}
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
patch -p1 < rvm-patchsets/patches/ruby/2.1.3/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.3/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.3/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / 2.1.2-railsexpress
Last active June 27, 2017 11:04
ruby-build recipe for 2.1.2-railsexpress
build_package_reconfigure() {
test -f configure || autoconf
}
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
patch -p1 < rvm-patchsets/patches/ruby/2.1.2/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.2/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.2/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / lazy.rb
Created July 17, 2014 13:53
Lazy Proxy implementation in ruby 2.1
class LazyProxy < BasicObject
def self.promise(&callback)
new(&callback)
end
def initialize(&callback)
@callback = callback
end
def method_missing(method, *args, &block)
@jhbabon
jhbabon / bundle_config_example.md
Last active August 29, 2015 14:00
Pass configuration options to gems installed with bundler

For example, pass a config option to libv8 gem

$ bundle config --local build.libv8 --with-system-v8
$ cat .bundle/config
---
BUNDLE_BUILD__LIBV8: "--with-system-v8"

Now libv8 will be installed almost in the same way that gem does:

@jhbabon
jhbabon / static.go
Created February 12, 2014 14:08
Golang static files server (copy of https://coderwall.com/p/up2jbg)
package main
import "net/http"
// https://coderwall.com/p/up2jbg
func main() {
http.Handle("/", http.FileServer(http.Dir("_site")))
err := http.ListenAndServe(":8000", nil)
if err != nil {
@jhbabon
jhbabon / patch-railsexpress-output
Created February 10, 2014 15:57
Failed patch using `patch -p1 < 01-current-2.1.1-fixes.patch` from railsexpress patches.
patching file ChangeLog
patching file NEWS
patching file array.c
patching file bootstraptest/test_method.rb
patching file configure.in
patching file ext/bigdecimal/bigdecimal.c
patching file ext/bigdecimal/bigdecimal.gemspec
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file ext/bigdecimal/bigdecimal.gemspec.rej
patching file ext/openssl/ossl_ssl.c
@jhbabon
jhbabon / 2.1.0-railsexpress
Last active January 2, 2016 02:48
rbenv recipe to install 2.1.0 with railsexpress patch
build_package_reconfigure() {
test -f configure || autoconf
}
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/01-current-2.1.1-fixes.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/02-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/03-improve-gc-stats.patch
@jhbabon
jhbabon / 1.9.3-p484-railsexpress
Created November 25, 2013 07:58
rbenv recipe to install 1.9.3-p484 with railsexpress patch
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
for p in rvm-patchsets/patches/ruby/1.9.3/p484/railsexpress/* ; do
patch -p1 < $p
done
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p484" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz#8ac0dee72fe12d75c8b2d0ef5d0c2968" patch_ruby_railsexpress autoconf standard
@jhbabon
jhbabon / izanami-app-log
Created August 28, 2013 09:34
Run Izanami app showing the configuration variables
#!/usr/bin/env ruby
require 'izanami/app'
$stdout.puts '>>> Izanami configuration'
ENV.each do |var, value|
if var.to_s.match(/\AIZANAMI_/)
$stdout.puts ">>> #{var}=#{value}"
end
end
@jhbabon
jhbabon / Gemfile
Last active December 19, 2015 04:08 — forked from rhoml/clear_hipchat.rb
# A sample Gemfile
source "https://rubygems.org"
gem 'mechanize'
gem 'chronic'