Skip to content

Instantly share code, notes, and snippets.

@alterakey
alterakey / paste-1.7.5.1-decode-base64-cte.patch
Created September 3, 2011 13:48
Paste 1.7.5.1 base64 CTE decode patch
From 381a1a0022da60a46542d86cd210cad41a37c204 Mon Sep 17 00:00:00 2001
From: Takahiro Yoshimura <taky@cs.monolithworks.co.jp>
Date: Sat, 3 Sep 2011 22:43:31 +0900
Subject: [PATCH] Decoding base64 CTE
---
paste/request.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/paste/request.py b/paste/request.py
@alterakey
alterakey / poster-0.8.1-pass-cte.patch
Created September 3, 2011 14:02
Passing CTE with poster 0.8.1
From b361ce8411ac635f3a747fbcd99197087a742121 Mon Sep 17 00:00:00 2001
From: Takahiro Yoshimura <taky@cs.monolithworks.co.jp>
Date: Sat, 3 Sep 2011 22:39:42 +0900
Subject: [PATCH] Passing content-transfer-encoding
---
poster/encode.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/poster/encode.py b/poster/encode.py
@alterakey
alterakey / grepper.el
Created September 9, 2011 17:31
grepper.el: named grep
;; grepper: grep + named location + per-name pattern.
;;
;; Configuration:
;; (setq grepper-command-line-alist '(("pil" . "grep -niEHR '_re_' ~/ve/proj/lib/python2*/site-packages/PIL*")))
(defun grepper-grep-by-name (&optional query place)
(interactive)
(if (not place)
(setq place (completing-read "grep on: " grepper-command-line-alist nil t)))
(if (not query)
@alterakey
alterakey / outline-char.py
Created September 12, 2011 08:09
Rendering outlined font with FT2 + PIL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# outline-char.py: POC of rendering outlined font with FT2 + PIL.
#
# Copyright (C) 2011 Takahiro Yoshimura <taky@cs.monolithworks.co.jp>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@alterakey
alterakey / mass-render-chars.py
Created September 12, 2011 14:48
Rendering characters one-by-one with FT2+PIL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# mass-render-chars.py: POC of massive character rendering
#
# Copyright (C) 2011 Takahiro Yoshimura <taky@cs.monolithworks.co.jp>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@alterakey
alterakey / start-intent.sh
Created September 17, 2011 05:46
An experimental app launcher for Android
#/bin/bash
intent=$1
pkg=$2
activity=$3
intr() {
adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME
exit 0
}
@alterakey
alterakey / start-intent-test.sh
Created October 11, 2011 14:56
An experimental test instrument launcher for Android
#/bin/bash
pkg=$1
intr() {
adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME
exit 0
}
trap intr INT
adb shell am instrument -w ${pkg}/android.test.InstrumentationTestRunner &
@alterakey
alterakey / run-test-ant.py
Created November 2, 2011 05:05
Loopy ant launcher
#!/usr/bin/python
# -*- mode: python -*-
# Usage:
# $ run-test-ant test-unit-quick u:test-unit-quick U:test-unit-clean i:test-integ-quick I:test-integ-clean a:test-accept-quick A:test-accept-clean l:'debug install run' L:'clean debug uninstall install run'
#
import os
import sys
# http://stackoverflow.com/questions/1394956/how-to-do-hit-any-key-in-python
try:
@alterakey
alterakey / deploy.sh
Created November 3, 2011 02:37
Android SDK bare build environment deployer (r13 and up)
#!/bin/sh
src=`dirname $0`
on=`pwd`
proj="$1"
activity="$2"
go_flag="$3"
if test -z "$activity"; then
echo "$0: usage: $0 <project name> <entry activity>"
echo "$0: usage: $0 <project name> <entry activity> go"
@alterakey
alterakey / init-font-andale-mono-kakugo-12.el
Created December 1, 2011 14:25
Font configuration (Andale Mono + Hiragino Kaku Go) for Emacs 23
(setq fixed-width-use-QuickDraw-for-ascii t)
(setq mac-allow-anti-aliasing t)
(set-face-attribute 'default nil
:family "andale mono"
:height 120)
;;; Unicode フォント
(set-fontset-font
(frame-parameter nil 'font)
'mule-unicode-0100-24ff
'("andale mono" . "iso10646-1"))