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 / b2_create_key_rclone_sync.sh
Created July 30, 2021 07:19
B2 key for `rclone sync`
#!/bin/bash
# B2 key for `rclone sync`. Can upload/list/shadow delete but not real deletion.
# Adopted from https://github.com/sequentialread/password-manager#hosting-it-yourself
BACKBLAZE_KEY_ID=""
BACKBLAZE_SECRET_KEY=""
BUCKET_NAME=""
KEY_NAME=""
@timdream
timdream / changes.diff
Last active October 28, 2018 02:22
removing onbounce etc
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 / proxy.pac
Last active May 24, 2019 22:00
calypso.localhost
function FindProxyForURL(url, host) {
if (host === 'cdn.apple-mapkit.com' && url.indexOf('mk') !== -1) {
return "PROXY 127.0.0.1:443";
}
if (host === 'calypso.localhost') {
return 'PROXY 127.0.0.1:3000';
}
return FindProxyForURL_Automattic(url, host);
@timdream
timdream / gecko-printf.cpp
Last active August 8, 2018 02:33
printf() something in Gecko 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");
///////////////////////////
@timdream
timdream / keybase.md
Created June 29, 2015 00:11
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 August 29, 2015 14:14
Private method/property with WeakMap
'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.
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 March 16, 2016 15:08
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:

  • update.sh should go to $B2G (the place you clone B2G repo with git).
@timdream
timdream / 25-Heiti.conf
Last active December 19, 2015 19:29
Heiti fontconfig
<?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 January 22, 2023 20:00
Github 發 Pull Request & 貢獻流程速查

Github 發 Pull Request & 貢獻流程速查

前言

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

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository