This is the documentation.
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 Iterators = { | |
compare(left, right) { | |
const leftIterator = left[Symbol.iterator](), rightIterator = right[Symbol.iterator](); | |
while (true) { | |
const {done: leftDone, value: leftValue} = leftIterator.next(); | |
const {done: rightDone, value: rightValue} = rightIterator.next(); | |
if (leftValue !== rightValue || leftDone !== rightDone) { |
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
-module(myordset). | |
-export([new/0, add_element/2, del_element/2, union/2, intersect/2, is_subset/2]). | |
new() -> []. | |
add_element(E, []) -> [E]; | |
add_element(E, [E|_] = L) -> L; | |
add_element(E, [H|T]) when E < H -> [E,H|T]; | |
add_element(E, [H|T]) when E > H -> [H|add_element(E, T)]. |
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
#!/bin/sh | |
TAG=$(uuidgen | tr -d '-' | tr '[A-Z]' '[a-z]') | |
docker build -t $TAG - << EOF | |
FROM debian | |
ENTRYPOINT ["echo", "Hello world from ${TAG}!"] | |
EOF | |
docker run --rm $TAG |
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
function binToString(n) { | |
if (n <= 1) { | |
return String(n); | |
} else { | |
return binToString(n >> 1) + binToString(n & 1); | |
} | |
} |
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
# sha256sum doesn't like if the checksum file contains entries for missing files | |
awk '{ if (system("test -f " $2) == 0) { print $0 } }' $1 | sha256sum -c |
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
url.match(/^([a-z]+):\/\/([^\/:]+)(?::([0-9]+))?(\/[^?#]+)?(?:\?([^#]*))?(?:#(.+))?$/); |
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
func min(x, y int) int { | |
if x > y { | |
return y | |
} else { | |
return x | |
} | |
} | |
func Sample(source []int, count int) []int { | |
count = min(count, len(source)) |
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
numbers := make([]int, 0, 10) | |
for i := 0; i < cap(numbers); i++ { | |
numbers = append(numbers, i) | |
} | |
fmt.Println(numbers) |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
type MockSource struct { | |
values []int64 | |
position int |
NewerOlder