Skip to content

Instantly share code, notes, and snippets.

View jhbabon's full-sized avatar
🦊

Juan Hernández jhbabon

🦊
View GitHub Profile
@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 / 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 / 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 / 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 / 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.4-railsexpress
Created November 13, 2014 15:34
ruby-build recipe for 2.1.4-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.4/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.4/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.4/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / 2.1.5-railsexpress
Created December 2, 2014 17:02
ruby-build recipe for 2.1.5-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.5/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.5/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.5/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / 2.1.6-railsexpress
Created April 21, 2015 10:35
ruby-build recipe for 2.1.6-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.6/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.6/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.6/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / 2.2.3-railsexpress
Created August 25, 2015 06:11
ruby-build recipe for 2.2.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.2.3/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.2.3/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.2.3/railsexpress/03-display-more-detailed-stack-trace.patch
@jhbabon
jhbabon / gist:747457
Created December 19, 2010 16:32
Template for XeTeX documents
% Plantilla para documentos XeTeX
\documentclass[10pt]{report}
% LAYOUT
\usepackage[a4paper]{geometry}
%% Márgenes
\geometry{
includeheadfoot,
twoside,