Skip to content

Instantly share code, notes, and snippets.

View penk's full-sized avatar

Penk Chen penk

View GitHub Profile
@penk
penk / ubuntu_ui_toolkit_for_mac_osx.patch
Created June 3, 2013 22:23
Ported Ubuntu Components to Mac OSX and Qt 5.0.2
=== modified file 'modules/Ubuntu/Components/plugin/plugin.cpp'
--- modules/Ubuntu/Components/plugin/plugin.cpp 2013-05-21 11:06:55 +0000
+++ modules/Ubuntu/Components/plugin/plugin.cpp 2013-06-03 21:51:32 +0000
@@ -18,7 +18,7 @@
#include <QtQml>
#include <QtQuick/private/qquickimagebase_p.h>
-#include <QDBusConnection>
+//#include <QDBusConnection>
#include <QtGui/QGuiApplication>
#!/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
@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
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"
#!/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
@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
iPad bopomofo:
ㄅ ㄉ ˇ ˋ ㄓ ˊ ˙ ㄚ ㄞ ㄢ ㄦ ←
ㄆ ㄊ ㄍ ㄐ ㄔ ㄗ ㄧ ㄛ ㄟ ㄣ 、 ,
ㄇ ㄋ ㄎ ㄑ ㄕ ㄘ ㄨ ㄜ ㄠ ㄤ Enter
_ ㄈ ㄌ ㄏ ㄒ ㄖ ㄙ ㄩ ㄝ ㄡ ㄥ 。
SYM ALT Space SYM ↓
iPad changjie:
@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);
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;
/* 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)
{