Skip to content

Instantly share code, notes, and snippets.

View qrtt1's full-sized avatar
🎯
Focusing

Ching Yi, Chan qrtt1

🎯
Focusing
View GitHub Profile
@qrtt1
qrtt1 / Example_jPlurk_OAuth.java
Created September 16, 2011 18:47
jPlurk_OAuth example
package com.google.jplurk_oauth.example;
import java.util.Properties;
import com.google.jplurk_oauth.Qualifier;
import com.google.jplurk_oauth.module.Timeline;
import com.google.jplurk_oauth.skeleton.PlurkOAuth;
import com.google.jplurk_oauth.skeleton.RequestException;
public class Example {
@qrtt1
qrtt1 / example.diff
Created March 10, 2012 02:39
interrupt changes after ffmpeg n0.9
-static int decode_interrupt_cb(void)
+static int decode_interrupt_cb(void *ctx)
{
- q_pressed += read_key() == 'q';
- return q_pressed > 1;
+ return received_nb_signals > 1;
}
-static int ffmpeg_exit(int ret)
+static const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
@qrtt1
qrtt1 / EatMemory.java
Last active October 1, 2015 18:18
misc & blogger
public class EatMemory
{
public static void main (String[] args) throws Exception
{
java.util.Vector v = new java.util.Vector();
int count = 1024;
while(count-->0)
{
v.add(new byte[1024 * 1024]);
@qrtt1
qrtt1 / gist:2178050
Created March 24, 2012 04:00
libgmp reminder
----------------------------------------------------------------------
Libraries have been installed in:
/home/qrtt1/app/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
@qrtt1
qrtt1 / cfg_libmp3lame.sh
Created July 11, 2012 18:42
ndk-path-helper
#!/bin/bash
PREFIX=./OUTPUT
ADDITIONAL_CONFIGURE_FLAG=
MY_NDK_LIB=/Users/qrtt1/app/NDKs/android-ndk-r8/platforms/android-9/arch-mips/usr/lib
MY_NDK_INCLUDE=/Users/qrtt1/app/NDKs/android-ndk-r8/platforms/android-9/arch-mips/usr/include
MY_NDK_CC_PREFIX=/Users/qrtt1/app/NDKs/android-ndk-r8/toolchains/mipsel-linux-android-4.4.3/prebuilt/darwin-x86/bin/mipsel-linux-android-
MY_NDK_CC=/Users/qrtt1/app/NDKs/android-ndk-r8/toolchains/mipsel-linux-android-4.4.3/prebuilt/darwin-x86/bin/mipsel-linux-android-gcc
def wait_to_done(progress, wait_time=120, mesg=""):
import time
for i in range(wait_time):
if mesg != "":
print "%s" % mesg, progress.getState()
if "failed" == progress.getState():
return 0
if i > 7:
# a work around for stuck wlst script
edit()
@qrtt1
qrtt1 / cfg.sh
Created November 19, 2012 06:31
MiCloud Configurations
yum_cfg=https://raw.github.com/gist/4109252/2899290f3749bb7ce4a5a6934757512d9b980523/yum.base.cfg
curl $yum_cfg > /etc/yum.repos.d/CentOS-Base.repo
yum install -y wget pkgconfig openssl-devel java-1.6.0-openjdk
wget http://s3.amazonaws.com/muzee.tools/RPMS/rtmpdump-2.4-1.el6.x86_64.rpm
wget http://s3.amazonaws.com/muzee.tools/RPMS/muzee.ffmpeg-0.9.3-1.el6.x86_64.rpm
rpm -ivh rtmpdump-2.4-1.el6.x86_64.rpm
rpm -ivh muzee.ffmpeg-0.9.3-1.el6.x86_64.rpm
@qrtt1
qrtt1 / Main.java
Last active December 10, 2015 16:19
azure java sdk lab
//
// learning from http://www.windowsazure.com/en-us/develop/java/how-to-guides/blob-storage
//
package net.muzee.az;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URISyntaxException;
@qrtt1
qrtt1 / packaging.js
Created January 15, 2013 09:26
My Remote Scripting Lab
/* run ant script to packaging changed files */
var commands = "cd c:\\ind\\UpdateServer\nant pack.update.zip";
var ret = std.system(commands);
/* upload the zip artifact to repo server */
var zipInfo = std.findLine(ret, "Building zip");
var zipFile = std.strAfter(zipInfo[0], "Building zip: ");
std.log(">>" + zipFile + "<<");
std.upload(zipFile);
@qrtt1
qrtt1 / evaluation_myvideo.md
Last active December 17, 2015 03:08
myvideo 歷險記

myvideo 線上租片經驗

前置條件

  1. 無台灣大哥大帳號,使用 fb 登入 myvideo
  2. 請客服刪除綁定裝置
  3. 請客服取消交易

註:交易其實只有 99 元而已,我現在更好奇的是,這流程完成要多久!?