Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
Transcripción al castellano de un fragmento de la comparecencia de Adolf Todó Rovira, presidente consejero ejecutivo de Catalunya Caixa, ex-director de Caixa Catalunya, presidente de Catalunya Banc, ex-director general de Caixa Catalunya del 2008 al 2010 y ex-director general de Caixa Manresa, durante la Comisión de investigación sobre las posibles responsabilidades derivadas de la actuación y la gestión de las entidades financieras y la posible vulneración de los derechos de los consumidores.
http://www.youtube.com/watch?v=0Uw3f2_zD5o
Adolf Todó - Este es un enfermo que no hace ruido. Por tanto, se toma esta decisión con pleno conocimiento, en una estrategia hablada con el Banco de España, y... y se hace porque es la solución menos mala en aquel momento.
David Fernàndez (CUP-AE) - Y cuando el enfermo es contagioso, ¿el silencio es lo mejor?
AT: Nosotros ya hablábamos con quien teníamos que hablar.
DF: Desde la opacidad, entiendo.
AT: No no, yo hablaba con el Ministerio, hablaba con el Banco de España,
@raul
raul / api.rb
Created May 26, 2013 09:38
Proposal for Weasel Diesel's DSL: describe different scenarios for a given response, including support status codes and headers
# Based on http://developer.github.com/v3/gists/#check-if-a-gist-is-starred
describe_service "/gists/:id/star" do |service|
service.http_verb :get
# documentation
service.documentation do |doc|
doc.overall "Check if a gist is starred"
doc.example '<code>curl http://localhost:9292/gists/:id/star</code>'
end
@raul
raul / mediahint.js
Last active January 29, 2016 20:12
I like mediahint.com's extension but it relies on this external pac file hosted at https://mediahint.com/default.pac If mediahint.com gets compromised my whole navigation could get proxied without noticing. I'll modify the installed extension (under `~/Library/Application Support/Google/Chrome/Default/Extensions/...` in my Mac) to use a local ve…
function FindProxyForURL(url, host){
var myip = myIpAddress();
var ipbits = myip.split(".");
var myseg = parseInt(ipbits[3]);
if(myseg == Math.floor(myseg/2)*2){
proxy = 'PROXY 165.225.131.153:80; PROXY 165.225.130.193:80';
} else {
proxy = 'PROXY 165.225.130.193:80; PROXY 165.225.131.153:80';
}
if((host == 'localhost')||(shExpMatch(host, 'localhost.*'))||(shExpMatch(host, '*.local'))||(host == '127.0.0.1')){
@raul
raul / retry_upto.md
Created October 9, 2011 21:31
Removing the :growth parameter and making :interval an integer or (not AND) lambda

Time intervals between attempts

For fixed intervals, an :interval parameter can be passed indicating the time in seconds. The following example will sleep two seconds between attempts:

retry_upto(5, :interval => 2)

For customized intervals, the :interval parameter can be a lambda, which will be applied to the number of each attempt. For instance, the following code will sleep 3 seconds after the first attempt, 6 after the second, 9 after the third...

@raul
raul / retry_upto.rb
Created October 7, 2011 06:42
retry_upto.rb
# Ruby `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries
#
# retry_upto(5, :wait => 2) do ... end
#
@raul
raul / patch.rb
Created July 25, 2011 00:20
Adding MIME_TYPES to rack's defaults
Rack::Mime::MIME_TYPES.merge!({ '.appcache' => 'text/cache-manifest' })
@raul
raul / pq_aliases
Created June 10, 2011 19:03
postgres aliases (homebrew install)
alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias pgstop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
alias pglog="tail -n 100 /usr/local/var/postgres/server.log"
@raul
raul / gist:1007292
Created June 3, 2011 22:31
Installing rails 3.1rc
> gem install rails --pre
/Users/raul/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /usr/local in PATH, mode 040777
ERROR: While executing gem ... (NameError)
uninitialized constant Syck::Syck
> gem install rails -v ">=3.1.0rc"
/Users/raul/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Building native extensions. This could take a while...
Successfully installed activesupport-3.1.0.rc1
@raul
raul / css3_bg_gradient.html
Created May 14, 2011 08:59
CSS3 gradient background in short page
<!doctype html>
<html lang=en>
<head>
<title>CSS3 gradient background in short page</title>
<meta charset=utf-8>
<style type="text/css" media="screen">
html{
height: 100%;
}
body{