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
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>;; |
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
{ | |
"name":"image", | |
"settings":{ | |
"uri":"http://localhost:8888/out.jpg" | |
"index":0 | |
}, | |
"commands":[ | |
{ "name":"resize", "args":{"width":100,"height":300} }, | |
{ "name":"combine", "args":{"map":""} } | |
] |
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 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; |
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
@{ | |
object copy = new | |
{ | |
year = Model.Element("CopyrightDate").Content.Value, | |
school = Model.Element("SchoolName").Content.Value, | |
address = Model.Element("SchoolAddress").Content.Value, | |
city = Model.Element("SchoolCity").Content.Value, | |
state = Model.Element("SchoolState").Content.Value, | |
phone1 = Model.Element("SchoolPhonePrimary").Content.Value, | |
phone2 = Model.Element("SchoolPhoneSecondary").Content.Value |
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
/* WagStack | |
* | |
* TPL Async DAL using ServiceStack's Expression/SQL Building | |
* and Insight.Database's async features | |
*/ | |
public class WagStackAsyncRepository<T>:IAsyncRepository<T> | |
{ | |
static WagStackAsyncRepository() |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
var log = grunt.log; | |
//grunt.loadTasks('grunt/tasks'); | |
function handleResult(from, dest, err, stdout, code, done) { | |
if(err){ | |
grunt.helper('growl', 'ERROR', stdout); | |
log.writeln(from + ': failed to compile to ' + dest + '.'); | |
log.writeln(stdout); |
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
/** | |
* Here's the idea: | |
* Lets see what we can do if we don't do function(err,cb) all the time | |
* and instead we do function(objlit) | |
* | |
* Any advantages to instead wrapping it in one variable? | |
*/ | |
// an example of what this may look like |
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
# the main example from nodejs.org | |
http = require 'http' | |
http.createServer (req,res)-> | |
res.writeHead 200, \Content-Type : \text/plain | |
res.end 'Hello World\n' | |
.listen 1337 \127.0.0.1 | |
console.log 'server running' |
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
# here i'm telling the server to rewrite all requests | |
# for that contain a html extension-- remove the html | |
rewrite (.*)\.html $1 permanent; | |
# here i'm telling the server to try finding the file by appending | |
# the .html on to it | |
# important since the files all have extensions | |
try_files $uri.html $uri/ /index.html; |
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 nonasync_webrequest_test : IHttpHandler { | |
public void ProcessRequest (HttpContext context) { | |
var r = new RequestState() | |
{ | |
Wr = WebRequest.Create("http://www.google.com"), | |
Cxt = context | |
}; | |
r.Wr.Method = "GET"; | |
var s= r.Wr.GetResponse(); |
NewerOlder