This file contains 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
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) |
This file contains 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
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) |
This file contains 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
## 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: | |
This file contains 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
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; |
This file contains 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
// 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); |
This file contains 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
// 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; |
This file contains 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
var check = function() { | |
var numberOfSelectedElements = world.angular().element(selector).length; | |
if(checkFunction(numberOfSelectedElements)) { | |
callback(); | |
} | |
else { | |
numberOfChecks = numberOfChecks + 1; | |
if(numberOfChecks <= maxNumberOfChecks) { | |
setTimeout(function() { | |
check(); |
This file contains 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
beforeEach(function() { | |
accountsService = { | |
signUp: function() { | |
deferred = q.defer(); | |
return deferred.promise; | |
} | |
}; | |
}); |
This file contains 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
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 |
This file contains 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
#!/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: { |
OlderNewer