AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, blogs and UNIX man
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
// Option 1 | |
async function streamToString(stream: NodeJS.ReadableStream): Promise<string> { | |
const chunks: Array<any> = []; | |
for await (let chunk of stream) { | |
chunks.push(chunk) | |
} | |
const buffer = Buffer.concat(chunks); | |
return buffer.toString("utf-8") | |
} |
- Install tools
curl -s “https://get.sdkman.io" | bash
sdk install kotlin
sdk install kscript
- Run the script
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
// 2>/dev/null;/usr/bin/env go run $0 $@; exit $? | |
// Found at https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd | |
package main | |
import "fmt" | |
// You can run the script with one of two ways | |
// 1. chmod +x test-script.go && ./test-script.go | |
// 2. go run test-script.go |
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/bash | |
set -e | |
SOURCE_DIR="the-dir-to-save" | |
S3_BUCKET="s3://your-s3-bucket/with/path" | |
TIMENOW="$(date --rfc-3339=seconds | tr ' ' '_' | tr ':' '-' | tr '+' '.')" | |
FILENAME="$SOURCE_DIR.$TIMENOW.tgz" |
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/bash | |
set -e | |
INSTALL_DIR="$HOME/local" | |
# erlang FROM SOURCE - http://erlang.org/doc/installation_guide/INSTALL.html | |
# You need to have OpenSSL for :crypto, wxWidgets for :wx, etc. | |
#ERL_VERSION="20.2" | |
#wget "http://www.erlang.org/download/otp_src_$ERL_VERSION.tar.gz" |
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 first line of the input is considered to be the heading! | |
; It accepts either one command line argument with the CSV file path | |
; or it reads the input from `stdin`. | |
#lang racket | |
(require csv-reading) | |
(define (getInputPort) | |
(cond | |
[(> (vector-length (current-command-line-arguments)) 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
#lang racket | |
(define (qsrt iarr lt) | |
(cond | |
[(< 1 (length iarr)) | |
(let ( | |
[pivot (first iarr)] | |
[gt (lambda (l r) (not (or (lt l r) (equal? l r))))]) | |
(append | |
(qsrt (filter (lambda (x) (lt x pivot)) iarr) lt) |