Skip to content

Instantly share code, notes, and snippets.

@rafaelcaricio
rafaelcaricio / insertion_sort.py
Created September 11, 2012 11:55
Insertion sort
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def insertion_sort(array):
size = len(array)
if size > 1:
for i in xrange(size):
j = i
import logging
import signal
import sys
import time
import tracemalloc
logger = logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
@rafaelcaricio
rafaelcaricio / namehash.py
Created June 18, 2017 10:49
Namehash Algorithm from EIP137 - Ethereum Name Service
import codecs
# pip install pysha3==1.0.2
from sha3 import keccak_256
def sha3(text):
return keccak_256(text).digest()
@rafaelcaricio
rafaelcaricio / gpg-agent.conf
Created May 10, 2016 12:30 — forked from nl5887/gpg-agent.conf
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@rafaelcaricio
rafaelcaricio / find_file_s3.py
Created December 4, 2013 15:57
find file in s3
#!/usr/bin/env python
import os
import argparse
from boto.s3.connection import S3Connection
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Find filename on s3')
parser.add_argument('resource_name', metavar='resource_name', help='Part of the resource name.')
@rafaelcaricio
rafaelcaricio / show_image_exif.py
Created November 14, 2013 12:12
Simple script to show exif info stored in a image file.
#!/usr/bin/env python
import argparse
try:
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
except ImportError:
print "You need to install PIL. Please check: http://www.pythonware.com/products/pil/"
def decode_gps_info(exif):
@rafaelcaricio
rafaelcaricio / carta_a_presidente_dilma_rousseff.mkd
Last active December 25, 2015 14:19
Translation of the letter to President Dilma Rousseff from Maddog.

Olá, presidenta Rousseff... eu lhe avisei

Carta impressa: escrita por Maddog

Jon "maddog" Hall

Querida Presidenta Rousseff,

Eu entendo que a senhora esteja irritada com meu país, os Estados Unidos da América, porque uma de

/**
* Example of carrossel CSS only simplified
*/
/* this part is just look-and-feel */
.just-to-centralize-not-related-to-the-example {
display: inline-block;
margin-top: 20px;
text-align: center;
width: 100%;
}
@rafaelcaricio
rafaelcaricio / dabblet.css
Created February 20, 2013 14:59
Example of carrossel CSS only simplified
/**
* Example of carrossel CSS only simplified
*/
/* this part is just look-and-feel */
.just-to-centralize-not-related-to-the-example {
display: inline-block;
margin-top: 20px;
text-align: center;
width: 100%;
}
@rafaelcaricio
rafaelcaricio / dabblet.css
Created February 20, 2013 12:38
Example of carrossel CSS only simplified
/**
* Example of carrossel CSS only simplified
*/
/* this part is just look-and-feel */
.just-to-centralize-not-related-to-the-example {
display: inline-block;
margin-top: 20px;
text-align: center;
width: 100%;
}