Skip to content

Instantly share code, notes, and snippets.

Timothy Guan-tin Chien timdream

View GitHub Profile
@timdream
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
}
nsMapRuleToAttributesFunc
HTMLMarqueeElement::GetAttributeMappingFunction() const
{
return &MapAttributesIntoRule;
@timdream
timdream / README.md
Created Jun 6, 2018
PTT 自動登入
View README.md
@timdream
timdream / proxy.pac
Last active Nov 18, 2017
calypso.localhost
View proxy.pac
function FindProxyForURL(url, host) {
if (host === 'calypso.localhost') {
return 'PROXY 127.0.0.1:3000';
}
return FindProxyForURL_Automattic(url, host);
}
function FindProxyForURL_Automattic( url, host ) {
if ( isPlainHostName( host ) ) {
@timdream
timdream / gecko-printf.cpp
Last active Aug 8, 2018
printf() something in Gecko CPP
View gecko-printf.cpp
///////////////////////////
nsAutoString value;
input->GetTextValue(value);
printf("****************************************************************************************\n");
printf("%s\n", NS_ConvertUTF16toUTF8(value).get());
printf("****************************************************************************************\n");
printf("%s\n", NS_ConvertUTF16toUTF8(mSearchString).get());
printf("****************************************************************************************\n");
///////////////////////////
View keybase.md

Keybase proof

I hereby claim:

  • I am timdream on github.
  • I am timdream (https://keybase.io/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
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') {
return;
}
this.state = 'fulfilled';
@timdream
timdream / README.md
Last active Mar 16, 2016
Build and update your own B2G build daily-ish without blow away data. Now comes with localization testing.
View README.md

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:

  • update.sh should go to $B2G (the place you clone B2G repo with git).
@timdream
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 -->
<fontconfig>
<match target="font">
<test qual="any" name="family">
<string>Heiti SC</string>
<string>黑體-簡</string>
<string>黒体-簡</string>
<string>Heiti-간체</string>
@timdream
timdream / gist:5968469
Last active Aug 23, 2018
Github 發 Pull Request & 貢獻流程速查
View gist:5968469

Github 發 Pull Request & 貢獻流程速查

前言

此文目標讀者需先自行學會

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
You can’t perform that action at this time.