Skip to content

Instantly share code, notes, and snippets.

@Cheaterman
Cheaterman / .gitignore
Last active August 29, 2015 14:24
TMS App
.buildozer/
bin/
buildozer.spec
*.pyc
.*.sw*
@Cheaterman
Cheaterman / README
Last active August 29, 2015 14:25
Letterbox scaling Kivy
Letterbox scaling example for Kivy apps with fixed aspect ratio
Small example of communication between Flask and Kivy
@Cheaterman
Cheaterman / imgur.py
Last active April 15, 2018 12:15
imgur.py
#!/usr/bin/python3
import os
import requests
import sys
def imgur(args, stdin=None):
access_response = requests.post(
'https://api.imgur.com/oauth2/token',
@Cheaterman
Cheaterman / stdin
Created March 13, 2018 11:38
stdin
cheaterman@cmans-laptop ~ $ sudo echo
Mot de passe : 
Wrong! You cheating scum!
Mot de passe : 
Where did you learn to type?
@Cheaterman
Cheaterman / eggs_to_bam.py
Created April 11, 2018 16:19
eggs_to_bam.py
import glob
import os
import sh
print('Converting eggs to bams...')
for egg in glob.glob(os.path.join(os.path.dirname(__file__), '*.egg')):
print('Processing %s...' % egg)
sh.egg2bam((
'-ps rel -o %(basename)s.bam %(basename)s.egg' % dict(
@Cheaterman
Cheaterman / party.py
Created April 12, 2018 23:09
party.py
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ListProperty
from kivy.utils import get_random_color
KV = '''
ScreenManager:
id: sm
@Cheaterman
Cheaterman / bomberman.capnp
Created April 14, 2018 20:23
bomberman.capnp
@0xb61678a79b98b42e;
interface Login {
connect @0 (client :Client, name :Text) -> (server :Server, handle :LoginHandle);
interface LoginHandle {}
}
struct Command {
name @0 :Text;
@Cheaterman
Cheaterman / jintest.py
Created April 15, 2018 12:10
jintest.py
import datetime
import jinja2
TEMPLATE = '''
<html>
<head>
<style>
table {
border-collapse: collapse;
}
@Cheaterman
Cheaterman / abstract.py
Created April 16, 2018 11:43
abstract.py
class PropertyStorage:
def __init__(self, value):
self.value = value
self.observers = []
class NetworkedProperty:
def __init__(self, default_value=None):
self.default_value = default_value
self.name = ''