View DynamicHubSketch.cs
// Treat Client Proxies kinda like Formatters; Hub<T> just tries to get an IClientProxyFactory<T> from DI and invokes it.
// We provide one for `dynamic` and another that can be registered as an open-generic and generated code at runtime.
// Users can provide custom implementations for anything.
public interface IClientProxy {
Task InvokeAsync(string method, params object[] args);
}
public interface IClientProxyFactory<T> {
T CreateProxy(IClientProxy proxy); // <-- may need some caching logic
View ReadAtLeastAsync.cs
using System.Threading;
using System.Threading.Tasks;
using Channels;
namespace Microsoft.Extensions.WebSockets.Internal
{
public static class ChannelExtensions
{
public static ValueTask<ReadableBuffer> ReadAtLeastAsync(this IReadableChannel input, int minimumRequiredBytes) => ReadAtLeastAsync(input, minimumRequiredBytes, CancellationToken.None);
View .gitignore
node_modules/
View WebsocketDecoder.ts
document.writeln('<input style="width: 600px" id="hexcode" type="text" placeholder="hex values" />');
document.writeln('<button onclick="decode()">Decode</button>');
document.writeln('<div id="result" />');
var opcodes = [
'Continuation',
'Text',
'Binary',
'RESERVED',
'RESERVED',
View vimrc
" Update MYVIMRC
let $MYVIMRC="~/.dotfiles/vim.symlink/vimrc"
let $MYCOLORS="~/.dotfiles/vim.symlink/colorscheme.vim"
set ff=unix
" Make windows accept unixy stuff
if has('win32') || has('win64')
set runtimepath=~/.vim,$VIM/vimfiles,$VIM,$VIM/vimfiles/after,~/.vim/after
set dir=$TEMP
View nuget3-and-msbuild.md

MSBuild Targets and Props in NuGet 3

NuGet 2.x supports the inclusion of .targets and .props files in NuGet packages. These files will be added as Imports in the csproj MSBuild file when the package is installed. For example, consider a package with the following files:

/
    build/
        net40/
            MyPackage.props
            MyPackage.targets
View GetActiveDNX.ps1
# If 'dnvm' is present, this code writes " ([activednx])" to the host, where [activednx] is the
# active DNX name. If 'dnvm' is not present, this writes nothing.
# If we have dnvm, use it to determine the active DNX
if(Get-Command dnvm -ErrorAction SilentlyContinue) {
$activeDnx = dnvm list -passthru | where { $_.Active }
if($activeDnx) {
Write-Host " (" -nonewline -ForegroundColor ([ConsoleColor]::Yellow)
Write-Host "dnx-$($activeDnx.Runtime)-win-$($activeDnx.Architecture).$($activeDnx.Version)" -nonewline -ForegroundColor ([ConsoleColor]::Cyan)
Write-Host ")" -nonewline -ForegroundColor ([ConsoleColor]::Yellow)
View drill
VIM Drill
=========
NEVER USE Arrows or Esc!
1. Type the following:
public class Foo {
public string Property { get; set; }
public int Property { get; set; }
View atom-shell.d.ts
/// <references src="node.d.ts" />
declare module "app" {
var app: AtomShell.App;
export = app;
}
declare module "browser-window" {
class _BrowserWindow extends AtomShell.BrowserWindow { }
View keybase.md

Keybase proof

I hereby claim:

  • I am anurse on github.
  • I am anurse (https://keybase.io/anurse) on keybase.
  • I have a public key whose fingerprint is 54D5 8341 7CFE 423E 5A54 D52B 4388 456B 1C13 750E

To claim this, I am signing this object: