Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Timothy Guan-tin Chien timdream

I may be slow to respond.
View GitHub Profile
timdream / changes.diff
Last active Oct 28, 2018
removing onbounce etc
View changes.diff
diff --git a/dom/html/HTMLMarqueeElement.cpp b/dom/html/HTMLMarqueeElement.cpp
--- a/dom/html/HTMLMarqueeElement.cpp
+++ b/dom/html/HTMLMarqueeElement.cpp
@@ -125,16 +125,52 @@ HTMLMarqueeElement::IsAttributeMapped(co
HTMLMarqueeElement::GetAttributeMappingFunction() const
return &MapAttributesIntoRule;
timdream / proxy.pac
Last active May 24, 2019
View proxy.pac
function FindProxyForURL(url, host) {
if (host === '' && url.indexOf('mk') !== -1) {
return "PROXY";
if (host === 'calypso.localhost') {
return 'PROXY';
return FindProxyForURL_Automattic(url, host);
timdream / gecko-printf.cpp
Last active Aug 8, 2018
printf() something in Gecko CPP
View gecko-printf.cpp
nsAutoString value;
printf("%s\n", NS_ConvertUTF16toUTF8(value).get());
printf("%s\n", NS_ConvertUTF16toUTF8(mSearchString).get());

Keybase proof

I hereby claim:

  • I am timdream on github.
  • I am timdream ( on keybase.
  • I have a public key whose fingerprint is F0BB E548 E897 C929 6D2E 274D 1679 F06F 99C1 1F99

To claim this, I am signing this object:

timdream / private_instance_weakmap.js
Last active Aug 29, 2015
Private method/property with WeakMap
View private_instance_weakmap.js
'use strict';
* Demonstration for creating private variable/method in JavaScript
* constrcutors, with WeakMap trick.
* The idea here is to create two WeakMaps to link a public instance and
* a private instance, and two shorthand query function to query between two.
* Both instances can therefore have their own methods respectively.
View sync_promise.js
var SyncPromise = function(callback) {
this._resolveCallbacks = [];
this._rejectCallbacks = [];
var resolve = (function resolve(value) {
if (this.state !== 'pending') {
this.state = 'fulfilled';
timdream /
Last active Mar 16, 2016
Build and update your own B2G build daily-ish without blow away data. Now comes with localization testing.

B2G Personal daily dogfooding instruction

This is how I generate my dogfood build, daily-ish. I do so to ensure I have (almost) total control over what goes into my phone so I could pick up the changes anytime I wanted (and indentifying the version of Gaia/Gecko I am using).

This instruction is used for Geeksphone Peak and with zh-TW locale. Replace/remove instruction for your own phone.

File locations:

  • should go to $B2G (the place you clone B2G repo with git).
timdream / 25-Heiti.conf
Last active Dec 19, 2015
Heiti fontconfig
View 25-Heiti.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- Heiti Configure File -->
<match target="font">
<test qual="any" name="family">
<string>Heiti SC</string>
timdream / gist:5968469
Last active Aug 1, 2020
Github 發 Pull Request & 貢獻流程速查
View gist:5968469

Github 發 Pull Request & 貢獻流程速查



  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
View index.html
<!DOCTYPE html>
<html manifest="manifest.appcache">
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<!-- System -->
You can’t perform that action at this time.