Skip to content

Instantly share code, notes, and snippets.

View alantsai's full-sized avatar

Alan Tsai alantsai

View GitHub Profile
@alantsai
alantsai / git_clone_error_early_EOF
Created September 11, 2015 02:08
git clone error: fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed From http://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning
git config --global http.postBuffer 524288000
# some comments below report having to double the value:
git config --global http.postBuffer 1048576000
@alantsai
alantsai / ps_get_iis_wbsite_log_location.ps1
Last active November 19, 2015 08:58
Get iis website log location using powershell 快速取得某一個iis 站台的log位置 From http://stackoverflow.com/questions/6426375/where-can-i-find-the-iis-logs #powershell
# 把{yoursite}換成iis站台名稱
# 把log位置顯示在 powershell
Get-Website {yoursite} | % { Join-Path ($_.logFile.Directory -replace '%SystemDrive%', $env:SystemDrive) "W3SVC$($_.id)" }
# 用explorer開啟log資料夾
Get-Website {yoursite} | % { Join-Path ($_.logFile.Directory -replace '%SystemDrive%', $env:SystemDrive) "W3SVC$($_.id)" } | ii
@alantsai
alantsai / ps_renameFile_containParentDirectoryFirst2char.ps1
Last active November 19, 2015 08:58
Windows Phone無法用資料夾來區分影片,因此只能夠用檔名。而檔名通常沒有到資料夾層級。因此,這個Powershell script用資料夾前2個字元(通常表示那個章節)加上本身檔名讓整個做grouping。 #powershell
# 範例資料結構
# 原本是:
# 01 Chapter1/01.xxx.mp4
# 01 Chapter1/02.xxx.mp4
# 02 Chapter2/01.xxx.mp4
# 02 Chapter2/02.xxx.mp4
#
# 執行完:
# 01 Chapter1/01_01.xxx.mp4
# 01 Chapter1/01_02.xxx.mp4
@alantsai
alantsai / !use_instruction.md
Last active July 11, 2019 05:50
Chocolatey Install Scripts use by BoxStarter

set powershell executing policy

Set-ExecutionPolicy Remotesign -Force

Original link http://boxstarter.org/Learn/WebLauncher

Step 3

Install the Boxstarter Modules

You can download the Boxstarter module installer from this web site or you can use Chocolatey to install the Boxstarter. Alternatively, you may invoke the module installer over the web using powershell.

@alantsai
alantsai / jsbin.OfaVEkIG.html
Last active February 12, 2019 05:45
選取所有checkbox和判斷是否全部checkbox已經被勾選
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="選取所有checkbox和判斷是否全部checkbox已經被勾選" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<form>