Skip to content

Instantly share code, notes, and snippets.

View dcadenas's full-sized avatar

Daniel Cadenas dcadenas

View GitHub Profile
@dcadenas
dcadenas / guita.rb
Created May 31, 2009 23:06
Script para ver el estado de una cuenta del banco Itaú Uruguay
#!/usr/local/bin/ruby
# encoding: UTF-8
require 'rubygems'
gem 'mechanize'
gem 'main'
gem 'highline'
gem 'money'
gem 'change_watcher'

Keybase proof

I hereby claim:

  • I am dcadenas on github.
  • I am dcadenas (https://keybase.io/dcadenas) on keybase.
  • I have a public key ASAZotTtny79SxzwfBbCE4ST3pl63YtUo3Pnj5oOpOj32go

To claim this, I am signing this object:

@dcadenas
dcadenas / ajaxtest.js
Last active October 22, 2016 02:41
Testing rawgit
(function(){
var url = 'https://api.ipify.org/?format=json';
var createCORSRequest = function(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
@dcadenas
dcadenas / gist:2325686
Created April 7, 2012 05:56
Javascript de bookmarklet para poner ratings IMDB y rotten tomatoes en cartelera.com.uy
(function(){
var putRatings = function($){
$('.peli_izq .cinesala').each(function(_,link){
var escapedTitle = escape(link.text.trim());
if(escapedTitle !== ""){
$.getJSON("http://www.imdbapi.com/?t=" + escapedTitle + "&tomatoes=true&y=" + (new Date().getFullYear()) + "&callback=?", function(d){
if(d.imdbRating) {
$(link).after('<div style="float:right; background:yellow; line-height:8px; border:solid; padding:3px">\
<p>Búsqueda en IMDB<\p>\
@dcadenas
dcadenas / excusa
Created April 26, 2016 21:52
Generador de excusas para bash
#!/usr/bin/env bash
a=(
'En cuanto arreglemos el goteo de recursos'
'En cuanto completemos las pruebas'
'En cuanto hayamos optimizado el código'
'Apenas nos arreglen el bug'
'Cuando se solvente el problema de instalación'
'Cuando averiguemos por qué se cae el proceso'
'Cuando hayamos mejorado el rendimiento'
'En cuanto completemos la restauración'
@dcadenas
dcadenas / threads.rb
Last active February 12, 2016 14:41
How to find origin of current running threads
require 'objspace'
ObjectSpace.trace_object_allocations_start
def all_child_threads
Thread.list - [Thread.current]
end
trap(:INFO) {
puts "#" * 90
all_child_threads.each do |t|
SomeComponent {
background-color: red;
SomeComponent-someDescendant {
width: 100%;
}
}
SomeComponent-someDescendant {
background-color: white;
@dcadenas
dcadenas / Guardfile
Last active December 23, 2015 09:59
Poor man's livereload for Mac + Chrome
require 'guard'
require 'guard/guard'
module ::Guard
class Reload < Guard
def initialize(*args, &block)
super
@script = <<-APPLESCRIPT
tell window 1 of application "Google Chrome"
#! /usr/bin/env ruby
#usage: imsg daniel "hello world"
buddyids = {
daniel: "dcadenas@gmail.com",
elcuervo: "yo@brunoaguirre.com"
}
nickname = ARGV[0].to_sym
@dcadenas
dcadenas / pre-commit
Created October 16, 2012 16:31
Pre commit hook to avoid commiting badly named rspec files
#!/usr/bin/env ruby
test_dirs = %w[configurations
lib
modules
services
uploaders
controllers
helpers
mailers
presenters