Skip to content

Instantly share code, notes, and snippets.

@pisceanfoot
pisceanfoot / CustomCredentials.cs
Last active November 25, 2015 12:49
a custom wsse header (UserNameToken,Nonce) for webservice using WCF
// http://weblog.west-wind.com/posts/2012/Nov/24/WCF-WSSecurity-and-WSE-Nonce-Authentication
public class CustomCredentials : ClientCredentials
{
public CustomCredentials()
{ }
protected CustomCredentials(CustomCredentials cc)
: base(cc)
{ }
@pisceanfoot
pisceanfoot / powershell.ps1
Created September 16, 2014 06:03
powershell run with ExecutionPolicy Unrestricted
powershell.exe -ExecutionPolicy Unrestricted .\build-me.ps1 -RunDebugBuild -1
@pisceanfoot
pisceanfoot / mklink.bat
Created September 16, 2014 05:59
create a folder link in cmd
@pisceanfoot
pisceanfoot / TypeGuessRows.reg
Created September 16, 2014 05:53
SSIS.Excel.TypeGuessRows.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Excel]
"TypeGuessRows"=dword:00000000
@pisceanfoot
pisceanfoot / remove_folder
Created August 5, 2014 12:54
remove windows folder
DEL /F /A /Q \\?\%1
RD /S /Q \\?\%1
@pisceanfoot
pisceanfoot / clientwidth
Created July 24, 2014 02:42
Javascript get client width
var clientWidth=function(){return document.documentElement.clientWidth||document.body.clientWidth;}
@pisceanfoot
pisceanfoot / stringtocode
Created June 28, 2014 06:02
convert string to c# code
string src = RtxtSource.Text;
if (string.IsNullOrEmpty(src)) return;
string[] dest = src.Split(new string[]{"\r", "\n"}, StringSplitOptions.RemoveEmptyEntries);
StringBuilder builder = new StringBuilder();
builder.AppendLine("StringBuilder builder = new StringBuilder();");
for (int i = 0; i < dest.Length; i++)
{
string tmp = dest[i];
tmp = tmp.Replace("\\", "\\\\");
@pisceanfoot
pisceanfoot / SBCCaseToNumberic
Created June 28, 2014 06:01
将全角数字转换为数字
/// <summary>
/// 将全角数字转换为数字
/// </summary>
/// <param name="SBCCase"></param>
/// <returns></returns>
public string SBCCaseToNumberic(string SBCCase)
{
char[] c = SBCCase.ToCharArray();
for (int i = 0; i < c.Length; i++)
{
@pisceanfoot
pisceanfoot / tfs
Last active August 29, 2015 14:02
custom setting in TFS compare
Beyond Compare 3
(Pro / 3-way merge) BComp.exe %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9
Compare:BComp.exe %1 %2 /title1=%6 /title2=%7
Merge:BComp.exe %1 %2 /savetarget=%4 /title1=%6 /title2=%7
@pisceanfoot
pisceanfoot / CLASSPATH
Created May 21, 2014 01:09
JAVA CLASSPATH
CLASSPATH值为:.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\bin;