Skip to content

Instantly share code, notes, and snippets.

View 9re's full-sized avatar

Taro Kobayashi 9re

View GitHub Profile
(function () {
var id = (function () {
var i, l, q, div, el, qs;
el = document.getElementsByTagName('SCRIPT');
el = el[el.length-1];
qs = el.src.split('?').pop().split('&');
l = qs.length;
for (i=0; i<l; i++) {
q = qs[i].split('=');
if (q[0]=='id') {
@9re
9re / gist:754947
Created December 25, 2010 16:57
publish all the flas in the current directory
#!/usr/bin/perl
use strict;
use JSON qw/to_json/;
use IO::All;
use Cwd;
my @flas = ();
my @tempflas = grep {
@9re
9re / gist:755513
Created December 26, 2010 17:12
parse down MovieClip recursively
package
{
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.net.URLRequest;
@9re
9re / gist:833349
Created February 18, 2011 06:49
equal & hashCode
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class ListTest extends Activity {
public static class ModelUnsafe {
@9re
9re / TaskManager.c
Created April 29, 2011 08:37
A Simple Win32 TaskManager
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include <tchar.h>
#define CONFIG_FILE "restart.cfg"
#define KILL "kill"
#define WAIT "wait"
#define START "start"
@9re
9re / Makefile
Created August 9, 2011 17:51
libcurl test
test: test.c
gcc -o test test.c -lcurl
@9re
9re / CopySharedPrefs.java
Created September 3, 2011 15:22
copying shared_prefs
import android.content.Context;
import android.os.Environment;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopySharedPrefs {
@9re
9re / revr.scm
Created September 21, 2011 16:22
re-construction of 'reverse' with only foldr and cons
(define (foldr f z ls)
(if (null? ls)
z
(f (car ls)
(foldr f z (cdr ls)))))
(define (revr ls)
((foldr (lambda (x f)
(lambda (a)
(f (cons x a))))
@9re
9re / ConflictTest-config.xml
Created October 5, 2011 03:08
as3corelib JSON conflicts with Native JSON class for FlashPlayer 11
<flex-config>
<swf-version>13</swf-version>
</flex-config>
@9re
9re / FlashPlayer11Test.as
Created October 20, 2011 07:43
targeting FlashPlayer11 by compiler options
package {
import flash.display.Sprite;
import flash.text.TextField;
public class FlashPlayer11Test extends Sprite {
public function FlashPlayer11Test() {
var tf:TextField = new TextField;
tf.x = tf.y = 10;
tf.width = tf.height = 465;
tf.text = JSON.stringify(tf, ["name", "x", "y", "width", "height"]);
addChild(tf);