This file contains 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 class DateTimeExtensions | |
{ | |
private static readonly TimeZoneInfo TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"); | |
public static DateTime ConvertLocalBritishTimeToUtc(this DateTime dateTime) | |
{ | |
var isSummer = TimeZoneInfo.IsDaylightSavingTime(dateTime); | |
if (isSummer) | |
{ |
This file contains 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
mongodump | |
net stop MongoDB | |
rmdir C:\data\db /S /Q | |
mkdir C:\data\db | |
net start MongoDB | |
mongorestore | |
rmdir dump /S /Q |
This file contains 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"); | |
} |
This file contains 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 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 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 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 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 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 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, |
OlderNewer