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.Linq; | |
using Xunit; | |
namespace Example.Tests | |
{ | |
public static class TestExtensions | |
{ | |
public static string ToCrAzYcAsE(this string input) | |
=> input |
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.IO; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
namespace Demo.Web.Controllers | |
{ | |
public class UploadController : Controller | |
{ |
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 Newtonsoft.Json; | |
namespace eouw0o83hf.Gist.Change | |
{ | |
/// <summary> | |
/// A lightweight wrapper which tracks a change to a property | |
/// and serializes to one json property for ease of reading in | |
/// an event stream. | |
/// </summary> |
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
function listAllFields(target) { | |
var allFields = Object | |
.entries(targetObject) | |
.map(a => `${a[0]}: ${typeof(a[1])}`) | |
.join(', '); | |
console.log(allFields); | |
} |
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
async void Main() | |
{ | |
var serialData = await ConvertSerially(); | |
var parallelData = await ConvertParallelly(); | |
} | |
async Task<ICollection<string>> ConvertSerially() | |
{ | |
var convertedList = new List<string>(); | |
var stopwatch = Stopwatch.StartNew(); |
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 Guid LazyG(char a) | |
{ | |
var sb = new StringBuilder(); | |
for (var i = 0; i < 32; i++) | |
{ | |
sb.Append(a); | |
} | |
return new Guid(sb.ToString()); | |
} |
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
<html> | |
<head> | |
<title> | |
PRs | |
</title> | |
<style> | |
html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margi |
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 Extensions | |
{ | |
/// <summary> | |
/// Grants the ability to peek into an IEnumerable and determine if some | |
/// (n > 0) items are in the collection *without multiply-enumerating it* | |
/// </summary> | |
public static ISomeEnumerable<T> GetSome<T>(this IEnumerable<T> source) | |
{ | |
return new RepeatableEnumerableWrapper<T>(source); | |
} |
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
// Gets called when jQuery is all loaded and ready to go. | |
// Use jq instead of $ here. For instance, | |
// jq("div") or jq.get("targeturl"); | |
function runWith(jq) { | |
// Do cool stuff here | |
} | |
// Get jquery, copied this from here http://blog.reybango.com/2010/09/02/how-to-easily-inject-jquery-into-any-web-page/ | |
// with some minor modifications to do a callback whenever jQuery is either detected as having already | |
// been loaded or is done loading. |
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 Throttle | |
{ | |
private Task _control; | |
private readonly int _minimumMillis; | |
public Throttle(int millis) | |
{ | |
_minimumMillis = millis; | |
} |
NewerOlder