Skip to content

Instantly share code, notes, and snippets.

@JamesTryand
JamesTryand / Program.cs
Created February 24, 2015 11:22
Simple Pipelines in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication13
{
class Program
function merge(target, source) {
/* Merges two (or more) objects,
giving the last one precedence */
if ( typeof target !== 'object' ) {
target = {};
}
for (var property in source) {
<div ng-app="videoApp" ng-controller="VideoController">
<table>
<thead>
<th>Title</th>
<th>Length</th>
<th></th>
</thead>
<tbody>
<tr data-id="{{video.Id}}" ng-repeat="video in videos">
//Allowing CORS (Cross-Origin Resource Sharing) requests from
// grunt server, put this into Gruntfile.js
grunt.initConfig({
connect: {
livereload: {
options: {
port: 9000,
hostname: 'localhost',
middleware: function (connect) {
return [
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
/**
* Koa middleware for Swagger Framework.
*/
'use strict';
/**
* Initialize a new `Koa`.
*
* @param {Framework} framework
@JamesTryand
JamesTryand / First Steps.md
Created May 11, 2014 09:59
Neurology Primer

Okay - here's a quick potted neurolgy primer. If there's any inacurracies - let me know and i'll update it. It's likely you may know a lot/most/all of this stuff, in which case simply skip ahead, this isn't intended to patronise, but rather provide a primer for a layperson with no knowledge.

Brains of different animals have shared structures; the more 'advanced' an animal the more structures it will share with humans. Dolphin & Whale brains are significantly physically larger than our own.

Two parts are in essence 'grey matter' and 'white matter'. This is because the main cells we think of as 'brain cells' Neurons ( also spelled neurones ) have a body and a long tail. Incoming signals to a single neuron will accumulate and once they reach a certain threshold, they will discharge an electrical signal down the tail, which when reached will release whatever transmitter chemical it has. The neurotransmitter chemical is used to bridge the gaps between neurons when sending messages. ( the release of transmitt

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
namespace EventStoreService
{
public class EventStoreService
{
// http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
// original by Nick Palladinos: http://fssnip.net/ip
#r "FSharp.PowerPack.Parallel.Seq.dll"
module Reducer =
open System
open System.Text
open System.Collections.Generic
open System.Linq