Skip to content

Instantly share code, notes, and snippets.

View penk's full-sized avatar

Penk Chen penk

View GitHub Profile
@penk
penk / comic_leech.pl
Created May 1, 2010 23:53
comic_leech.pl
#!/usr/bin/env perl
# comic_leech.pl - download comic from comic8.com
# example: ./comic_leech.pl http://www.586it.com/type/type-103.html 580-582
# this will fetch 海賊王 from vol.580 to vol.582
use File::Basename;
if ( ! $ARGV[0] ) {
print "Usage: $0 <URL> [<VOL>]\n";
} else {
/* TinyWM is written by Nick Welch <mack@incise.org>, 2005.
* TinyWM-XCB is rewritten by Ping-Hsun Chen <penkia@gmail.com>, 2010
*
* This software is in the public domain
* and is provided AS IS, with NO WARRANTY. */
#include <xcb/xcb.h>
int main (int argc, char **argv)
{
sprintf(buffer,
"if ($('#'+%d.length != 0) { $('#'+%d.remove(); }", This->id, This->id );
if( NPERR_NO_ERROR == NPN_GetValue(instance, NPNVWindowNPObject, &plugin) )
{
NPString script;
script.utf8characters = buffer;
script.utf8length = strlen(script.utf8characters);
NPVariant result;
@penk
penk / gist:650743
Created October 28, 2010 06:06
JSEvaluateScript
WebKitWebFrame *frame;
frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW (web_view));
JSGlobalContextRef context = webkit_web_frame_get_global_context(frame);
JSStringRef script = JSStringCreateWithUTF8CString("console.log('test');");
JSEvaluateScript(context, script, 0, 0, 0, 0);
iPad bopomofo:
ㄅ ㄉ ˇ ˋ ㄓ ˊ ˙ ㄚ ㄞ ㄢ ㄦ ←
ㄆ ㄊ ㄍ ㄐ ㄔ ㄗ ㄧ ㄛ ㄟ ㄣ 、 ,
ㄇ ㄋ ㄎ ㄑ ㄕ ㄘ ㄨ ㄜ ㄠ ㄤ Enter
_ ㄈ ㄌ ㄏ ㄒ ㄖ ㄙ ㄩ ㄝ ㄡ ㄥ 。
SYM ALT Space SYM ↓
iPad changjie:
@penk
penk / gist:755286
Created December 26, 2010 07:42
use Net::DBus;
/usr/share/perl5/XML/Twig
/usr/share/perl5/XML/Twig.pm
/usr/lib/perl5/Net/DBus
/usr/lib/perl5/Net/DBus.pm
/usr/lib/perl5/auto/Net/DBus
/usr/share/perl5/Tie/
/usr/bin/xpath
/usr/share/perl5/XML/XPath
/usr/share/perl5/XML/XPath.pm
/usr/share/perl/5.10/strict.pm
#!/bin/busybox sh
mount -o remount,rw /
mount -o remount,rw /system
mkdir -p /mnt/rootfs
mkdir -p /var/log /tmp /run
mv /system/bin/app_process /system/bin/app_process.bak
cp -ap /mnt/rootfs/etc/X11 /etc
killall zygote
killall bootanimation
#!/bin/bash
arecord -f cd -t wav -r 16000 -d 5 | flac -f - -o sample.flac
wget -q -U "Mozilla/5.0" --post-file sample.flac --header="Content-Type: audio/x-flac; rate=16000" -O - \
"http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium"
@penk
penk / TPB.AFK.2013.480p.h264-SimonKlose.CHT.srt
Last active June 5, 2017 03:49
《TPB AFK 海盜灣 - 暫時離開》 中文字幕
1
00:01:47,959 --> 00:01:51,400
三名瑞典人於今日遭到逮捕
罪名是涉嫌架設-
2
00:01:51,560 --> 00:01:57,400
-全世界最大的非法下載站台
3
#!/bin/bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export QT_QWS_FONTDIR=/usr/share/fonts/truetype/droid/
if [ ! -e /dev/fb0 ]; then
/bin/ln -s /dev/graphics/fb0 /dev/fb0
fi
export TSLIB_FBDEVICE=/dev/graphics/fb0
export TSLIB_CONFFILE=/etc/ts.conf