This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am lleirborras on github. | |
* I am lleirborras (https://keybase.io/lleirborras) on keybase. | |
* I have a public key ASD9MAsbcx9L31EtnxD4YgZfdqcXXqdvf-vytbAIlIb_7Qo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Collectd < Formula | |
desc "Statistics collection and monitoring daemon" | |
homepage "https://collectd.org/" | |
stable do | |
url "https://collectd.org/files/collectd-5.7.1.tar.bz2" | |
sha256 "7edd3643c0842215553b2421d5456f4e9a8a58b07e216b40a7e8e91026d8e501" | |
end | |
bottle do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'etc' | |
require 'cgi' | |
require 'open-uri' | |
require 'nokogiri' | |
message = "@lleirborras is comitting " | |
message << Nokogiri.parse(open("http://whatthecommit.com").read).css('#content p').first.text.strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am lleirborras on github. | |
* I am lleirborras (https://keybase.io/lleirborras) on keybase. | |
* I have a public key whose fingerprint is 09F3 CE74 326F 0986 0C03 E7FC FCFC 477B 42BB ADA2 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:swap_lines(n1, n2) | |
let line1 = getline(a:n1) | |
let line2 = getline(a:n2) | |
call setline(a:n1, line2) | |
call setline(a:n2, line1) | |
endfunction | |
function! s:swap_up() | |
let n = line('.') | |
if n == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class CouchdbLuceneBuild < Formula | |
homepage 'https://github.com/ifad/couchdb-lucene-build' | |
url 'https://github.com/ifad/couchdb-lucene-build/archive/master.tar.gz' | |
version '0.0.1' | |
depends_on 'couchdb' | |
depends_on 'maven' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This allows to use a numeric or a lambda | |
def retry_upto(max_retries = 1, options = {}) | |
begin | |
return yield if ((max_retries -= 1) > 0) | |
rescue (options[:rescue_only] || Exception) | |
options[:wait] = if options[:patience].is_a?(Numeric) | |
options[:wait] * options[:patience] | |
else | |
options[:patience].call(options[:wait]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 and retrying after any exception | |
# | |
# retry_upto(5, :wait => 2) do ... end | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 and retrying after any exception | |
# | |
# retry_upto(5, :wait => 2) do ... end | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Mod | |
def self.included(base) | |
base.class_eval do | |
puts "Included in #{base}" | |
p ObjectSpace.each_object(Class).sort{|a,b| a.name <=> b.name}.select{|a| a.superclass == Person}.uniq.size | |
end | |
end | |
end |