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
/** | |
* Environment shape | |
*/ | |
export interface Environment { | |
/** | |
* Application version, straight from the package.json | |
*/ | |
version: string; | |
/** |
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/sh | |
expand_single_args() { | |
var="${1#-}" # cut off first, and only dash | |
while [ "$var" ]; do | |
next="${var#?}" | |
first_char="${var%$next}" | |
echo "-$first_char" | |
var="$next" # next | |
done |
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/sh | |
# This script will run npm pack on every dependency and dependencies of a dependency | |
# on 8 threads. It's useful if you want to then upload everything to a private registry. | |
mkdir packages | |
cd packages || exit 1 | |
# There is some unwanted garbage in the output of `npm ls` hence the inverted greps | |
npm ls --all --registry https://registry.npmjs.org 2> /dev/null | |
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
import { Observable, OperatorFunction } from 'rxjs'; | |
import { tap, map, flatMap, mergeScan, reduce, finalize } from 'rxjs/operators'; | |
/** | |
* This loader-manager pipeline should be attached to an observable that contains | |
* a finite amount of observables (preferrably using an of(), like here.) | |
* | |
* Loading starts when the source completes! | |
* | |
* These observables should be expected to complete, as the pipeline will |
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/sh | |
# Converts a 1Money export to be used at Wallet | |
# Converts one Account at a time, places all found accounts into a folder | |
# called output | |
# Usage: | |
# ./convert_1money_to_wallet.sh 1moneyexport.csv | |
# Import settings: | |
# Go to https://web.budgetbakers.com/imports |
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
@HostListener('abort', ['$event']) | |
@HostListener('afterprint', ['$event']) | |
@HostListener('animationend', ['$event']) | |
@HostListener('animationiteration', ['$event']) | |
@HostListener('animationstart', ['$event']) | |
@HostListener('beforeprint', ['$event']) | |
@HostListener('beforeunload', ['$event']) | |
@HostListener('blur', ['$event']) | |
@HostListener('canplay', ['$event']) | |
@HostListener('canplaythrough', ['$event']) |
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
const task = (i: number): Promise<number> => | |
new Promise((res, rej) => { | |
setTimeout( | |
() => { | |
if (i % 12 === 0) { | |
console.log('task reject', i); | |
rej('nope'); | |
} else { | |
console.log('task resolve', i); | |
res(i); |
OlderNewer