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 / gist:5968469
Last active January 22, 2023 20:00
Github 發 Pull Request & 貢獻流程速查

Github 發 Pull Request & 貢獻流程速查

前言

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

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
@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 / 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 / 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 / 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 / VBoxReloadKext.sh
Created February 10, 2012 07:33
reload VirtualBox kernel extension in Mac OS X - good for USB problem on Lino
#!/bin/bash
sudo kextunload -b org.virtualbox.kext.VBoxUSB
sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
sudo kextunload -b org.virtualbox.kext.VBoxDrv
sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/
sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/
sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/
@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>
<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<!-- System -->
<script>
</script>
</head>
/* Contact Manager for maintaining contact cache and access contact db.
* 1. Maintain used contacts in contactData object literal.
* 2. getContactData: Call the callback with contact data.
* Callback will be called twice if cached data turned out to be different than
* the data from db.
*/
var ContactDataManager = {
contactData: {},
getContactData: function cm_getContactData(options, callback) {
var isCacheable = (options.filterBy.indexOf('tel') !== -1 &&