Skip to content

Instantly share code, notes, and snippets.

Bruno Gola bgola

Block or report user

Report or block bgola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View markov.py
#!/usr/bin/python2
# coding: utf-8
import re, datetime, random, time
CHAIN_LENGTH=3
START = '\1'
END = '\0'
ansi_escape = re.compile(r'\x1b[^m]+m')
data = {}
View gist:63ecd0071db2e021e4b6
import random
def glitch(jpg):
f = open(jpg, 'r')
new = f.read(400)
for c in f.read():
if random.random() > random.choice([0.9992, 0.9993, 0.9994, 0.9995, 0.9996, 0.9997, 0.9998, 0.9999]):
new += chr(int(ord(c) + random.random()*random.choice(range(100)))%256)
else:
View telegrambot.py
#!/usr/bin/python2
# coding: utf-8
from subprocess import Popen, PIPE, STDOUT
from functools import partial
import re, datetime, random, time
from glob import glob
CHAIN_LENGTH=2
END = '\0'
ansi_escape = re.compile(r'\x1b[^m]+m')
@bgola
bgola / gist:a38209d77b28b4e15368
Created Jul 28, 2014
telegram markov chain bot
View gist:a38209d77b28b4e15368
#!/usr/bin/python2
# coding: utf-8
from subprocess import Popen, PIPE, STDOUT
from functools import partial
import re, datetime, random, time
from glob import glob
CHAIN_LENGTH=2
END = '\0'
ansi_escape = re.compile(r'\x1b[^m]+m')
View telegrambot.py
#!/usr/bin/python2
from subprocess import Popen, PIPE, STDOUT
from functools import partial
import re, datetime, random
ansi_escape = re.compile(r'\x1b[^m]*m')
p = Popen(['telegram'], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
p.stdout.read(255)
You can’t perform that action at this time.