Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
#routes like dispatcher to work on plain cgi
#request url looks like this 'paths.py?path=/abc/def/ghj/;' after mod_rewrite
import re
import cgi
import cgitb
def dispatch(path, rules):
'''
Created on 3 de Ago de 2010
@author: Vasco
'''
import struct
import os.path
import httplib
from util import UnavailableError, retry
typedef struct generic_list_s{
struct list_bucket** array;
int start;
int count;
int real_count;
int capacity;
} list;
struct list_bucket
{
@vasc
vasc / backup.sh
Created March 21, 2011 17:49
backup script using duplicity
export AWS_ACCESS_KEY_ID=id
export AWS_SECRET_ACCESS_KEY=key
duplicity --no-encryption --exclude /home/vasco/projs/couchee/repo /home/vasco/projs/ s3+http://vascobackup/projs.bkp/
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
{
"people": [
"Alexandre Sá Viana",
"Carlos Duarte",
"Cristiano Marconi",
"João Constantino",
"Jorge Ribeiro",
"Liliana Silva",
"Mário Santos",
"Marta Raposo",
@vasc
vasc / .gitconfig
Created September 20, 2011 22:33
gitconfig
[core]
editor = `which vim`
[init]
templatedir = <%= File.expand_path(File.dirname(__FILE__)) %>/git-template-dir
[merge]
tool = opendiff
[alias]
st = status -sb
co = checkout
# via http://ozmm.org/posts/git_msg.html
@vasc
vasc / dabblet.css
Created June 21, 2012 03:16
iphone mockup boilerplate
/**
* iphone mockup boilerplate
*/
html{
min-height: 100%
}
body{
background: #f06;
background: linear-gradient(90deg, #eef, #ccc);
{ "name": "Artisan",
"scopeName": "source.deploy",
"fileTypes": ["patent"],
"patterns": [
{
"match": "^\\s*(patent\\b|run\\b|error\\b|before\\b|after\\b|default\\b)",
"name": "storage.type.deploy"
},
{
@vasc
vasc / gist:3927805
Created October 21, 2012 17:47
Streaming server
from flask import Flask
from flask import Response
import sys
import time
from threading import Condition
from threading import Thread
from deploy import staging
@vasc
vasc / wrong.md
Last active December 26, 2015 15:59
Wrong

- What's wrong?

Wrong?

Do you want to hold my hand as we discover each cobble stone, each arch, each corner of Rome, Paris and Venice? Do you want our fingers to intertwine for so long and so hard that our bones will show those marks long after we are gone?

Do you want to lay on your knees and give everything of you, with no shame, no regret, just joy? Do you want to give yourself to pleasure and pain, night after night with no other hope but to stand closer than the night before?

Do you want to hate my enemies and love my friends with a vengeance and adoration so great that they surpass yours? Do you want to say goodnight, with no heartache, no sorrow, and meet me in your dreams right until we say good morning?