Skip to content

Instantly share code, notes, and snippets.

View timdream's full-sized avatar
🏃‍♂️
I may be slow to respond.

Timothy Guan-tin Chien timdream

🏃‍♂️
I may be slow to respond.
View GitHub Profile
@timdream
timdream / index.html
Created May 28, 2012 03:59
Key event test
<!DOCTYPE html>
<html manifest="manifest.appcache">
<body>
Tap on the black space to test key events bubbling from mozbrowser.
Tap on the red space to test key events bubbling from mozbrowser within mozbrowser.
<iframe width=400 height=600 mozbrowser src="data:text/html,<body bgcolor=black>&lt;iframe mozbrowser src='data:text/html,<body bgcolor=red>'>&lt;/iframe></body>"></iframe>
<script>
['keydown', 'keypress', 'keyup'].forEach(function (type) {
window.addEventListener(type, function (evt) {
@timdream
timdream / .git_config
Created April 25, 2012 03:01
git-svn conversion for moztw-web
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[svn-remote "svn"]
url = http://svn.openfoundry.org/moztw
fetch = :refs/remotes/git-svn
[svn]
authorsfile = /home/timdream/repo/moztw/authors.txt
@timdream
timdream / pullme.php
Last active October 2, 2015 21:38
Minimuist pull me script that work with Github hook
<?php
/* host machine settings */
$GIT_BIN = '/usr/local/bin/git';
$LOCAL_USER = 'www';
/* remote repo settings */
$REMOTE = 'origin';
$BRANCH = 'production';
@timdream
timdream / test.sh
Created January 4, 2012 02:37
rebase fail
#!/bin/sh
cd /tmp
# init remote
mkdir remote.git
cd remote.git
git init --bare
/*!
*
* Imgur CORS Image upload
*
* Author & Copyright: timdream (timdream@gmail.com; http://timdream.org/)
* License: MIT LICENSE
*
*/
"use strict";
@timdream
timdream / func.php
Created April 11, 2011 09:04
Get COSCUP sponsor list from GData table
<?php
/*
getSponsorListFromRemote($key)
@param: key = key of google spreadsheet doc
@return:
false on failure
array when success
@timdream
timdream / sessions.js
Created March 30, 2011 16:23
議程 JSON
[
{
name: '測是',
from: 1234456788, /* Unix timestamp */
to: 123456778,
type: 1,
room: 0,
language: 'zh', /* 'zh' or 'en', 我們應該不會有日文議程 */
speaker: '陳愛講', /* 名字 (頭銜)*/
speakerTitle: '測試大學愛講系教授',
@timdream
timdream / sponsors.js
Created March 30, 2011 16:09
贊助商列表 JSON
{
gold: [
{
name : '測試廠商',
url: 'http://...../',
logoURL: 'http://..../...png',
desc: '<p>dsfasdfsdaf</p><p>dfasdfd<a href="dsafsad">asdfdsaf </a>sfsaf.</p>', /* 轉好的 HTML */
enName: 'Test Corp.',
enDesc: '<p>dsfasdfsdaf</p><p>dfasdfd<a href="dsafsad">asdfdsaf </a>sfsaf.</p>'
}
<?php
header('Content-Type: text/plain');
/* Keep the location of this file secret so we won't overload the sharehosting */
$CONF = array(
'path' => '../2011',
'user' => 'timdream',
'repo' => 'coscup-landingpage',
@timdream
timdream / gist:668656
Created November 9, 2010 03:35
One of the possible yet ugly answer to get rid of flag variable
function doSomethingWithArray(arr) {
doArray : {
// check the array
for (var i; i < arr.length; i++) {
if (arr[i] === 0) {
console.log('item at ' + i.toString(10) + 'is zero.');
flag = true;