Skip to content

Instantly share code, notes, and snippets.

View wacko's full-sized avatar

Joaquín Vicente wacko

  • Buenos Aires, Argentina
View GitHub Profile
@cristianrasch
cristianrasch / pgp-encryption-guide.md
Last active May 9, 2019 11:28
PGP Encryption Guide

PGP encryption guide

Generating your key pair

gpg --gen-key

echo "export GPGKEY=01086FDA" > ~/.bashrc

@elgalu
elgalu / metaprogramming_ruby_quiz.rb
Created December 6, 2012 04:00
My quiz on: Metaprogramming Ruby: Program Like the Ruby Pros by Paolo Perrotta
- Returns?
module Module
def const_missing(name)
"sorry i don't have #{name} yet"
end
end
Untitled #=> ?
Monkeys #=> ?
=>
You get `TypeError: Module is not a module` before reaching Untitled code
@ceneon
ceneon / gist:8222574
Created January 2, 2014 17:13
Recategorización de Monotributo sin Internet Explorer
Para recategorizarte en el Monotributo, la aplicación de AFIP da error de Javascript por todos lados.
A menos que entres con Internet Explorer...
Para hacer el trámite en Chrome, Firefox o cualquier browser decente:
- Entrá con tu clave fiscal
- Abrí la aplicación de "Monotributo"
- Ignorá el formulario y abrí la siguiente URL:
https://servicios1.afip.gov.ar/tramites_con_clave_fiscal/monotributo/valida_cuit.asp?tramite=3&cuit=___TU_CUIT___&intesoc=N&eventual=N&coop=N&cuitcoop=0
@cristianrasch
cristianrasch / optimize-images.rb
Created November 25, 2016 18:59
Little image optimization script
#!/usr/bin/env ruby
# Debian pkg dependencies:
# - pngcrush
# - libjpeg-progs
# - imagemagick
# Usage: optimize-images graphic1.png photo1.jpeg bash-glob-exp1
require "fileutils"
@wacko
wacko / clock
Last active January 3, 2016 07:19
Emoji animations that fit in a tweet
ruby -e 'z=0x1F551;->(c,&b){loop{c.each(&b)}}.(11.times.map{|i|[z+i].pack("U")}){|m|print "#{"\b"*3}#{m} ";sleep 0.1}'
@wacko
wacko / fractals
Last active January 3, 2016 07:19
Ruby scripts that print a fractal in less than 140 chars
# Fractal #1
ruby -e "36.times{|l|puts (0..99).map{|n|x=y=i=0;(x,y,i=x*x-y*y+n/38.0-1.9,2*x*y+l/14.0-1.2,i+1)until(x*x+y*y>4||i>78);(32+i).chr}*''}"
# Fractal #2
ruby -e "32.times{|l|puts (0..78).map{|n|x=y=i=0;(x,y,i=x*x-y*y+n/38.0-1.5,2*x*y+l/14.0-1,i+1)until(x*x+y*y>4||i>78);(32+i).chr}*''}"
# Fractal #3
ruby -e "57.times{|l|puts (-20..135).map{|n|x=y=i=0;(x,y,i=x*x-y*y+n/38.0-1.5,2*x*y+l/14.0-2,i+1)until(x*x+y*y>4||i>78);(32+i).chr}*''}"

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

Our team did serious load on MongoDB on a large (10s of millions of users, high profile company) userbase, expecting, from early good experiences, that the long-term scalability benefits touted by 10gen

@jimweirich
jimweirich / configure.rb
Created October 2, 2013 01:12
Demonstrating a flexible DSL for configuration .
def project(name, &block)
Project.new(name, &block)
end
class Project
def initialize(name, &block)
@name = name
@context = eval("self", block.binding)
instance_eval(&block) if block_given?
gem 'rails', '3.2.12' # change version to 3.2.11 to see this working, 3.2.12 is broken
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
)
ActiveRecord::Schema.define do
create_table :users, :force => true do |t|
@wacko
wacko / traceroute
Last active December 12, 2015 08:58
traceroute 216.81.59.173
$ 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