Skip to content

Instantly share code, notes, and snippets.

@tmatz
tmatz / CustomError.js
Last active August 20, 2022 16:01
javascript CustomError
export class CustomError extends Error {
get name() {
return this.constructor.name
}
}
@baleyko
baleyko / socat_server.sh
Created March 8, 2018 10:44 — forked from CMCDragonkai/socat_server.sh
Socat: Simple HTTP Server
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
@ysugimoto
ysugimoto / npm-run-completion.sh
Created August 21, 2017 07:57
Bash-completion for `npm run` command
#!/bin/bash
# This is bash-completion for 'npm run' command.
# Find up package.json and completion 'npm scripts'.
_npm_run_completion() {
CURRENT="${COMP_WORDS[COMP_CWORD]}"
SUBCOMMAND="${COMP_WORDS[COMP_CWORD-1]}"
if [ "${SUBCOMMAND}" != "run" ]; then
return
fi
@dodyg
dodyg / gist:5823184
Last active October 20, 2024 12:25
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.