Skip to content

Instantly share code, notes, and snippets.

View Nerian's full-sized avatar

Gonzalo Rodríguez-Baltanás Díaz Nerian

View GitHub Profile
class MyTestClass
def cucu
tra(1)
tra(2)
end
def tra(args)
end
end
➜ projects zsh --version
zsh 5.0.5 (x86_64-apple-darwin13.0.0)
➜ projects rvm get stable --auto-dotfiles
Warning! PATH is not properly set up, '/Users/Nerian/.rvm/gems/ruby-2.1.1/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.
class ConcurrencyTestApp < Sinatra::Base
get "/asynch_test" do
Net::HTTP.get(URI("http://localhost:5000/long_call"))
"Hello world"
end
get "/long_call" do
sleep 4
end
#!/usr/bin/env ruby
#
# Locates and removes Homebrew installation
# http://brew.sh/
#
# Author: Stephen Benner
# https://github.com/SteveBenner
# https://gist.github.com/SteveBenner/11254428
#
require 'optparse'
➜ bundler git:(backport_to_186) rake spec
/Users/Nerian/projects/bundler/lib/bundler/lockfile_parser.rb:56:in `<class:LockfileParser>': uninitialized constant Bundler::Source::SVN (NameError)
from /Users/Nerian/projects/bundler/lib/bundler/lockfile_parser.rb:14:in `<module:Bundler>'
from /Users/Nerian/projects/bundler/lib/bundler/lockfile_parser.rb:13:in `<top (required)>'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler/definition.rb:58:in `initialize'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler/dsl.rb:178:in `new'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler/dsl.rb:178:in `to_definition'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler/dsl.rb:11:in `evaluate'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler/definition.rb:26:in `build'
from /Users/Nerian/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.2/lib/bundler.rb:153:in `definition'
Failure/Error: expect { clinic.create_invoice(invoice_attributes.merge({:invoice_number => '2012 - 5'})) }.to_not change{ clinic.next_invoice_number.number }.from(1).to(2)
NotImplementedError:
`expect { }.not_to change { }.to()` is not supported
@Nerian
Nerian / gist:6ea104736101ad7bb103
Created January 30, 2015 11:55
too many gems
HTTP GET https://bundler.rubygems.org/api/v1/dependencies
HTTP 200 OK
Fetching gem metadata from https://rubygems.org/
Query List: ["rails", "mongoid", "sass-rails", "uglifier", "coffee-rails", "jquery-rails", "turbolinks", "jbuilder", "slim-rails", "bootstrap-sass", "autoprefixer-rails", "simple_form", "country_select", "bcrypt", "sorcery", "reform", "mongoid-enum", "bootstrap-typeahead-rails", "dropbox-sdk", "carrierwave", "carrierwave-mongoid", "font-awesome-rails", "pundit", "mongoid-sadstory", "dropzonejs-rails", "bootstrap-datepicker-rails", "rails-i18n", "bootstrap-wysihtml5-rails", "cocoon", "jquery-ui-rails", "rails_12factor", "rspec-rails", "capybara", "guard-rspec", "ruby_gntp", "selenium", "letter_opener_web", "rails_admin", "quiet_assets", "better_errors", "binding_of_caller", "powder", "fabrication", "database_cleaner", "pry-rails"]
Query Gemcutter Dependency Endpoint API: rails,mongoid,sass-rails,uglifier,coffee-rails,jquery-rails,turbolinks,jbuilder,slim-rails,bootstrap-sass,autoprefixer-rails
@Nerian
Nerian / Hash
Created May 24, 2011 20:06
Merger
Download the hash at:
http://dl.dropbox.com/u/834494/hash
class Tasks::EditTaskWidget < Apotomo::Widget
cache :display do |cell, course, task|
course.id.to_s + task.id.to_s
end
def display(course, task)
@course = course
@task = task
render
require 'formula'
class Redis < Formula
homepage 'http://redis.io/'
url 'https://github.com/antirez/redis/tarball/v1.3.10'
sha1 'e4d22d8b0df0e9d686069a40bff4b91219c68676'
head 'https://github.com/antirez/redis.git', :branch => 'unstable'
devel do