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>
import QtQuick 2.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0
import QtQuick.Window 2.0
import Ubuntu.Components 0.1
MainView {
width: Screen.width
height: Screen.height
@penk
penk / oauth.js
Last active August 15, 2018 13:30
Obtain oauth_token from Launchpad.net using Casper.js
/*
* oauth.js - Obtain oauth_token from Launchpad.net using Casper.js
* Copyright (c) 2013, Ping-Hsun (penk) Chen <penk.chen@canonical.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.
*
* Usage: casperjs oauth.js <OTP>
@penk
penk / async-phantom.js
Last active August 15, 2018 13:29
Parallel crawler example using PhantomJS and Aysnc.js
// usage: phantomjs async-phantom.js
var async = require('async'),
links = [
"http://google.com",
"http://yahoo.com",
"http://duckduckgo.com",
"http://bing.com",
];
@penk
penk / TempleRunabout.md
Last active December 21, 2015 18:39
《宮廟人生 / Temple Runabout》 紙牌遊戲設計草稿

##遊戲玩法 輪流抽取「問事」事件牌, 對手玩家回應「問神/解籤」

  • 成功 - 獲取資源 (例:『隨喜功德』)
  • 失敗 - 上社會新聞, 失去特定資源 (例:『搬去南投貨櫃屋, 損失財產 30 萬』)

###遊戲道具: 筊杯一組、角色卡、事件牌、資源卡

###角色卡? 按照不同派別有技能加成 (感覺可以一次得罪所有宗教團體)

# fetch Oxide WebView repo
bzr branch lp:oxide
# install gclient
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:`pwd`/depot_tools
# get Chromium source and dependencies (~7.8G)
cd oxide/chromium/
gclient sync --gclientfile=../gclient.conf
@penk
penk / README.md
Last active January 3, 2016 05:19
Project DuckyMomo

NAME

Ducky Momo - tool to query results from launchpad crawler

SCREENSHOT

Screenshot

USAGE

@penk
penk / enable_oxide_on_eglfs.patch
Last active May 19, 2017 01:42
Enabled Oxide WebView on EGLFS QPA
--- oxide-qt-1.5.5.orig/qt/core/browser/oxide_qt_browser_startup.cc
+++ oxide-qt-1.5.5/qt/core/browser/oxide_qt_browser_startup.cc
@@ -155,7 +155,7 @@ void BrowserStartup::EnsureChromiumStart
if (platform == QLatin1String("xcb")) {
supported_gl_impls |= oxide::SUPPORTED_GL_IMPL_DESKTOP_GL;
supported_gl_impls |= oxide::SUPPORTED_GL_IMPL_EGL_GLES2;
- } else if (platform.startsWith("ubuntu")) {
+ } else if (platform.startsWith("ubuntu") || platform.startsWith("egl")) {
supported_gl_impls |= oxide::SUPPORTED_GL_IMPL_EGL_GLES2;
} else {
@penk
penk / Makefile
Last active April 10, 2019 05:45
SlateKit Base makefile
all:
for i in `find rootfs/ -type f`; do \
if [ "$$i" = "rootfs//lib64/ld-linux-x86-64.so.2" ]; then continue; \
else \
for j in `ldd $$i | cut -d \( -f1 | cut -d \> -f2 | sed 's/[ \t]*//g'`; do \
if [ ! "$$j" = "notadynamicexecutable" ] && [ ! "$$j" = "staticallylinked" ]; then \
mkdir -p rootfs/`dirname $$j`; \
cp -v -rfpL --remove-destination $$j rootfs/$$j; fi; \
done; \
fi \
@penk
penk / oxide.qml
Last active June 9, 2018 08:46
Example of Using Oxide with User Script
import QtQuick 2.0
import com.canonical.Oxide 0.1
WebView {
width: 800
height: 600
url: 'http://google.com'
context: WebContext {
userAgent: "Mozilla/5.0 (Ubuntu; Tablet) WebKit/537.21"