Skip to content

Instantly share code, notes, and snippets.

View micahasmith's full-sized avatar

Micah Smith micahasmith

View GitHub Profile
@micahasmith
micahasmith / process-async-await.cs
Created March 4, 2013 19:51
.NET Process via Async/Await
public class Runner
{
public async Task<RunResults> Run(ProcessStartInfo info)
{
var process = new Process();
var runResults = new RunResults();
//some defaults that HAVE to be in place
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
@micahasmith
micahasmith / img-layer-example.json
Created April 10, 2013 18:31
image layer example
{
"name":"image",
"settings":{
"uri":"http://localhost:8888/out.jpg"
"index":0
},
"commands":[
{ "name":"resize", "args":{"width":100,"height":300} },
{ "name":"combine", "args":{"map":""} }
]
let greetings = ["hi";"hello";]
let names = ["john";"micah";]
// trying to end up with ["hi john";"hi micah";"hello john"; "hello micah;"]
// cant use zip-- real life items arent same size
greetings
|> List.fold (fun(accum,greet) -> names |> List.map (fun (name)-> greet +" "+ name) |> List.append accum ) List.empty<string>;;