Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Available for freelancing

Joaquín Vicente wacko

👨‍💻
Available for freelancing
Block or report user

Report or block wacko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wacko
wacko / wtf_patch.rb
Created Feb 14, 2014
Rails freezes when trying to generate a broken route
View wtf_patch.rb
# Related: https://github.com/rails/rails/issues/1525#issuecomment-1782439
# Rails freezes when
module ActionDispatch
module Routing
class RouteSet
def inspect
# The solution is... to throw a random exception (to halt the normal flow, I think)
wtf!
end
end
@wacko
wacko / example.rb
Created Apr 20, 2015
Very simple and stupid key-value store using ActiveRecord
View example.rb
# Use KeyValue to store globally unique data
KeyValue.set('api_key', '123') # => true
KeyValue.get('api_key') # => '123'
# You can use the alternate syntax:
KeyValue['api_key'] = '123' # => true
KeyValue['api_key'] # => '123'
@wacko
wacko / app.rb
Created May 14, 2015
Cuba basic test
View app.rb
require 'cuba'
class MyApp < Cuba
define do
on root do
res.write "it works!"
end
end
@wacko
wacko / OfferPageBuilder.rb
Created Nov 29, 2012
Parte de la lógica que hay que sacar de OfferPage a un Builder
View OfferPageBuilder.rb
class OfferPageBuilder
def initialize(account)
@account = account
end
def build
page = OffersPage.new {
name: "Special Offers",
heading: "Special Offers on Dental Services in #{@account.geo_keyword}, #{@account.state}",
@wacko
wacko / gist:4221847
Created Dec 6, 2012
Search Engine (shorcuts)
View gist:4221847
Gmail
https://mail.google.com/mail/u/0/#inbox
Calendar
https://www.google.com/calendar/render?tab=mc
Delicious
http://www.delicious.com/joaquinvicente/%s
Google Maps (Ciudad de BsAs)
@wacko
wacko / ruby_quine.rb
Last active Dec 10, 2015
Ruby Quine
View ruby_quine.rb
DATA.rewind
puts DATA.read
__END__
@wacko
wacko / traceroute
Last active Dec 12, 2015
traceroute 216.81.59.173
View traceroute
$ traceroute 216.81.59.173
traceroute to 216.81.59.173 (216.81.59.173), 64 hops max, 52 byte packets
1 * * *
2 * * *
3 * * *
4 * * *
5 133-165-89-200.fibertel.com.ar (200.89.165.133) 66.947 ms
189-165-89-200.fibertel.com.ar (200.89.165.189) 64.246 ms
157-165-89-200.fibertel.com.ar (200.89.165.157) 64.231 ms
@wacko
wacko / delicious_shortcuts.js
Created Mar 4, 2013
Delicious: Shortcut for adding a new link ("a") seems to be missing
View delicious_shortcuts.js
// source: https://delicious.com/js/app.js
key("/",this.focusSearch),
key("1",this.showDiscover),
key("2",this.showNetwork),
key("3",this.showRemember)},
//...
key("k",this.showPreviousDetailPane),
key("up",this.showPreviousDetailPane),
key("j",this.showNextDetailPane),
key("down",this.showNextDetailPane),
@wacko
wacko / carousel.html
Created May 2, 2013
Twitter Bootstrap - Fade in / fade out on carousel
View carousel.html
View juju
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:juju/pkgs
sudo apt-get update
sudo apt-get -y install lxc apt-cacher-ng libzookeeper-java zookeeper juju git
# create a SSH authorized/public key
ssh-keygen -t rsa
# set AWS credentials
export AWS_ACCESS_KEY_ID=XXXXXXXX
You can’t perform that action at this time.