Skip to content

Instantly share code, notes, and snippets.

View thibaudgg's full-sized avatar

Thibaud Guillaume-Gentil thibaudgg

View GitHub Profile
class Test
end
require 'rubygems'
require 'wirble'
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
Wirble.init(:skip_history => true)
Wirble.colorize
We couldn’t find that file to show.
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@thibaudgg
thibaudgg / truncate_middle.rb
Created May 19, 2010 10:09
truncate in the middle like Finder
# If text is longer than +options[:length]+ (defaults to 30), text will be middle-truncated
# and the last characters will be replaced with the +options[:omission]+ (defaults to "...").
def truncate_middle(text, *args)
options = args.extract_options!
options.reverse_merge!(:length => 30, :omission => "...")
if text
if text.mb_chars.length <= options[:length]
text
else
@thibaudgg
thibaudgg / its_spec.rb
Created June 2, 2010 08:13
RSpec 2.0.0.beta.9 its problem
require 'rspec'
class Foo
def bar
nil
end
def bar2
1
require 'rubygems'
require 'spork'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
- Spork Diagnosis -
-- Summary --
config/application.rb
config/boot.rb
config/environment.rb
config/initializers/action_view_field_error_proc.rb
config/initializers/active_merchant.rb
config/initializers/backtrace_silencers.rb
config/initializers/carrierwave.rb
config/initializers/constants.rb
@thibaudgg
thibaudgg / irbrc
Created June 12, 2010 19:41
irbrc compatible with Rails 3
# ===========
# = Configs =
# ===========
%w[rubygems wirble pp].each do |gem|
begin
require gem
rescue LoadError => err
warn "Please do: gem install #{gem.sub(/\/.*/,'')}"
end
---
- !ruby/struct:VCR::HTTPInteraction
response: !ruby/struct:VCR::Response
body: &id002 !str
str: ""
"@net_http_res": !ruby/object:Net::HTTPOK
body: *id002