Skip to content

Instantly share code, notes, and snippets.

View waj's full-sized avatar

Juan Wajnerman waj

  • NoRedInk
  • Buenos Aires, Argentina
View GitHub Profile
@waj
waj / bitbucket-matrix.html
Created November 1, 2011 03:29
Display a matrix with the permissions of your bitbucket repositories
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<style>
body, table {
font-family: verdana;
font-size: 8pt;
}
table, td {
@waj
waj / test.py
Created May 23, 2012 01:43
CSV Parsing: Python vs Ruby
$ time ruby test.rb
10000
20000
...
1000000
real 0m23.596s
user 0m23.354s
sys 0m0.172s
@waj
waj / main.erl
Created June 9, 2012 15:51
Spiking with Erlang and Asterisk
-module(main).
-behaviour(gen_event).
-export([
start/0,
init/1,
code_change/3,
handle_call/2,
handle_event/2,
@waj
waj / landscape-login.rb
Created July 14, 2012 07:10
Automatic login at Landscape Hotel
require 'net/http'
loop do
response = Net::HTTP.get_response URI.parse('http://www.google.com/') rescue nil
if response && response['Location'].start_with?('http://192.168.2.1:8000')
puts "#{Time.now} - Logging in..."
Net::HTTP.post_form URI.parse('http://192.168.2.1:8000'), { auth_user: '001', auth_pass: '001', redirurl: 'http://www.google.com/', accept: 'Continue' }
end
sleep 60
end
@waj
waj / japanese_numbers.rb
Created August 28, 2012 02:49
Learn Japanese Numbers
loop do
x = rand(999)
y = loop do
`say -r 150 -v Kyoko #{x}`
y = gets.to_i
break y unless y == 0
end
if x == y
puts ":-)"
else
@waj
waj / llvm33.rb
Last active October 12, 2015 03:58
LLVM with Ruby exceptions thrown instead of assertions
require 'formula'
class Clang < Formula
homepage 'http://llvm.org/'
url 'http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz'
sha1 'ccd6dbf2cdb1189a028b70bcb8a22509c25c74c8'
end
class ClangToolsExtra < Formula
homepage 'http://llvm.org/'
@waj
waj / Usage.txt
Created November 4, 2012 17:19 — forked from natritmeyer/Usage.txt
JUnit formatter for RSpec
rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml
@waj
waj / brewdeps.sh
Created November 19, 2012 15:02
Draw dependencies of installed homebrew packages
#!/bin/bash
function dump() {
echo "digraph homebrew {"
for pkg in `brew list`; do
for dep in `brew deps --1 $pkg`; do
echo "\"$pkg\" -> \"$dep\";"
done
done
echo "}"
@waj
waj / libtask.rb
Created August 21, 2013 03:33
Homebrew formula for libtask (http://swtch.com/libtask/)
require 'formula'
class Libtask < Formula
homepage 'http://swtch.com/libtask/'
url 'http://swtch.com/libtask.tar.gz'
sha1 '3873d8b53d386e7d6baecf99310ae3c3f6e8d066'
version 'latest'
def install
inreplace 'Makefile', '/usr/local', prefix
@waj
waj / pcl.rb
Created November 9, 2013 01:38
Homebrew formula for PCL
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Pcl < Formula
homepage ''
url 'http://xmailserver.org/pcl-1.12.tar.gz'
sha1 'a206c8fb5a96e65005f414ac46aeccd4b3603c8d'