This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| aa = add . | |
| s = status | |
| lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -10 | |
| co = checkout | |
| cob = checkout -b | |
| ec = config --global -e | |
| up = !git pull --rebase --prune $@ && git submodule update --init --recursive | |
| save = !git add -A && git commit -m 'SAVEPOINT' | |
| undo = reset HEAD~1 --mixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public bool IndexExists(string index) | |
| { | |
| try | |
| { | |
| Connection.Head(new IndexExistsCommand(index)); | |
| return true; | |
| } | |
| catch (OperationException ex) | |
| { | |
| if (ex.HttpStatusCode == 404) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Text.RegularExpressions; | |
| namespace Spin.TradingServices.Common.Library.Extensions | |
| { | |
| public static class StringExtensions | |
| { | |
| private const string CamelToSpacedRegexString = | |
| @"(?<=[A-Z])(?=[A-Z][a-z])|(?<=[^A-Z])(?=[A-Z])|(?<=[A-Za-z])(?=[^A-Za-z])"; | |
| private static readonly Regex CamelToSpacedRegex = new Regex(CamelToSpacedRegexString, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Disable these services: | |
| Windows Installer | |
| Windows Update | |
| Windows Modules Installer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static HttpResponseMessage DownloadResponse(string content, string fileName) | |
| { | |
| var downloadContent = new StringContent(content); | |
| var mediaType = new MediaTypeHeaderValue("application/octet-stream"); | |
| var dispostition = new ContentDispositionHeaderValue("attachment") { FileName = fileName }; | |
| downloadContent.Headers.ContentType = mediaType; | |
| downloadContent.Headers.ContentDisposition = dispostition; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| using System.Web.Http; | |
| namespace Web.Controllers | |
| { | |
| //usage: /download/report | |
| [RoutePrefix("download")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Template including controller and service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %windir%\Microsoft.NET\Framework\%version%\aspnet_regiis.exe -i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Hello | |
| { | |
| public static void Main(string[] args) | |
| { | |
| if (args.Length > 0) | |
| { | |
| System.Console.WriteLine("Hello, " + args[0] + "!"); | |
| } | |
| else | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string MinifyJson(string unminifiedJson) | |
| { | |
| return Regex.Replace(unminifiedJson, "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1"); | |
| } |