Skip to content

Instantly share code, notes, and snippets.

View beckyconning's full-sized avatar

Becky Conning beckyconning

View GitHub Profile
newtype AtLeastTwoAndUnique a = AtLeastTwoAndUnique (Array a)
toArray :: forall a. AtLeastTwoAndUnique a -> Array a
toArray (AtLeastTwoAndUnique xs) = xs
first :: forall a. AtLeastTwoAndUnique a -> a
first = Unsafe.head
instance arbAtLeastTwoAndUnique :: (Arbitrary a) => Arbitrary (AtLeastTwoAndUnique a) where
arbitrary = AtLeastTwoAndUnique <$> arbitrary `suchThat` (\xs -> unique xs && atLeastTwo xs)
module Test.AtLeastTwoAndUnique (runAtLeastTwoAndUnique) where
import Prelude
import Data.Array (nub)
import Test.StrongCheck (Arbitrary, arbitrary)
import Test.StrongCheck.Gen (suchThat)
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested (uncurry3)
## Hotel room
# Look
A dark room with plenty of room for the large double bed. The blue light of a video monitor bleeds across the room and gleams from a lamp beside you. A pretty blue and white dotted dress, a smart grey, subtly pinstriped suit and a pressed white shirt hang from hangers in the fixed open wardrobe. In the trouser press is a pair of matching suit trousers. A mechanical wheelchair sits near the doors. There are two doors, one to the west and one to the north.
## Video monitor
# Use
/------------------------------\
| The Metropole Hotel |
| |
| The time is: |
if (!me.stepping) {
if (me.canMove('right')) {
me.move('right');
}
else if (me.canMove('down')) {
me.move('down')
}
else if (me.canMove('left')) {
me.stepping = true;
// so this is a basic deferred
var Promise = function() {
this.successCallbacks = [];
this.failCallbacks = [];
};
Promise.prototype.then = function(successCallback, failCallback) {
if (successCallback) this.successCallbacks.push(successCallback);
if (failCallback) this.failCallbacks.push(failCallback);
// assume only change can be a new document
// also assume ids are sequential
var maxRetriesForNewMilkingRecordsCheck = 1;
var retriesForNewMilkingRecords = 0;
var databaseUrl = 'http://127.0.0.1:8091/milking_records';
// go get the milking records
var viewSuffix = '/_all_docs?update_seq=true';
var viewUrl = databaseUrl + viewSuffix;
var check = function() {
var numberOfSelectedElements = world.angular().element(selector).length;
if(checkFunction(numberOfSelectedElements)) {
callback();
}
else {
numberOfChecks = numberOfChecks + 1;
if(numberOfChecks <= maxNumberOfChecks) {
setTimeout(function() {
check();
beforeEach(function() {
accountsService = {
signUp: function() {
deferred = q.defer();
return deferred.promise;
}
};
});
Feature: Create presentations
As a presenter
I want to create a new presentation
So that I can present a new concept
Scenario: Create a new blank presentation
Given I am signed in
When I create a new presentation
Then the list of my presentations should contain my new presentation
#!/usr/bin/env node
var requestPromise = require('request-promise');
var couchUrl = process.argv[2];
var configureCouch = function(couchUrl, requestPromise) {
var couchConfigUrl = couchUrl + '/_config';
var couchConfig = {
httpd: {