Skip to content

Instantly share code, notes, and snippets.

View alistair's full-sized avatar

Alistair Bush alistair

  • Auckland, New Zealand
View GitHub Profile
{"Type":"request", "Seq": 11, "Command":"/v2/debugtestsinclass/getstartinfo", "Arguments": { "FileName":"/home/alistair/projects/TestProject/UnitTest1.cs", "MethodNames": ["TestProject.UnitTest1.Test1"], "TestFrameworkName": "xunit", "TargetFrameworkVersion": ".NETCoreApp, Version=2.0" }}
{"Type":"request", "Seq": 11, "Command":"/currentfilemembersastree", "Arguments": { "FileName":"/home/alistair/projects/TestProject/UnitTest1.cs"}}
{"Type":"request", "Seq": 11, "Command":"/v2/debugtestsinclass/getstartinfo", "Arguments": { "FileName":"/home/alistair/projects/TestProject/UnitTest1.cs", "MethodNames": ["TestProject.UnitTest.Test1"], "TestFrameworkName": "xunit", "TargetFrameworkVersion": ".NETCoreApp, Version=2.0" }}
/usr/share/dotnet/dotnet exec --runtimeconfig "/home/alistair/projects/TestProject/bin/Debug/netcoreapp2.1/TestProject.runtimeconfig.json" --depsfile "/home/alistair/projects/TestProject/bin/Debug/netcoreapp2.1/TestProject.deps.json" "/home/alistair/.nuget/packages/microsoft.testplatform.test
@alistair
alistair / yield.js
Last active October 15, 2016 04:17
Composable computation descriptions.
/*
* This is a demonstration of a common programming patterns and how the
* flow control abilities of async/await ( or yield in javascript )
* support turning nested code into, beautiful functional code.
*
* What I am demonstrating here is not simple and using javascript to
* explain this has some pros but also cons.
* So please if you fail to understand don't be discouraged.
* That is a failing on my part not yours.
*
@alistair
alistair / keybase.md
Created February 6, 2016 01:54
keybase.md

Keybase proof

I hereby claim:

  • I am alistair on github.
  • I am alistair_nz (https://keybase.io/alistair_nz) on keybase.
  • I have a public key whose fingerprint is BDEE 72A5 CF84 4C25 FB2A F9C3 B2E2 9462 7554 2EFD

To claim this, I am signing this object:

public abstract class StartupBase
{
public virtual void ConfigureService(IServiceCollection services)
{
// Standard registrations
ConfigureEntityFramework(services);
}
public abstract void ConfigureEntityFramework(IServiceCollection services);
namespace blackdunes.chronicles
{
public class Startup
{
private readonly IHostingEnvironment env;
public Startup(IHostingEnvironment env)
{
// Set up configuration sources.
var builder = new ConfigurationBuilder()
POST /addtoproject HTTP/1.1
Accept-Encoding: identity
Content-Length: 1798
Host: localhost:2000
Content-Type: application/json
Connection: close
User-Agent: Python-urllib/2.7
{"column": "33", "buffer": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.AspNet.Builder;\r\nusing Microsoft.AspNet.Hosting;\r\nusing Microsoft.Extensions.Configuration;\r\nusing Microsoft.Ext
ensions.DependencyInjection;\r\nusing Microsoft.Extensions.Logging;\r\n\r\nnamespace account\r\n{\r\n public class Startup\r\n {\r\n public Startup(IHostingEnvironment env)\r\n {\r\n // Set up configuration sources.\r\n var build
C:\Users\Alistair\Documents\Visual Studio 2015\Projects\TestPaket>.paket\paket.exe add nuget automapper
Paket version 2.16.0.0
Adding automapper to C:\Users\Alistair\Documents\Visual Studio 2015\Projects\TestPaket\paket.dependencies into group Main
Resolving packages for group Main:
- automapper 4.0.4
- System.Runtime 4.0.20
- System.Collections 4.0.10
- System.Collections.Concurrent 4.0.10
- System.Diagnostics.Tracing 4.0.20
- System.Diagnostics.Debug 4.0.10
@alistair
alistair / install.bat
Last active October 14, 2015 22:48
paket add nuget automapper
Projects\TestPaket>.paket\paket.exe add nuget automapper project TestPaket
Paket version 2.12.8.0
Adding automapper to c:\Users\Alistair\Documents\Visual Studio 2015\Projects\TestPaket\paket.dependencies into group Main
Resolving packages for group Main:
- automapper 4.0.4
- System.Runtime 4.0.20
- System.Collections 4.0.10
- System.Collections.Concurrent 4.0.10
- System.Diagnostics.Tracing 4.0.20
- System.Diagnostics.Debug 4.0.10
@alistair
alistair / test.hs
Last active November 24, 2015 16:55
Haskell notes
== equals
/= not equals
'a' : ['b', 'c'] -- prepend e.g. 1:2:3:[]
['a'] ++ ['b', 'c'] --append
[x*2 | x <- [1..10], x*2 >= 12] -- list comprehension
let rightTriangles = [ (a,b,c) | c <- [1..10], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2]
if x > 100
then x
@alistair
alistair / MainAdminShell.js
Created June 4, 2015 21:37
portlets in SPAs
// Admin App Host application
require('something') // we need to force load all modules, could this be by convention?
var Registration = require('register');
var links = Registration.get();
for(var i in links)
{
print("<a href='+i.url+' >' + i.title +'</a>
}