Skip to content

Instantly share code, notes, and snippets.

View gist:b850760d052cd5da6cac
<html>
<head>
<title>yay</title>
<script type="text/javascript">
var arrx = [];
var arry = [];
var arrz = [];
for (var i=0; i<100; i++) {
arrx.push(0);
arry.push(0);
View midkov.py
#!/usr/bin/python2
# coding: utf-8
import re, datetime, random, mido, sys, time
data = {}
def split(seq):
for i in range(len(seq) - 2):
yield tuple(seq[i:i+3])
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.