Skip to content

Instantly share code, notes, and snippets.

@bussiere
bussiere / botirc.py
Created November 3, 2010 20:31
a irc bot by whidou
#!/usr/bin/python
###########################################################################
# IRCBot: A simple library for simple IRC bots
# Copyright (c) 2009 Whidou <[email protected]>
###########################################################################
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
class IRCBot:
"""Some freaking IRC bot"""
def __init__(self, network, chan, name, orders={}, init=None, timer=None, end=None, partmessage=""):
self.chan = chan
self.network = network
self.name = name
self.partmessage = partmessage
self.load_orders(orders)
self.load_methods(init, timer, end)
###########################################################################
# IRCBot: A simple library for simple IRC bots
# Copyright (c) 2009 Whidou <[email protected]>
###########################################################################
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@bussiere
bussiere / init.el
Created November 19, 2010 14:02
my emacs config file windows emacs erlang golang go
(setq load-path (cons "C:/Program Files/erl/lib/tools-2.6.6.1/emacs" load-path))
(setq erlang-root-dir "C:/Program Files/erl")
(setq exec-path (cons "C:/Program Files/erl/bin" exec-path))
(require 'erlang-start)
(setq load-path (cons "C:/Go/misc/emacs" load-path))
(setq erlang-root-dir "C:/Go")
(setq exec-path (cons "C:/Go/bin" exec-path))
(require 'go-mode-load)
@bussiere
bussiere / test.erl
Created November 20, 2010 16:57
my tests in erlang
-module(test).
-export([greet/2,head/1,second/1,same/2,right_age/1,oh_god/1,help_me/1,prepend/2,beach/1,beachf/1,convert/0]).
greet(male,Name)->
io:format("Hello, Mr. ~s!",[Name]);
greet(female,Name) ->
io:format("Hello, Mrs. ~s!",[Name]);
greet(_,Name) ->
io:format("Hello, ~s!",[Name]).
@bussiere
bussiere / cadeau.py
Created November 22, 2010 10:18
random de cadeau
haruhi = ["ElKaizer","baka-saru","Nautawi"]
geekzone = ["AcidBen"," Beasty"]
@bussiere
bussiere / cadeau.py
Created November 22, 2010 10:19
random de cadeau en python
import random
geekzone = ["AcidBen","Beasty","Mech","Azariel","BarracuddA","KaD","LordK","gabs431","Marmottas","Glasofruix","fabiouchka","Lukkant","Anaethelion","fuful","Drakulls","guts","Bussiere","ghigis"]
haruhi = [{"ElKaizer":"18"},{"baka-saru":"18"},{"Nautawi":"18"},{"Sedeto":"18"},{"Aryth":"Poste"},{"Grimm":"18"},{"Le Commandant":"18"},{"Fskng":"18"},{"toutoune134":"Poste"},{"nefka":"18"},{"ziassan":"18"},{"elfe":"18"},{"Bussiere":"18"}]
def sortliste(liste):
i = 0
chaine = ""
while liste :
@bussiere
bussiere / Algorithm.java
Created November 23, 2010 08:17
Algorithm de merde >.>
package Test;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Dictionary;
import java.util.Hashtable;
@bussiere
bussiere / listing.py
Created November 23, 2010 21:49
listing files in a directory recursivly not my creation
import os
import stat
def walktree (top = ".", depthfirst = True):
names = os.listdir(top)
if not depthfirst:
yield top, names
for name in names:
try:
st = os.lstat(os.path.join(top, name))
@bussiere
bussiere / schmilblick.erl
Created November 26, 2010 22:20
Schmilblick in erlang
-module('schmilblick').
-export([schmilblick/0]).
% Les regles :
% Le public doit deviner le scmilblick en ne posant que des questions fermés (qui ne se repondent que par oui
% ou par non).
schmilblick()->
["Shinji"].