Skip to content

Instantly share code, notes, and snippets.

View vindolin's full-sized avatar
:octocat:
Available for hire 😎

Thomas Schüßler vindolin

:octocat:
Available for hire 😎
View GitHub Profile
@vindolin
vindolin / flashair_watcher.py
Last active January 25, 2016 12:27
Watch a directory for .x3g files and post them to a flashair sc card.
moved to: https://github.com/vindolin/flashair_sync
import urwid
class MyEdit(urwid.Edit):
def keypress(self, size, key):
if key == 'enter':
return True
urwid.Edit.keypress(self, size, key)
edit = MyEdit(edit_text='Press ENTER to see my problem!')
#!/usr/bin/env python3
import urwid
palette = [
('highlight', '', '', '', 'bold,#ff0', ''),
('highlight_focus', '', '', '', 'bold,#ff0', '#da0'),
('item_focus','', '', '', '', '#da0'),
]
@vindolin
vindolin / substring_highlight.py
Last active January 6, 2016 17:17
Urwid Problem
#!/usr/bin/env python3
import urwid
palette = [
('highlight', '', '', '', 'bold,#ff0', ''),
('item_focus','', '', '', '', '#da0'),
]
class Item(urwid.WidgetWrap):
#!/usr/bin/env python
# run with get_total_history.py <(history)
import fileinput
history = [
line.strip().partition(' ')[2]
for line in fileinput.input()]
import android
from sendmail import sendemail
from sys import stdout
from time import sleep
trapped = False
image_path = '/sdcard/cat.jpg'
counter = 0
mail_tpl = '''
@vindolin
vindolin / mtgox_price_ws.py
Last active December 16, 2015 03:29
Rewrite of https://gist.github.com/vindolin/5353600, now uses a websocket instead of polling. Needs the socketIO_client module. Install: pip install socketIO_client Basic usage: python mtgox_price_ws.py 33 where 33 is the amount of bitcoins you own Donations -> 1HpQQds9wUFykgwKyzXp747SAb6374RjUL
# -*- coding: utf-8 -*-
# needs socketIO_client (pip install socketIO_client)
# Simply shows the bitcoin price in $ from mtgox.com and the total price of all the bitcoins you own.
# Screenshot: http://i.imgur.com/UatFwkM.png
# Donations --> 1HpQQds9wUFykgwKyzXp747SAb6374RjUL
from sys import stdout
import argparse
import locale
@vindolin
vindolin / bitcoin_watch.py
Last active December 16, 2015 01:18
Simply shows the bitcoin price in $ from mtgox.com and the total price of all the bitcoins you own. Screenshot: http://i.imgur.com/UatFwkM.png
# -*- coding: utf-8 -*-
# Simply shows the bitcoin price in $ from mtgox.com and the total price of all the bitcoins you own.
# Screenshot: http://i.imgur.com/UatFwkM.png
# Donations --> 1HpQQds9wUFykgwKyzXp747SAb6374RjUL
import requests
import json
from time import sleep
from sys import stdout
from __future__ import division, print_function
from gi.repository import Clutter
import random
from random import randint
from colorsys import rgb_to_hls, hls_to_rgb
from sys import argv
Clutter.init([])