Skip to content

Instantly share code, notes, and snippets.

@alterakey
alterakey / init-font-andale-mono-marugo-12.el
Created December 1, 2011 14:26
Font configuration (Andale Mono + Hiragino Maru 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"))
@alterakey
alterakey / WatchingInputStream.java
Created December 10, 2011 07:17
WatchingInputStream: Progress-reporting InputStream wrapper
/**
* WatchingInputStream: Progress-reporting InputStream wrapper.
* This file is in public domain.
*/
public class WatchingInputStream extends FilterInputStream
{
public interface ProgressListener
{
void onAdvance(long at, long length);
}
@alterakey
alterakey / ant-start-intent.patch
Created January 15, 2012 12:11
Patch for Android build.xml to enable start-intent.sh
--- build.xml.orig 2012-01-15 21:06:46.520740476 +0900
+++ build.xml 2012-01-15 21:09:00.009402410 +0900
@@ -79,7 +79,17 @@
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
- <!-- version-tag: 1 -->
+ <!-- version-tag: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
@alterakey
alterakey / grepper-config.el
Created January 23, 2012 01:32
grepper configuration
(require 'grepper)
(setq grepper-command-line-alist
'(("." . "grep -niEHR --exclude='.svn' --exclude='.hg' --exclude='.git' --exclude='CVS' --exclude='.settings' '_re_' _buffer_path_")
(".." . "grep -niEHR --exclude='.svn' --exclude='.hg' --exclude='.git' --exclude='CVS' --exclude='.settings' '_re_' _buffer_path_/..")
("android.samples" . "grep -niEHR '_re_' /usr/local/android-sdk/samples")
("android.sources" . "grep -niEHR '_re_' /usr/local/android-sdk/sources")
("android.samples.8" . "grep -niEHR '_re_' /usr/local/android-sdk/samples/android-8")
("android.samples.10" . "grep -niEHR '_re_' /usr/local/android-sdk/samples/android-10")
("android.samples.11" . "grep -niEHR '_re_' /usr/local/android-sdk/samples/android-11")
("android.samples.12" . "grep -niEHR '_re_' /usr/local/android-sdk/samples/android-12")
@alterakey
alterakey / cordova-1.7.0-is11ca.patch
Created May 11, 2012 15:25
Cordova 1.7.0 SQL Database fixup for IS11CA et al.
Author: Takahiro Yoshimura <[email protected]>
Date: Fri May 11 16:59:34 2012 +0900
Patching for IS11CA et al.
diff --git a/assets/www/cordova-1.7.0.js b/assets/www/cordova-1.7.0.js
index abd2a0d..7efc77f 100644
--- a/assets/www/cordova-1.7.0.js
+++ b/assets/www/cordova-1.7.0.js
@@ -1055,7 +1055,7 @@ module.exports = {
@alterakey
alterakey / beats-r10-ics.patch
Created June 3, 2012 13:23
Beats ICS/GN crash fixup (r10)
Index: src/com/beatsportable/beats/GUIGame.java
===================================================================
--- src/com/beatsportable/beats/GUIGame.java (revision 10)
+++ src/com/beatsportable/beats/GUIGame.java (working copy)
@@ -571,7 +571,8 @@
}
// Just in case
- if (h == null) {
+ // GN (4.0.4) tends to reach here with null canvas (kinda race condition?)
@alterakey
alterakey / halfsetup.xml
Created July 29, 2012 02:25
Halfbaked build setup script for Android SDK r20 (WIP)
<?xml version="1.0" encoding="utf-8"?>
<project name="runner-setup">
<!-- Half-baked pre build setup from Android SDK r20 -->
<target name="sdk-build-setup">
<!-- read the previous build mode -->
<property file="${out.build.prop.file}" />
<!-- if empty the props won't be set, meaning it's a new build.
To force a build, set the prop to empty values. -->
<property name="build.last.target" value="" />
<property name="build.last.is.instrumented" value="" />
@alterakey
alterakey / enrico.groovy
Created August 12, 2012 08:15
Enrico Pucci on Primes
class Sieve {
def mLimit = 0;
def mNonPrimes = [] as Set
def mPrimes = [] as Set
def Sieve(limit) {
mLimit = limit;
}
def find() {
@alterakey
alterakey / run-test-android.sh
Last active October 8, 2015 22:38
Crude loopy launcher for android apps
#!/bin/sh
base=`dirname $0`
$base/run-test-ant test-unit-quick c:clean u:test-unit-quick U:test-unit-clean i:test-integ-quick I:test-integ-clean f:test-func-clean a:test-accept-clean l:'debug install run' L:'clean-quick debug uninstall install run' $@
@alterakey
alterakey / factorial.ml
Created October 7, 2012 16:39
OCaml big_int factorial..
module A = struct
open Big_int
let ( * ) = mult_big_int;;
let ( + ) = add_big_int;;
let ( - ) = sub_big_int;;
let ( / ) = div_big_int;;
let ( =~) = eq_big_int;;
let bs = big_int_of_string;;