Skip to content

Instantly share code, notes, and snippets.

View aaronchiang's full-sized avatar

Aaron Chiang aaronchiang

View GitHub Profile
@aaronchiang
aaronchiang / .gitconfig
Created December 27, 2017 06:24 — forked from danny0838/.gitconfig
實用的 Git 配置值
[core]
quotepath = false # 中文檔名如實顯示而不轉碼
autocrlf = false # commit 及 checkout 時不根據作業系統轉換檔案的換行字元 (避免不小心改動原 repo 的換行字元)
safecrlf = false # 檢查文字類檔案是否混合了 CRLF 及 LF 換行字元 (搭配 autocrlf,這裡一起關閉)
ignorecase = false # 檔名大小寫不同時視為相異 (更動大小寫才能 commit)
whitespace = cr-at-eol # diff 時行尾 CRLF 不顯示 ^M
fileMode = false # 忽略檔案的 x 屬性 (for Windows)
symlinks = false # 忽略符號連結 (for Windows)
editor = /usr/bin/vim # 預設的文字編輯器 (for Linux)
[alias]
@aaronchiang
aaronchiang / Angular 5 開發環境說明.md
Created November 10, 2017 00:51 — forked from doggy8088/Angular 17 Dev Setup.md
Angular 5 開發環境說明

Angular 5 開發環境說明

為了能讓大家能夠順利的建立起 Angular 5 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

[ 作業系統 ]

  • Windows 7 以上版本 (更新到最新 Service Pack 版本)
  • Mac OS X 10.6 以上版本

[ 套件管理器 ( Mac OS X Only ) ]

public static class LINQPadExtensions
{
private static readonly Dictionary<Type, string> TypeAliases = new Dictionary<Type, string> {
{ typeof(int), "int" },
{ typeof(short), "short" },
{ typeof(byte), "byte" },
{ typeof(byte[]), "byte[]" },
{ typeof(long), "long" },
{ typeof(double), "double" },
{ typeof(decimal), "decimal" },
@aaronchiang
aaronchiang / merge-pdf-ghostscript.md
Created May 12, 2017 02:45 — forked from brenopolanski/merge-pdf-ghostscript.md
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@aaronchiang
aaronchiang / gist:a8f5e1d56e0164c3ce9c46c63c084715
Created February 14, 2017 03:31 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@aaronchiang
aaronchiang / init.lua
Created October 5, 2016 01:16 — forked from lucifr/init.lua
My Hammerspoon config file
-- -------------------------------
-- Watcher for changes of init.lua
-- -------------------------------
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
@aaronchiang
aaronchiang / gist:542f2622d11bc4dd6aebd7af179dfe51
Created May 17, 2016 08:59
Improved the performance for SourceTree on Windows
git config --global core.preloadindex true
git config --global core.fscache true
@aaronchiang
aaronchiang / reg_vscode.bat
Created January 14, 2016 01:05
OpenWithVSCode on Windows
@echo off
SET codePath=C:\Program Files (x86)\Microsoft VS Code\code.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@aaronchiang
aaronchiang / OpenWithSublimeText3.bat
Created July 31, 2015 00:50
OpenWithSublimeText3.bat
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
public static string GetKeyDownString(KeyEventArgs args)
{
var value = "";
if ((Keyboard.Modifiers & ModifierKeys.Control) > 0)
{
value += "Ctrl+";
}
if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0)