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
In celebration of Whyday: Rubyists always want to show others the beautiful code
they have created, hence the question: Has Anybody Seen My Code?
Has Anybody Seen My Code
(sung to the tune of Has Anybody Seen My Gal)
Clean and small, works for all,
Ruby is my all in all.
Has anybody seen my code?
@mranney
mranney / emoji_sad.txt
Created January 30, 2012 23:05
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8

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

<%= javascript_include_tag 'assests/news_posts.js' %>
<%= form_for @record,:url => news_posts_page_news_posts_path(@page), :remote => true do |f| %>
<%= render :partial=>'admin/pages/form_error_messages_area'%>
<div id="add-news-post-title" class="record-field required" >
<div class="name block">Title</div>
<div class="input">
<%= f.text_field :title,:class=>'full-width-input', :maxlength=>"255"%>
</div>
@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
@wacko
wacko / ruby_quine.rb
Last active December 10, 2015 22:28
Ruby Quine
DATA.rewind
puts DATA.read
__END__
@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
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|
@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?
@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