MatchRegex: ^(?<tab>\s+)(?<property>[\w-]+):?\s+(?<value>.+)$
ReplaceValue: $1$2: $3;
MatchRegex: \$([\w-]+)
ReplaceValue: var(--$1)
import readline from 'readline' | |
for (let i = 0; i < process.stdout.rows; i++) { | |
readline.cursorTo(process.stdout, 0, i) | |
readline.clearLine(process.stdout, 0) | |
} | |
readline.cursorTo(process.stdout, 0, 0) | |
process.stdout.write('\x1b[3J') |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
type PipeCurrying<T> = <F extends ((previousValue: T) => unknown) | undefined>(value?: F) => undefined extends F ? T : PipeCurrying<F extends (value: T) => infer R ? R : unknown> | |
/** | |
* Pipe function | |
* @example pipe(123)() // 123 | |
* @example pipe(123)(v => v + 456)() // 579 | |
* @example pipe({a: 3})(v => v.a)(v => v * 15)(v => v.toString(16))(v => '0x' + v)() // 0x2d | |
*/ | |
function pipe<T>(initialValue: T): PipeCurrying<T> { | |
return ((value?: (previousValue: T) => unknown) => { |
const S_BASE_64: [char; 64] = [ | |
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', | |
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', | |
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', | |
'5', '6', '7', '8', '9', '+', '/', | |
]; | |
fn to_base64(bytes: &[u8]) -> String { | |
let mut dst = String::new(); | |
let mut padding = 0; |