This file contains hidden or 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
FROM nornagon/postgres | |
MAINTAINER [email protected] | |
ADD sql sql | |
ADD create_db.sh /src/ | |
USER postgres | |
RUN /src/create_db.sh |
This file contains hidden or 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
/// <summary> | |
/// Send a message directly to a queue | |
/// </summary> | |
/// <typeparam name="T">The type of message to send</typeparam> | |
/// <param name="queue">The queue to send to</param> | |
/// <param name="message">The message</param> | |
void Send<T>(string queue, T message); | |
/// <summary> | |
/// Receive messages from a queue. |
This file contains hidden or 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
Newton's law of universal gravitation: | |
http://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation | |
F = G(m1 * m2)/r^2 | |
Mass of the Earth: 5.97219 × 10^24 kg | |
Mass of the Moon: 7.3477 × 10^22 kg | |
Distance to the Moon (average): 384,400 km |
This file contains hidden or 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.Threading; | |
using System.Threading.Tasks; | |
namespace Mike.Spikes.Threading | |
{ | |
public class ManyWaysToStartAThread | |
{ | |
public void WithThread() | |
{ |
This file contains hidden or 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
// ReSharper disable InconsistentNaming | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using EasyNetQ.ConnectionString; | |
using EasyNetQ.Loggers; | |
using EasyNetQ.Producer; |
This file contains hidden or 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
[<Test>] | |
[<Explicit>] | |
let ``get hostname`` () = | |
ssh (print <!> hostname) | |
[<Test>] | |
[<Explicit>] | |
let ``should be able to put a file on the nginx server`` () = | |
scp (putFile testFileName content) | |
ssh (reader { |
This file contains hidden or 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
// from the QTRecorder sample application in the MonoMac source | |
// In QTRDocument contructor .... | |
// ---- Add image capture output | |
var decompressedVideoOuput = new QTCaptureDecompressedVideoOutput(); | |
NSError error2; | |
decompressedVideoOuput.DidOutputVideoFrame += (sender, e) => | |
{ | |
// var frame = e.SampleBuffer; |
This file contains hidden or 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
import List | |
import Control.Applicative | |
euler1 = sum $ nub $ [3,6..999] ++ [5,10..999] | |
fib = let fib' a b = a : fib' b (a+b) in fib' 0 1 | |
euler2 = sum . (filter even) . takeWhile (<4000000) $ fib | |
factor n = [x|x <- [2..(floor(sqrt(fromInteger n)))], n `mod` x == 0] |
This file contains hidden or 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.Linq; | |
using Castle.Windsor; | |
namespace Suteki.Common.Windsor | |
{ | |
public static class WindsorExtensions | |
{ | |
public static void CheckRegistration<TService, TImplementation>(this IWindsorContainer container) | |
{ | |
var handlers = container.Kernel.GetHandlers(typeof(TService)); |
This file contains hidden or 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; | |
namespace Suteki.Common.Windsor | |
{ | |
public class IoC | |
{ | |
private static Func<Type, object> resolve; | |
private static Action<object> release; | |
public static T Resolve<T>() |