Skip to content

Instantly share code, notes, and snippets.

@ku
ku / swfparser.js
Created October 21, 2008 15:23
swfparser.js
//
// http://gist.github.com/18326
//
// Copyright (c) KUMAGAI Kentaro ku0522a*gmail.com
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
//
@ku
ku / gist:18979
Created October 23, 2008 10:04
gzip deflate
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#define BFSIZE (32 * 1024)
@ku
ku / gist:19420
Created October 24, 2008 13:25
WordPress dashboard delicious&hatena
// ==UserScript==
// @name del.icio.us bookmarkcount
// @namespace http://ido.nu/kuma/
// @description
// @include http://ido.nu/kuma/wp-admin/*
// @_include http://d.hatena.ne.jp/ku0522/archive
// ==/UserScript==
/*
MD5
Copyright (C) 2007 MITSUNARI Shigeo at Cybozu Labs, Inc.
@ku
ku / gist:23493
Created November 10, 2008 13:57
fashionsnap.user.js
// Copyright 2008, ku ku0522a*gmail.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
@ku
ku / gist:23897
Created November 11, 2008 17:01
radiorecorder.js
// **** BEGIN LICENSE BLOCK ****
// Copyright(c) 2008 ku ku0522a*gmail.com
//
// 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 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@ku
ku / xpath replace
Created November 12, 2008 04:12
xpath replace
var i = document.forms[0]["data[imageSource]"];
var exp = i.value;
function f (exp) {
var [x,s,r] = exp.split(/\s*,\s*/);
return 'concat( substring-before('+x+',"'+s+'"), "'+r+'", substring-after('+x+',"'+s+'"))';
} ;
i.value = f(exp);
@ku
ku / gist:26430
Created November 19, 2008 05:32
C function pointer
#include <stdio.h>
int x2 (int n ) { return n*2; }
int x4 (int n ) { return n*4; }
int (*op[])(int) = {
x2,
x4
};
@ku
ku / CGAffineTransform in jscocoa
Created November 22, 2008 10:07
iview transform js test
var anim = 1;
if ( anim ){
UIView.beginAnimations_context(null, null);
UIView.setAnimationDuration(0.4)
}
var orientation = 1;
var x = TransitionView.image.image.size.width;
@ku
ku / gist:33794
Created December 9, 2008 05:39
apride.js
//
// AuroPagerize IDE
//
// auther: KUMAGAI Kentaro, GMO Internet lab. http://labs.gmo.jp/blog/ku/
// version: 0.1.0 2008/12/9
//
// this bookmarklet helps to create rules for Mozilla Firefox Greasemonkey script
// AutoPagerize http://userscripts.org/scripts/show/8551
//
// Released under the GPL license
@ku
ku / gist:46873
Created January 14, 2009 11:58
clipboard_poster.js
models.register( {
name : 'Clipboard',
ICON : 'data:image/png;base64,'+
'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0'+
'U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHvSURBVDjLjZI/aFNRFMZ/Ly+GlCYlaMF/'+
'1D+4FQRJREigk7OiIAguHSwUkrkgLhVcpIurQjdBcLAITi4FETpIAw46CGIHJ0tFamlt3rvnfA7J'+
'i2kTwQOXe4b7/c73HW4kCYCnc+engU8M1/b88kaFf1T05O65KvAAuFY6epw79xfZ3XoPwPjkFZ4t'+
'3uP37i+A58DK/PLGy0FAHli5euPmmbFSmfTrByRhnV0AJDFzcYrcyQtIuvXm1evrwBDg7FhpgmRn'+