Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tcoopman
tcoopman / SketchSystems.spec
Last active July 1, 2020 19:24
Pump Control
Pump Control
Pump off*
time after 1400 -> Pump on
Pump on
time after 1900 -> Pump off
start control loop -> Control loop
Control loop*
roof temperature higher -> Valve opened
@tcoopman
tcoopman / SketchSystems.spec
Last active July 1, 2020 18:50
Vending Machine
Vending Machine
OrderProcessStarted
WaitingForMoney*
insert coin -> validating coin
select product -> validating selection
request return coins -> returning coins
validating coin
valid -> WaitingForMoney
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SolverTest;
namespace SolverTest
{
public class Program
[{"type":"PlayerHasRegistered","timestamp":"2016-04-11T02:28:30Z","payload":{"player_id":"c70a3a61-1245-4f42-bda1-72ddd268ca49","last_name":"O'Conner","first_name":"Edyth"},"id":"6636f191-982f-4e12-8e19-5b5880d4097a"},{"type":"QuizWasCreated","timestamp":"2016-04-11T02:37:45Z","payload":{"quiz_title":"Superhero quiz","quiz_id":"a97a3f2d-4025-410b-8aef-c177df1841ba","owner_id":"c70a3a61-1245-4f42-bda1-72ddd268ca49"},"id":"19edaa42-7ea5-472a-9da1-4f2f21c314be"},{"type":"QuestionAddedToQuiz","timestamp":"2016-04-11T02:39:56Z","payload":{"quiz_id":"a97a3f2d-4025-410b-8aef-c177df1841ba","question_id":"f84c5b89-dc65-441c-8f74-54b1ff600111","question":"What power does Supah Granny Goodness Eyes have?","answer":"Mind Control"},"id":"7e8e47c3-21dc-43b5-bce5-dc02c44bc0b4"},{"type":"QuestionAddedToQuiz","timestamp":"2016-04-11T02:40:07Z","payload":{"quiz_id":"a97a3f2d-4025-410b-8aef-c177df1841ba","question_id":"397122e9-d00f-4f65-9b8d-c38de6b804d8","question":"Who has Stamina?","answer":"Mr Gravity Lord"},"id":"9be1453c
import Graphics.Element exposing (show)
import String
type Assertion =
AssertT | AssertF
assertEqual : a -> a -> Assertion
assertEqual a b =
if | (toString a) == (toString b) -> AssertT
| otherwise -> AssertF
@tcoopman
tcoopman / gulpfile.js
Created March 20, 2015 22:18
Gulp, webpack and mocha tester
var gulp = require('gulp');
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var DeepMerge = require('deep-merge');
var Mocha = require('mocha');
var deepmerge = DeepMerge(function(target, source) {
if(target instanceof Array) {
CmdUtils.makeSearchCommand({
name: "gdefine",
author: { name: "Thomas Coopman" },
license: "GPL",
url: "http://www.google.com/search?q=define:{QUERY}",
icon: "http://www.google.com/favicon.ico",
description: "Searches Google Define for your words.",
preview: function(pblock, directObject) {
msg = 'Searches Google define for "<i>${query}</i>"';
pblock.innerHTML = CmdUtils.renderTemplate(msg, {query: directObject.text});