Skip to content

Instantly share code, notes, and snippets.

Avatar

Penk Chen penk

View GitHub Profile
View 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 {
View tinywm-xcb.c
/* 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)
{
View NPN_Evaluate
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 Oct 28, 2010
JSEvaluateScript
View gist:650743
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);
View keyboard-layout.txt
iPad bopomofo:
ㄅ ㄉ ˇ ˋ ㄓ ˊ ˙ ㄚ ㄞ ㄢ ㄦ ←
ㄆ ㄊ ㄍ ㄐ ㄔ ㄗ ㄧ ㄛ ㄟ ㄣ 、 ,
ㄇ ㄋ ㄎ ㄑ ㄕ ㄘ ㄨ ㄜ ㄠ ㄤ Enter
_ ㄈ ㄌ ㄏ ㄒ ㄖ ㄙ ㄩ ㄝ ㄡ ㄥ 。
SYM ALT Space SYM ↓
iPad changjie:
@penk
penk / gist:755286
Created Dec 26, 2010
use Net::DBus;
View gist:755286
/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
View hijack_android.sh
#!/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
View google-voice.sh
#!/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 Jun 5, 2017
《TPB AFK 海盜灣 - 暫時離開》 中文字幕
View TPB.AFK.2013.480p.h264-SimonKlose.CHT.srt
1
00:01:47,959 --> 00:01:51,400
三名瑞典人於今日遭到逮捕
罪名是涉嫌架設-
2
00:01:51,560 --> 00:01:57,400
-全世界最大的非法下載站台
3
View start-slatekit.sh
#!/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