Skip to content

Instantly share code, notes, and snippets.

@hmbr
hmbr / keybase.md
Created April 16, 2015 17:52
keybase.md

Keybase proof

I hereby claim:

  • I am hmbr on github.
  • I am hmbr (https://keybase.io/hmbr) on keybase.
  • I have a public key whose fingerprint is 2AA5 85DD DC32 AE1C 84AB 12C2 50B6 69AA CC9A 664D

To claim this, I am signing this object:

// ==UserScript==
// @name habilitando usabilidade no wimoveis
// @namespace wimoveis.UX.enable
// @version 1
// @grant none
// o vilao da usabilidade http://www.wimoveis.com.br/js/dados_v1.0.js
// ==/UserScript==
unsafeWindow.document.onkeydown = null;
@hmbr
hmbr / pi.pl
Created December 21, 2011 17:43
#!/usr/bin/perl
use strict;
use warnings;
my $point = 0;
my $radius = 10000;
my $SQ_RADIUS = $radius * $radius;
my @squares = map { $_ * $_ } ( 1 .. $radius);
@hmbr
hmbr / gist:1373093
Created November 17, 2011 13:05
pg_restore
pg_restore --clean --host localhost --port 5432 --username postgres --dbname db --verbose "sql.backup"
@hmbr
hmbr / gist:1370665
Created November 16, 2011 17:04
vim
tabs to spaces
http://vim.wikia.com/wiki/Converting_tabs_to_spaces
:set expandtab
:rehab
@hmbr
hmbr / gist:1370579
Created November 16, 2011 16:35
sample.py
#!/usr/bin/env python
def adicionando(novo, lista, max=None):
retorno = [[novo]]
for i in lista:
retorno.append(i)
resposta = i[:]
resposta.append(novo)
@hmbr
hmbr / gist:1367445
Created November 15, 2011 16:06
virtual env && python
easy_install pip
pip install -U virtualenv
pip install -U virtualenvwrapper
#criar ambiente
virtualenv --no-site-packages --distribute DEFAULT
@hmbr
hmbr / .gitconfig
Created November 7, 2011 13:27
pass through firewall
[url "https://PUT.YOUR.USER.NAME.HERE@github.com/"]
insteadOf = git@github.com:
#!/bin/bash
device="hpljm1005:libusb:001:004";
while true;do
echo "scanning" ;
name=`date +%s` ;
scanimage -d $device -p >$name.pnm;
@hmbr
hmbr / capitalizeInput.js
Created October 24, 2011 17:09
capitalizeInput
(function($) {
$.fn.capitalizeInput = function(){
var content = $(this).val().toLowerCase();
var pos = 0;
var space = -1;
var min_length = 2;
var values = content.split("");
while (-1< pos && pos <content.length ){