Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# Written by Antoine 'NaPs' Millet
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 14 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
@NaPs
NaPs / df.py
Created September 21, 2008 19:28
#!/usr/bin/env python
# coding=utf8
import cairo
import pycha.line
import subprocess
from helpers import *
# Parameters :
import socket
from struct import pack, unpack
import signal
# Fonctions
def mac2string(macaddr):
'''Retourne une adresse mac sous forme d'octets en adresse mac
sous forme de chaine.'''
naps@leon ~/D/l/path> python -i metro.py
Bienvenue dans le programme de calcul d'itinéraires
Entrez une station de départ
>lib
Station Liberté selectionnée pour le départ.
Entrez une station d'arrivée
>villette
Station Porte de la Villette selectionnée pour l'arrivée.
#!/usr/bin/env python2.6
#coding=utf8
import re
COLOR_MAPPING = {
1: 'gold',
2: 'blue',
3: 'gold4',
30: 'deepskyblue', # Ligne 3b
#!/usr/bin/env python
import Image
import sys
class Node(object):
'''This class is a node of a graph'''
def __init__(self, name):
self.name = name
#!/usr/bin/env python
import Image
import sys
class Node(object):
'''This class is an node of a graph'''
def __init__(self, name):
self.name = name
@NaPs
NaPs / feu.py
Created December 26, 2008 12:39
#!/usr/bin/env python
import pygame; import pygame.font; pygame.init()
import sys
from random import randint
import time
MAX_PARTICLES = 1000
class Particle(pygame.sprite.Sprite):
#!/usr/bin/env python
#coding=utf8
import urllib2
import re
MOVIE_SEARCH_URL = 'http://www.allocine.fr/recherche/?motcle=__SEARCH__&rub=1'
MOVIE_DETAIL_URL = 'http://www.allocine.fr/film/fichefilm_gen_cfilm=__ID__.html'
SHOW_SEARCH_URL = 'http://www.allocine.fr/recherche/?motcle=__SEARCH__&rub=6'
SHOW_DETAIL_URL = 'http://www.allocine.fr/series/ficheserie_gen_cserie=__ID__.html'
#!/usr/bin/env python
#coding=utf8
import pygame; import pygame.font; pygame.init()
from pygame.locals import *
import sys
from random import randint
import time
import math