Skip to content

Instantly share code, notes, and snippets.

View arthurfurlan's full-sized avatar

Arthur Furlan arthurfurlan

View GitHub Profile
@arthurfurlan
arthurfurlan / hello.php
Last active December 18, 2015 11:09
why do I like python!?
#!/usr/bin/env php
<?php
class Hello {
public function say($what) {
echo "Hello {$what}!\n";
}
}
$hello = new Hello();
@arthurfurlan
arthurfurlan / gist:947731
Created April 29, 2011 02:24
Example of the valvim's fabfile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# written by Arthur Furlan <[email protected]>
from __future__ import with_statement
from fabric.api import *
import socket
import time
@arthurfurlan
arthurfurlan / SequenceMapper tests
Created January 21, 2011 14:17
SequenceMapper is an algorithm optimized for the generation of ShortURLs codes.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# BaseConverter used in django-shorturls: https://github.com/jacobian/django-shorturls
# https://github.com/jacobian/django-shorturls/blob/master/src/shorturls/baseconv.py
from shorturls.baseconv import BaseConverter
# SequenceMapper used in django-shortim: https://github.com/valvim/django-shortim
# https://github.com/valvim/django-shortim/blob/master/src/shortim/models.py
from shortim.sequencemapper import SequenceMapper, SHORTIM_SHORTURL_CHARS
@arthurfurlan
arthurfurlan / convert-encoding.sh
Created December 10, 2010 12:50
Convert files from some encoding to another using the "iconv". edit
#!/bin/sh
# written by Arthur Furlan <[email protected]>
# check the script usage
if [ $# -lt 1 ]; then
echo "Usage: $0 PATH [FROM-ENCODING] [TO-ENCODING]"
exit 1
elif [ ! -d $1 ]; then
echo "Error: directory $1 not found."
exit 2