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
// map with selectMany | |
function map(func) { | |
return this::selectMany(x => [func(x)]); | |
} |
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
function selectMany(func) { | |
return this.reduce( | |
(acc, val) => [ | |
...acc, | |
...func(val), | |
], | |
[], | |
); | |
} |
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
it('observes a tree', marbles((m) => { | |
const a = { | |
children: [ | |
{ | |
children: [ | |
{ | |
name: 'esau', | |
}, | |
{ | |
name: 'jacob', |
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
import merge from 'lodash/merge'; | |
/* eslint-env mocha */ | |
describe('new test', () => { | |
it('works', () => { | |
const getIt = (x = {}) => { | |
const { | |
a = null, | |
b: { |
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
FROM debian:stretch | |
ENV LC_ALL en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
RUN apt-get update && apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gconf2 \ |
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
/* configuration.. | |
<config updateRate="1000"> | |
<ua endpoint="opc.tcp://localhost:49320/" /> | |
<da endpoint="localhost" server="Kepware.KEPServerEX.V5" /> | |
<dependencies> | |
<dependency name="dep1"> | |
<from node="OPC.Tag1"/> | |
<to node ="OPC.Tag2"/> | |
</dependency> |
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-xs, .if-not-sm, .if-not-md, .if-not-lg { | |
display:inherit; | |
} | |
.if-not-xs, .if-sm, .if-md, .if-lg { | |
display:none; | |
} | |
@media (min-width: 48em) { | |
.if-xs, .if-not-sm { | |
display:none; |
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 Lab5 where | |
import Control.Monad | |
data Concurrent a = Concurrent ((a -> Action) -> Action) | |
instance Functor Concurrent where | |
fmap = liftM | |
instance Applicative Concurrent where |
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
primes :: [Int] | |
primes = sieve [2..] | |
sieve :: [Int] -> [Int] | |
sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p /=0] |
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
-- from hutton | |
import Control.Applicative -- Otherwise you can't do the Applicative instance. | |
import Control.Monad (liftM, ap) | |
import Data.Char | |
newtype Parser a = P(String -> [(a, String)]) | |