Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| #!/usr/bin/env bash | |
| ## A utility for following the Conventional Commits style | |
| ## | |
| ## usage: __USAGE__ | |
| ## | |
| ## Options | |
| ## -h this help | |
| ## -a commit all | |
| ## -s <scope> set the scope for the commit |
| #!/usr/bin/env bash | |
| # Serve a file as HTTP response using netcat | |
| set -eu | |
| # Error outcomes | |
| EX_UNAVAILABLE=69 | |
| # Initial values |
| // https://en.wikipedia.org/wiki/Summed-area_table | |
| type Point = { x: number; y: number }; | |
| type DefaultingGetter<T> = (x: number) => T; | |
| type DefaultingGetterFactory = <T>(xs: T[], def: T) => DefaultingGetter<T>; | |
| interface Mapper { | |
| toxy: (n: number) => Point; | |
| toi: (x: number, y: number) => number; | |
| } |
| // This decoder is based on this answer https://stackoverflow.com/a/21115816 | |
| // It's not perfect, e.g. it does not accommodate the extended alphabet. | |
| // | |
| // Solution from SO answer paraphrased below: | |
| // | |
| // For input: C7F7FBCC2E03 | |
| // 1) Form tuples for hex numbers and reverse | |
| // -> 03-2E-CC-FB-F7-C7 | |
| // 2) Convert hex to 8-bit binary octets | |
| // -> 00000011-00101110-11001100-11111011-11110111-11000111 |
| package main | |
| import ( | |
| "fmt" | |
| "strings" | |
| ) | |
| type Any interface{} // The lack of generics in Go is the pitfall | |
| type Morphism func(Any) Any |
| #!/usr/bin/env bash | |
| DUMP=/path_to_downloaded_images_storage_here | |
| GENERATED_IMG_SRC=$(curl -s "http://inspirobot.me/api?generate=true") | |
| if [ $? -eq 0 ]; then | |
| BASENAME=$(basename $GENERATED_IMG_SRC) | |
| OUT="$DUMP/$BASENAME" | |
| TMP="/tmp/$BASENAME" |
| function dump(o, p) | |
| p = p or '' | |
| if type(o) == 'table' then | |
| local s = '{\n' | |
| local pp = p .. ' ' | |
| for k,v in pairs(o) do | |
| if type(k) ~= 'number' then k = '"' .. k .. '"' end | |
| s = s .. pp .. '[' .. k .. '] = ' .. dump(v, pp) |
| import React from "react"; | |
| import DocumentMeta from "react-document-meta"; | |
| const applyTransforms = ({ title, ...props }) => ({ ...props, title: `${title} - suffix` }); | |
| export default const ProxyComponent = (props) => <DocumentMeta {...applyTransforms(props)} extend />; |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>TableSort Demo</title> | |
| <body> | |
| <table> | |
| <thead> | |
| <tr> | |
| <th class="default-sort">Weekday</th> | |
| <th>Date</th> |