https://bl.ocks.org/guneysus/c5bc5456da5a1e3e274c4ea24a7bd533
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
######## POSH-GIT | |
# ... Import-Module for posh-git here ... | |
# Background colors | |
$GitPromptSettings.AfterStash.BackgroundColor = 0x3465A4 | |
$GitPromptSettings.AfterStatus.BackgroundColor = 0x3465A4 | |
$GitPromptSettings.BeforeIndex.BackgroundColor = 0x3465A4 | |
$GitPromptSettings.BeforeStash.BackgroundColor = 0x3465A4 |
This document describes the APIs of Memory<T>
, IMemoryOwner<T>
, and MemoryManager<T>
and their relationships to each other.
See also the Memory<T>
usage guidelines document for background information.
Memory<T>
is the basic type that represents a contiguous buffer. This type is a struct, which means that developers cannot subclass it and override the implementation. The basic implementation of the type is aware of contigious memory buffers backed byT[]
andSystem.String
(in the case ofReadOnlyMemory<char>
).
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
USE master | |
go | |
SELECT sdes.database_id | |
,sdes.[host_name] | |
,sdes.[program_name] | |
,sdes.login_name | |
,sdes.login_time | |
,sdec.client_net_address | |
,sdec.local_net_address | |
,sdest.Query |
This gist outlines the change in the depth and breadth of the tasks and responsibilities of a software engineer as she continuously improves herself.
I created this to supplement a discussion in an internal slack group; then I though the rest of the world might benefit from this too.
Contributions are always welcome.
- Knowledge
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; | |
using System.Runtime.InteropServices; | |
public class FxHook:IDisposable { | |
const int nBytes = 5; | |
IntPtr addr; | |
Protection old; | |
byte[] src = new byte[5]; |
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
static async Task<T> Otherwise<T> (this Task<T> task, Func<Task<T>> orTask) { | |
task.ContinueWith (async innerTask => { | |
if (innerTask.Status == TaskStatus.Faulted) | |
return await orTask (); | |
return await Task.FromResult<T> (innerTask.Result); | |
}).Unwrap (); | |
} | |
static async Task<T> Retry<T> (Func<Task<T>> task, int retries, TimeSpan delay, CancellationToken cts = default (CancellationToken)) { |
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
struct Result<T> { | |
public T Ok { get; } | |
public Exception Error { get; } | |
public bool IsFailed { get => Error != null; } | |
public bool IsOk => !IsFailed; | |
public Result (T ok) { | |
Ok = ok; | |
Error = default (Exception); | |
} |
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 FastInvokeHandler GetMethodInvoker(MethodInfo methodInfo) | |
{ | |
DynamicMethod dynamicMethod = new DynamicMethod(string.Empty, | |
typeof(object), new Type[] { typeof(object), | |
typeof(object[]) }, | |
methodInfo.DeclaringType.Module); | |
ILGenerator il = dynamicMethod.GetILGenerator(); | |
ParameterInfo[] ps = methodInfo.GetParameters(); | |
Type[] paramTypes = new Type[ps.Length]; | |
for (int i = 0; i < paramTypes.Length; i++) |