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
<?xml version="1.0" encoding="ASCII"?> | |
<Exif> | |
<APP1> | |
<Exif_IFD> | |
<DateTimeOriginal>2014:01:29 09:51:37</DateTimeOriginal> | |
</Exif_IFD> | |
<GPS_IFD> | |
<GPSLatitudeRef>N</GPSLatitudeRef> | |
<GPSLatitude>00:00:00</GPSLatitude> | |
<GPSLongitudeRef>E</GPSLongitudeRef> |
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
[SecurityCritical] | |
private static byte[] InternalReadAllBytes(string path, bool checkHost) | |
{ | |
byte[] buffer; | |
using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 0x1000, FileOptions.None, Path.GetFileName(path), false, false, checkHost)) | |
{ | |
int offset = 0; | |
long length = stream.Length; | |
if (length > 0x7fffffffL) | |
{ |
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
fsutil file createnew <filename> <length> |
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
<rewrite> | |
<rules> | |
<rule name="HTTPS to HTTP redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="^ON$" ignoreCase="true" /> | |
</conditions> | |
<action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}/{R:1}" /> | |
</rule> | |
</rules> |
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
From 1 to 100 | |
Entry | |
---------- | |
if num divisible by 3, Fizz | |
if num divisible by 5, Buzz | |
if num divisible by 3&5, FizzBuzz | |
Mid | |
---------- |
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
Javier is principal for lozanotek, a .NET focused software development boutique based in Des Moines, IA. His specializations are in ASP.NET, Azure, system design, and developer mentoring. Javier is also an ASP.NET Insider, Azure Insider, and ASP.NET MVP for all of his contributions to products and community. For fun, Javier runs and manages the popular dotnetConf and aspConf virtual conferences. He’s is an avid supporter of the community and likes to give back by speaking at user groups, local/regional/national .NET events. In his spare time, Javier loves spending time with his family and enjoys writing about himself in the third person. |
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 Computer { | |
[DllImport("user32.dll")] | |
public static extern void LockWorkStation(); | |
} |
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 Display { | |
private const uint WmSyscommand = 0x0112; | |
private const int ScMonitorpower = 0xF170; | |
private const int HwndBroadcast = 0xFFFF; | |
private const int ShutOffDisplay = 2; | |
[DllImport("user32.dll", SetLastError = true)] | |
private static extern bool PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); | |
public static void TurnOff() { |
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
//Source from this great article on Pipe & Filter | |
// Article - https://www.simple-talk.com/dotnet/.net-framework/giving-clarity-to-linq-queries-by-extending-expressions/ | |
// NuGet Pkg - https://www.nuget.org/packages/PredicateExtensions/ | |
public static class PredicateExtensions | |
{ | |
/// <summary> | |
/// Begin an expression chain | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="value">Default return value if the chanin is ended early</param> |
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 IEnumerable<IEnumerable<T>> Chunk<T>(this IEnumerable<T> source, int chunksize) | |
{ | |
while (source.Any()) | |
{ | |
yield return source.Take(chunksize); | |
source = source.Skip(chunksize); | |
} | |
} |
OlderNewer