View Dockerfile
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 racket/racket:8.1-full AS build | |
WORKDIR /src/my-project | |
RUN raco pkg config --set catalogs \ | |
https://download.racket-lang.org/releases/8.1/catalog/ \ | |
https://racksnaps.defn.io/snapshots/2021/05/27/catalog/ | |
RUN raco pkg install --auto --batch $ALL_THE_PACKAGES_I_NEED | |
COPY . /src/my-project | |
RUN raco test -x . | |
RUN raco exe --vv ++lib $DYNAMIC_REQUIRE_LIBS -o my-project main.rkt |
View box.es6
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
// The box pattern: | |
// Array chaining methods for single values | |
const box = v => [ v ] | |
box(1) | |
.map(n => n * 2) | |
.map(n => n + 2) | |
.pop() |
View ArrayLikeObservable.es6
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
class Observable { | |
constructor(fn) { | |
this._fn = fn; | |
this._children = []; | |
const handler = { | |
get(target, prop) { | |
return prop in target || !(prop in Array.prototype) |
View run-chromedriver-cluster.ps1
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
param ( | |
[string]$instances = 10 | |
) | |
docker rm -f selenium-hub | |
docker run --restart=always -d -p 4444:4444 --name selenium-hub selenium/hub:3.0.0-dubnium | |
$i=0 | |
while($i -ne $instances) | |
{ |
View DataStore.js
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
/** | |
* A single data store for modules to communicate with. Keeping 'the truth' in a single place reduces bugs and allows | |
* for greater seperation of concerns. | |
* | |
* The module can be used as a singleton through DataStore.getSingleton('key'), or on instance basis through the new keyword. | |
* | |
* Uses the Observer module found here: https://gist.github.com/peeke/42a3f30c2a3856c65c224cc8a47b95f9 | |
* | |
* @name DataStore | |
* @author Peeke Kuepers |
View observer.js
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
/** | |
* Used for inter-object communication. | |
* (Semi-)drop in replacement for Rik Schennink's Observer. | |
* | |
* Implementation differences: | |
* - ES6 | |
* - The use of WeakMaps | |
* - inform() and conceal() don't return a boolean indicating success. | |
* - Subscription fn's are called with seperate arguments, instead of one data parameter. This is backwards compatible. | |
* |
View model-mixin.js
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 Events from 'eventemitter3'; | |
const modelMixin = Object.assign({ | |
attrs: {}, | |
set (name, value) { | |
this.attrs[name] = value; | |
this.emit('change', { | |
prop: name, | |
value: value |
View introspection-query.graphql
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
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
subscriptionType { name } | |
types { | |
...FullType | |
} | |
directives { |
View combinators.js
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
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
View Enhance.js
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 { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
NewerOlder