Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@pepe
pepe / gist:947959
Created April 29, 2011 06:54
CityHash on MacOS X with ruby 1.9.2 from rvm
>> require 'cityhash'
LoadError: Could not open library '/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so': dlopen(/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so, 5): no suitable image found. Did find:
/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:75:in `block in ffi_lib'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:54:in `map'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:54:in `ffi_lib'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:11:in `<module:Internal>'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:8:in `<module:CityHash>'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:3
@pepe
pepe / dr-ape.rb
Created April 29, 2011 08:58
Dr.Ape issues
require "rubygems"
require "sinatra"
require "net/http"
require "net/https"
require "uri"
get "/:status?" do
erb :index
end
@pepe
pepe / create_picka.rb
Created May 6, 2011 08:47
Skript na vytvoření studenta pícky
s=Student.new
s.firstname="Marek"
s.lastname="Pícka"
s.title_before_id=1
s.save
i=Index.new
i.student=s
i.department_id=25
i.specialization_id=1004
@pepe
pepe / my-gh-issues.rb
Created May 9, 2011 07:11 — forked from copiousfreetime/my-gh-issues.rb
My Github Issues
#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
# encoding: UTF-8
Before do
FontRenderer.stub!(:render_user_text).and_return(true)
FontRenderer.stub!(:render_tester_text).and_return(true)
end
Given /^I visit the home page$/ do
visit '/'
end
@pepe
pepe / Gemfile.lock
Created May 16, 2011 13:56
padrino reload issue
GIT
remote: git://github.com/LastStar/ft2-ruby
revision: 5f5b74959711feb1d0f9b2151871087375ddffd5
specs:
ft2-ruby (0.1.3)
GIT
remote: git://github.com/LastStar/glyphr
revision: 5e143f37ebc686c669ed390012a3073c9f8dcd50
specs:
@pepe
pepe / cart_helper.rb
Created May 16, 2011 15:23
Suitcasetype cart controller
# Helper methods defined here can be accessed in any controller or view in the application
SuitcasetypeCom.helpers do
#TODO cart must be modeled!!!
def initialize_cart
session[:cart] ||= {:styles => [], :fonts => [], :price => 0}
end
def add_to_cart(product)
initialize_cart
Bundler
Mongoid
Boolean
Binary
Gem
Complex
Rational
FiberError
Fiber
ThreadError
SuitcasetypeCom.routes.map(&:path) =>
["/cart", "/cart", "/cart/add_style", "/cart/add_font", "/cart/add_favorites", "/cart/remove_style(.:format)", "/cart/remove_font(.:format)", "/cart/thrash(.:format)", "/cart/thrash(.:format)", "/cart/change_currency(.:format)", "/cart/checkout(.:format)", "/cart/overview(.:format)", "/cart/overview(.:format)", "/customer/login", "/customer/register", "/customer/edit", "/customer/edit", "/customer/update", "/favorite/:id", "/favorite/:id", "/defavorite/:id", "/defavorite/:id", "/favorites", "/favorites", "/font/:slug", "/font/:slug", "/fonts", "/fonts", "/about/:slug", "/about/:slug", "/fonts/filter", "/fonts/filter", "/license/font/:count/:id", "/license/font/:count/:id", "/license/font", "/license/style", "/blog", "/blog", "/blog/:slug", "/blog/:slug", "/tag/:tag", "/tag/:tag", "/blog/inuse/:name", "/blog/inuse/:name", nil, nil, "", "", "/join", "/styles/:slug", "/styles/:slug", "/styles/:slug", "/tester", "/tester", "/options/:slug(.:format)", "/options/:slug(.:format
=> File size is: 8
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/cart.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/customer.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/favorites.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/font.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/license.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/post.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/root.rb:uninitialized constant Reloader
=> Load /Users/pepe/Projects/fun/suitcasetype.com/app/controllers/samples.rb:uninitialized constant Reloader
NameError: uninitialized constant Reloader