Skip to content

Instantly share code, notes, and snippets.

View divoxx's full-sized avatar

Rodrigo Kochenburger divoxx

  • Doximity
  • San Francisco, CA
View GitHub Profile
@divoxx
divoxx / lame_gems.rb
Last active December 15, 2015 19:59 — forked from maletor/lame_gems.rb
Then anyone could have group "user@email.com" do end
groups = Rails.groups(assets: %w(development test))
unless Rails.env.production?
user = `cd "#{Rails.root}" && git config user.email`.chomp
groups << user unless user.blank?
end
Bundler.require(*groups)
func loadWebshims() {
scr = document.createElement("script")
scr.type = "text/javascript"
scr.src = "#{asset_path('javascript.js')"
document.head.appendChild(scr)
}
setTimeout(loadWebshims, 0)
Installing libv8 (3.3.10.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/divoxx/.rbenv/versions/ree-1.8.7-2012.02/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
package main
import (
"fmt"
"math"
"sort"
)
// Wraps a slice of ints with a target num and define sorting by distance from element and the num
type IntDistSlice struct {
class RomanNumeral
VALUE_MAPPER = [['M', 1000], ['D', 500], ['L', 50], ['X', 10], ['IX', 9], ['V', 5], ['IV', 4], ['I', 1]]
def initialize(int)
@int = int.freeze
end
def to_roman
output = ''
num = @int
@divoxx
divoxx / gist:2406319
Created April 17, 2012 14:29 — forked from arbylee/gist:2396008
RomanNumerals
class RomanNumeral
VALUE_MAPPER = [['M', 1000], ['D', 500], ['L', 50], ['X', 10], ['IX', 9], ['V', 5], ['IV', 4], ['I', 1]]
def roman num
output = ''
while num > 0
VALUE_MAPPER.each do |letter, letter_value|
num_of_letters = (num / letter_value)
package main
/*
* This is just a example to ilustrate the issue, don't conside this is the actual code ;)
* I'm mixing the graph package and the main (application) package to illustrate the problem
*/
import "log"
// graph package below
@divoxx
divoxx / gist:1401911
Created November 28, 2011 20:33
Reinstall all gems
gem list | cut -d ' ' -f 1 | tee gems.txt | xargs gem uninstall -I -a && for path in $(echo `gem env path` | tr ":" "\n"); do rm -rf ${path}/specifications/* ${path}/cache/*; done && cat gems.txt | xargs gem install
rm gems.txt
roar_test.rb:11:in `initialize': wrong number of arguments(1 for 0) (ArgumentError)
from roar_test.rb:11:in `new'
from roar_test.rb:11:in `<main>'
divoxx@wizard ~ : goinstall go-gb.googlecode.com/hg/gb
/bin/bash: === cd /usr/local/Cellar/go/HEAD/src/pkg/go-gb.googlecode.com/hg/gb; bash gomake -f- install
6g -I "/usr/local/Cellar/go/HEAD/pkg/darwin_amd64" -I "/usr/local/share/go/pkg/darwin_amd64" -o _go_.6 build.go cgo.go deps.go files.go gb.go genmake.go gentest.go gofix.go gofmt.go goinstall.go make.go pkg.go protobuf.go query.go runext.go usage.go util.go
pkg.go:255: cannot use this (type *Package) as type filepath.WalkFunc in function argument
pkg.go:255: too many arguments in call to filepath.Walk
make: *** [_go_.6] Error 1
--- exit status 2
goinstall: go-gb.googlecode.com/hg/gb: install: running bash: exit status 2