- Define the
input
- Define the
output
- Define the steps leading from the input to output in either direction
- Spot the weak links/hard parts
- Understand if the weak links can be avoided - if yes go to 3
- Start implementing the algorithm from the end (starting from the step which generates the output and threading back)
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
type expectException | |
type expect<'a, 'ret> | |
@module("@jest/globals") external describe: (string, unit => unit) => unit = "describe" | |
@module("@jest/globals") external test: (string, unit => unit) => unit = "test" | |
@module("@jest/globals") external testAsync: (string, unit => Js.Promise.t<unit>) => unit = "test" | |
@module("@jest/globals") external expect: 'a => expect<'a, unit> = "expect" | |
@module("@jest/globals") external expectF: (unit => 'a) => expect<expectException, unit> = "expect" | |
@module("@jest/globals") |
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
#!/bin/zsh | |
PID_FILE="$HOME/.boundary_session_ttcp_BRTTDbGBAK" | |
connect() { | |
echo "Inititating a boundary session to k8s..." | |
TMP_FILE=$(mktemp) | |
nohup -- boundary connect -target-id ttcp_BRTTDbGBAK -format json &> $TMP_FILE & | |
CONNECT_PID=$! |
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
Sending build context to Docker daemon 1.931MB | |
Step 1/7 : FROM ulrikaugustsson/esy:latest | |
---> e2f92066e3df | |
Step 2/7 : ARG ocaml_version=4.9.0 | |
---> Using cache | |
---> eb02038ad958 | |
Step 3/7 : ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib | |
---> Using cache | |
---> 2602c8833912 |
BuckleScript friendly vim
+ official ocaml-lsp setup for Reason/OCaml
Prerequisite: Install esy 0.6.0
.
- Check
esy version
(it has to be>0.6.0
) - Create
esy.json
with the following contents next topackage.json
:
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
λ esy build-plan -p @opam/postgresql | |
{ | |
"id": "opam__s__postgresql-opam__c__4.5.2-7fdcd1e6", | |
"name": "@opam/postgresql", | |
"version": "opam:4.5.2", | |
"sourceType": "immutable", | |
"buildType": "in-source", | |
"build": [ [ "dune", "build", "-p", "postgresql", "-j", "4" ] ], | |
"install": [], | |
"sourcePath": |
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
type validatorData('a) = { | |
value: 'a, | |
isTouched: bool, | |
submitted: bool, | |
}; | |
type shouldDisplayError('error) = { | |
error: 'error, | |
isTouched: bool, | |
submitted: bool, |
- Create a dune file:
(library
(public_name aggregate_ppx_name)
(kind ppx_rewriter)
(libraries ppx_deriving_protobuf other_ppx another_ppx))
- Build:
dune build --profile release
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
type t('list, 'last) = | |
| []: t('a, 'a) | |
| ::('a, t('l, 't)): t('a => 'l, 't); | |
let rec (@): | |
type start mid rest. (t(start, mid => rest), mid) => t(start, rest) = | |
(l, r) => | |
switch (l) { | |
| [] => [r] | |
| [a, ...q] => [a, ...q @ r] |
NewerOlder