Skip to content

Instantly share code, notes, and snippets.

View jaredpar's full-sized avatar

Jared Parsons jaredpar

View GitHub Profile
package com.koushikdutta.async;
import java.io.IOException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.Set;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
/**
function f1() { return @("hello"); }
function f2() { return @("hello", "world"); }
$a = f1;
write-host $a.Length # prints 5
$a = f2;
write-host $a.Length # prints 2
@jaredpar
jaredpar / keybase.md
Created April 29, 2014 04:21
keybase.md

Keybase proof

I hereby claim:

  • I am jaredpar on github.
  • I am jaredpar (https://keybase.io/jaredpar) on keybase.
  • I have a public key whose fingerprint is 45AE AD6B 43A8 170C FF01 A26F 95C7 749A D1E7 9177

To claim this, I am signing this object:

class Other
{
internal static Other Instance
{
get { return null; }
}
internal int Compare(A left, A right) { return 0; }
static internal int Compare(B left, B right) { return 0; }
}
static void Main(string[] args)
{
A a = default(A);
D d = new D();
d.Foo(a); // Prints D.Foo
}
struct A { }
struct B
{
def main():
#Declare
price = 99
quantity = float(input("How many packages have you purchased?"))
if quantity >= 10:
print ("Your discount is 20%.")
set nobackup
set nocp
set tabstop=4
set shiftwidth=4
set et
set ignorecase
set hlsearch
set ai
set ruler
private static string s_root = @"e:\dd\ros\Closed";
private static Encoding s_encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
static void Main(string[] args)
{
FixPackagesConfig();
FixProjects();
}
static void FixPackagesConfig()
@jaredpar
jaredpar / gist:a9b27a4d3a7c8c89afa7
Created May 22, 2015 18:01
Roslyn Alt Repro Issue 2908
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
namespace RoslynCCPhantoms
{
static class Contract
@jaredpar
jaredpar / gist:c2125da173e488826b9b
Created July 1, 2015 17:28
Fuzzy interface hookup
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.30319
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..