Skip to content

Instantly share code, notes, and snippets.

@tiwo
tiwo / clients.md
Created April 16, 2012 12:09 — forked from defunkt/clients.md
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@tiwo
tiwo / deliver-maildir
Last active July 21, 2016 13:37
delivering mail to a Maildir (in bash)
#!/bin/bash
#
# deliver-maildir -- safely deliver mail to a Maildir.
#
# For information on the Maildir convention, see
# http://en.wikipedia.org/wiki/Maildir
#
# This program is offered subject to the BSD three-clause license,
# see the bottom of this file for details.
import urwid
import os
from xdg import DesktopEntry
def read_menus():
"""
Read the menus and return them in an array
"""
all_menus = []
SCREEN 9
FOR k = 0 TO 640
PSET (k, (k * k) MOD 330)
NEXT
@tiwo
tiwo / README.md
Last active July 10, 2023 01:13
ppt2jpeg.vbs: Convert Powerpoint slides to JPEG images

ppt2vbs

export a Powerpoint presentation to JPEG images, one per slide. Used as a workaround to the broken JPEG export in Powerpoint itself, which yields only low quality images.

Usage

You can adjust the image resolution by varying the numerical argument in line 46, in the call to ExportSlides.

Just drag and drop one or more PPT or PPTX files onto the vbs script. The script will process each, showing a short message, and

@tiwo
tiwo / feistel.py
Created September 6, 2016 16:25 — forked from whatisaphone/feistel.py
Unlimited length feistel cipher
import hashlib
class FeistelSHA1:
rounds = 4 # 4 rounds is sufficient as long as the round function is cryptographically secure
split = 1 / 2
def __init__(self, key, rounds=rounds):
self.subkeys = [hashlib.sha1(bytes((i,)) + key).digest() for i in range(rounds)]
@tiwo
tiwo / README.md
Last active April 25, 2017 09:00
complete α-β evaluation of simple abstract games

written in notepad.exe and completely untested - Python has never seen this code :-)

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tiwo
tiwo / tkinter_intvar_lambda_issue.ipynb
Created May 7, 2017 15:11
trying to reproduce E.Zag's issue with λ
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

I use Windows, MINGW64 bash, Python 3.5.2. In an empty directory:

$ virtualenv ENV
[...]
$ source ENV/Scripts/activate
(ENV) $ pip install ablog
[...]
(ENV) $ pip show ablog
Name: ablog

Version: 0.8.4