This file contains hidden or 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 Circle { | |
private radius: number; | |
constructor(radius: number) { | |
this.radius = radius; | |
} | |
circumference() { | |
return Math.PI * 2 * this.radius; |
This file contains hidden or 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
/** | |
* Because the Internet | |
*/ | |
const isEven = (x) => { | |
const ys = (x >>> 0).toString(2).split(""); | |
return ys[ys.length - 1] !== ys[0]; | |
}; |
This file contains hidden or 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
export type List<T> = { value: T; next: List<T> } | null; | |
export const map = <T, U>(list: List<T>, fn: (value: T) => U): List<U> => { | |
if (list === null) return null; | |
return { | |
value: fn(list.value), | |
next: map(list.next, fn), | |
}; | |
}; |
This file contains hidden or 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 ConsumerTransferFlowMachine = Machine( | |
{ | |
id: 'ConsumerTransfer', | |
initial: 'in_progress', | |
context: { | |
actionDate: 3 | |
}, | |
states: { | |
in_progress: { | |
on: { |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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
{ | |
"swagger": "2.0", | |
"host": "localhost:8080", | |
"basePath": "/", | |
"schemes": ["http"], | |
"info": { "title": "EBT Documentation", "version": "0.0.1" }, | |
"tags": [], | |
"paths": { | |
"/ebt": { | |
"post": { |
This file contains hidden or 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
{ | |
"swagger": "3.0", | |
"host": "localhost:8080", | |
"basePath": "/", | |
"schemes": ["http"], | |
"info": { "title": "EBT Documentation", "version": "0.0.1" }, | |
"tags": [], | |
"paths": { | |
"/ebt": { | |
"post": { |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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
let bottles = (number) => switch(number) { | |
| 0 => "no more bottles of beer" | |
| 1 => "1 bottle of beer" | |
| n => { | |
let formatted = string_of_int(n); | |
{j|$formatted bottles of beer|j}; | |
} | |
} | |
let rec countdownFrom = (current) => current == 0 ? { |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
NewerOlder