This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
def e(arg): | |
return re.escape(arg) | |
def any(arg): | |
return "("+"|".join(map(re.escape,arg.split()))+")" | |
def non_space(): | |
return r"\S+" | |
def spaced(*args): | |
return "\s+".join(args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
#[derive(Debug,Copy,Clone,Eq,PartialEq)] | |
enum PieceKind { | |
Empty, | |
Pawn, | |
King, | |
Queen, | |
Knight, | |
Bishop, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the idea of the bootstrap proc is that it delegate | |
# the creation of the dialog between tcl and python | |
# to the python script so all the protocol always match | |
# between tcl and python | |
proc bootstrap {scriptname args} { | |
set fifo_name /tmp/eggdrop-bootstrap-fifo | |
set interpreter python3 | |
exec mkfifo $fifo_name | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
################# | |
# Configuration # | |
################# | |
# TODO: à migrer dans un fichier de config ? | |
# Clé privée principale, utilisée pour générer la CSR | |
private_master_key="/etc/ssl/private/slaanesh.org.key" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def query_users(users,query,registred): | |
q = SqlQueryBuffer() | |
q"SELECT name, email FROM" | |
if users == True: | |
q"users" | |
else: | |
q"admin" | |
q"WHERE" | |
q(OR( | |
AND("name LIKE {query} OR registred={registred}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
a1,a0=0,0 | |
question = random.randint(0,2**32) | |
collection = [question]*2 | |
for i in range(999999): | |
collection += [random.randint(0,2**32)]*3 | |
random.shuffle(collection) | |
for x in collection: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
for line in fileinput.input(files=["test.txt"],inplace=True): | |
print(line.replace("toto","toto tutu"),end="") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function #useless in python3 | |
import os, time, shutil | |
import os.path | |
from glob import glob | |
import datetime | |
###Loging### | |
def logging(message): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imap_stream.py b/imap_stream.py | |
index f96ea9d..b009bba 100644 | |
--- a/imap_stream.py | |
+++ b/imap_stream.py | |
@@ -8,7 +8,7 @@ import ssl | |
import logging | |
import functools | |
-import pyparsing | |
+#import pyparsing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def f(): | |
total_damage = 0 | |
attack_score = 0 | |
defence_score = 0 | |
enemy_list = list(range(10)) | |
power = 5 | |
unit_size = 2000 | |
enemy_defence = 5 | |
enemy_unit_size = 2000 |