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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeApplications #-} | |
module InstantNeighbour.VanMan.Servant | |
( makeHandler | |
) where | |
import Protolude |
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
// Transforms an object containing arbitrary keys, and promise values, into a | |
// promise-wrapped object, with the same keys and the result of resolving each | |
// promise as values. | |
const promiseAllObject = (obj) => { | |
const keys = Object.keys(obj); | |
const values = keys.map((k) => obj[k]); | |
return Promise.all(values).then((promises) => | |
promises.reduce((all, promise, idx) => ({ ...all, [keys[idx]]: 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
/* | |
PluginDetect Javascript Library http://www.pinlady.net/PluginDetect/ | |
Copyright (C) 2008-2016, Eric Gerds | |
Released under MIT license http://www.pinlady.net/PluginDetect/license/ | |
Browser Plugin Detection for QuickTime/Java/DevalVR/Flash/Shockwave/WindowsMediaPlayer/ |
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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ViewPatterns #-} | |
module TrustPilotChallenge where | |
import Control.Monad | |
import Data.ByteString.Char8 (ByteString) | |
import qualified Data.ByteString.Char8 as B | |
import qualified Data.ByteString.Lazy.Char8 as BL | |
import Data.Digest.Pure.MD5 | |
import Data.Function (on) |