Skip to content

Instantly share code, notes, and snippets.

View lguardiola's full-sized avatar

Luis E. Guardiola lguardiola

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lguardiola on github.
  • I am lguardiola (https://keybase.io/lguardiola) on keybase.
  • I have a public key ASBtq-FJcULQfSO8r-bxQ4hyod4g7He32zgfZjWIxVHyFwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am lguardiola on github.
  • I am lguardiola (https://keybase.io/lguardiola) on keybase.
  • I have a public key ASCtTbEYAvh3dLs3c-XY3Z0-BqmMXkLquSqafiXWmKM8Lgo

To claim this, I am signing this object:

@lguardiola
lguardiola / intendentes.csv
Created October 22, 2011 21:37
parser de municipios de argentina
PROVINCIA MUNICIPIO INTENDENTE PARTIDO POLITICO RELECTO
Buenos Aires Adolfo Alsina Alberto GUTT Frente para la Victoria Si
Buenos Aires Adolfo Gonzáles Chaves José MARTINEZ Partido Vecinal No
Buenos Aires Alberti Leonel Omar ZACCA Frente para la Victoria Si
Buenos Aires Almirante Brown Ruben Dario GIUSTOZZI Frente para la Victoria No
Buenos Aires Avellaneda Jorge FERRARESI Frente para la Victoria Si
Buenos Aires Ayacucho Dario DAVID Frente para la Victoria Si
Buenos Aires Azul Omar Arnaldo DUCLÓS Frente Coalición Cívica Si
Buenos Aires Bahía Blanca Cristian BREITENSTEIN Frente para la Victoria Si
Buenos Aires Balcarce José Enrique ECHEVERRÍA Frente para la Victoria No
lguardiola@MacBook-Pro:~/Code/intern-examples/react-example|master
⇒ npm test
> react-intern-example@0.1.0 test /Users/lguardiola/Code/intern-examples/react-example
> intern-runner config=tests/intern
PASS: main - todoModel - default data (2ms)
PASS: main - todoModel - complete (empty model) (2ms)
0/2 tests failed
PASS: main - footer - construction (1ms)
"some line shorter than 80 characters"
"some line longer than 80 characters some line longer than 80 characters some line longer than 80 characters"
10.times do |i|
puts i
end
puts DATA.read
__END__
This is
a data content!
@lguardiola
lguardiola / date_ext.rb
Created October 16, 2012 17:52
Date extension to calculate diff in years between two dates
# override date class
class Date
def self.years_from(date)
r = today.year - date.year
r-=1 if today.month < date.month
r-=1 if today.month == date.month && today.day < date.day
r
end
end
@lguardiola
lguardiola / ree-1.8.7-glibc+2.14.patch
Created April 5, 2012 19:50
Patch to compile Ruby Enterprise Edition 1.8.7 for glibc >= 2.14
diff --git a/distro/google-perftools-1.7/src/tcmalloc.cc b/distro/google-perftools-1.7/src/tcmalloc.cc
index 8d94d20..0769425 100644
--- a/distro/google-perftools-1.7/src/tcmalloc.cc
+++ b/distro/google-perftools-1.7/src/tcmalloc.cc
@@ -137,6 +137,13 @@
# define WIN32_DO_PATCHING 1
#endif
+// GLibc 2.14+ requires the hook functions be declared volatile, based on the value of the
+// define __MALLOC_HOOK_VOLATILE. For compatibility with older/non-GLibc implementations,
# encoding: utf-8
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
=begin
REFERENCES
ticket: https://www.pivotaltracker.com/story/show/20034615
@lguardiola
lguardiola / migration_mongodb.rb
Created August 22, 2011 23:35
pendiente de finalizacion funcional
LETRAS='áéíóúñüça-z'
LETRASM='ÁÉÍÓÚÑÜA-Z'
# Palabra Palabra|de|del
NOMBRES_PROPIOS_RE="(?:[#{LETRASM}][#{LETRAS}#{LETRASM}]{2,}(?:[ ,](?:[#{LETRASM}][#{LETRASM}#{LETRAS}]+|(?:(?:de|la|del)(?= [#{LETRASM}])))){1,})"
class Document
include Mongoid::Document
field :title, String
field :content, String