Skip to content

Instantly share code, notes, and snippets.

@pisceanfoot
pisceanfoot / gist:c366ea49c96a9888ed4d
Last active August 29, 2015 14:17
delete folder when path is to long, windows
Example: If you have a folder path that's too long such as:
D:\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles\BackupFolder\Copy\MyFiles,
follow these instructions to delete it.
Create an empty folder, such as C:\Users\Name\Desktop\temp.
Open a Command Prompt window.
Type robocopy C:\Users\Name\Desktop\temp D:\BackupFolder /purge
Note: If there are spaces in either path in Step 3, the path must be inclosed by quotation marks.
@pisceanfoot
pisceanfoot / MVCMockContext
Created March 19, 2015 06:14
MVCMockContext
public class MVCMockContext
{
public ControllerContext ControllerContext
{
get;
set;
}
public HttpContextBase HttpContextBase
{
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = ssh://[email protected]:7999/lsd/login-handler.git
@pisceanfoot
pisceanfoot / Envelope
Last active August 29, 2015 14:15
Envelope response
Content-Type: application/soap+xml;charset=UTF-8
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<ns2:staffLoginServiceResponse xmlns:ns2="http://webservice.elearning.ws.sis.gms.mev.atos.net/">
<staffResult>
<staff>
<givenName>Availability</givenName>
<lastName>Availability</lastName>
<password>Rio.2016</password>
git local branch:
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads
git branch -vv
@pisceanfoot
pisceanfoot / git
Last active August 29, 2015 14:11
git tip
git local branch:
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads
git branch -vv # show branch behind or ahead
git branch --no-merged # show branch not merge into current branch
git branch -r --no-merged # show remote branch
git branch --merged # show merged branch
git branch -r --merged # show remote branch
@pisceanfoot
pisceanfoot / svcutil
Created December 18, 2014 08:49
svcutil, wsdl, webservice
svcutil.exe elearningws-v1.1.wsdl /t:code /l:c# /o:"MerchantService.cs"
@pisceanfoot
pisceanfoot / Exported-2014-12-05-keyboard.vssettings
Created December 10, 2014 06:58
backup my visual studio keyboard settings
<UserSettings>
<ApplicationIdentity version="11.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_KeyBindings" Category="{F09035F1-80D2-4312-8EC4-4D354A4BCB4C}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_KeyBindings" PackageName="Visual Studio Environment Package">
<Version>11.0.0.0</Version>
<KeyboardShortcuts>
<ScopeDefinitions>
@pisceanfoot
pisceanfoot / xcopy.bat
Last active August 29, 2015 14:06
xcopy
xcopy /s /y "$(SolutionDir)packages\1.1.1\native\*.*" "$(TargetDir)"
xcopy.exe {a} {b} /Y/E/K/H/R/I/Q
@pisceanfoot
pisceanfoot / UserNameClientCredentials.cs
Last active September 28, 2022 15:32
WCF behavior, UserNameClientCredentials
/*
*client.ChannelFactory.Endpoint.Behaviors.Remove<System.ServiceModel.Description.ClientCredentials>();
*client.ChannelFactory.Endpoint.Behaviors.Add(new CustomCredentials());
*client.ClientCredentials.UserName.UserName = username;
*client.ClientCredentials.UserName.Password = password;
*/
public class UserNameClientCredentials : ClientCredentialsElement
{
private ConfigurationPropertyCollection properties;