Usage: devops [options] <command> [args]
Sourcing:
Sourcing script defines functions and passes entrypoint function to init.
Samples when devops is located in the same/relative/absolute path:
. "`dirname "${BASH_SOURCE[0]}"`/devops" && init <entrypoint> "$@"
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
TEST_VAR=7 |
Solution for https://jsfiddle.net/mladylukas/9qmusLok/
-
Clone this repository
-
Run any local development http server like VS Code Live Server or Node live-server:
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
// Dynamic function arguments currying in TypeScript | |
// - For functions with any fixed arguments it keeps currying the function | |
// until all fixed arguments are provided, then returns the result | |
// - For functions with dynamic arguments only it keeps currying the function | |
// as long as the call provides any spices, otherwise returns the result | |
// - Source: https://gist.github.com/iki/6472c0775cc0847fc667c01524cafa6b | |
type Args = readonly unknown[] | |
type Func<A extends Args = any[], R = any> = (...args: A) => R | |
type Slices<A extends Args, I extends Args = []> = A extends readonly [infer F, ...infer R] |
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 hide = (s: string) => '*'.repeat(s.length); | |
const hideEachSecondMatch = (_match: string, ...matches: string[]) => | |
matches | |
.slice(0, -2) | |
.map((m, i) => (i % 2 ? hide(m) : m)) | |
.join(''); | |
// Hide all characters in email name, except first and last character | |
// FIXME: Better hide at least one character for 1-2 character names | |
const hideEmail = (email: string, options?: { domain?: boolean }) => | |
email.replace( |
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
# Format: https://git-scm.com/docs/gitignore#_pattern_format | |
*.json | |
*.yaml | |
.DS_Store | |
*.log | |
*.log.* | |
/.*/ |
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
version: '3.7' | |
services: | |
whoami: | |
image: jwilder/whoami | |
ports: | |
- 127.0.0.1:7000:8000 | |
cors: |
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
FROM alpine | |
WORKDIR /data | |
COPY . . | |
CMD ls -l /data |
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
# See https://help.github.com/ignore-files/ for more about ignoring files. | |
# logs | |
*.log* | |
# tools settings and other hidden directories | |
/.*/ |
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
// ==UserScript== | |
// @name Medium: remove location hash | |
// @namespace http://efcl.info/ | |
// @description Remove location hash from medium | |
// @include https://medium.com/* | |
// @include https://uxdesign.cc/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== |
NewerOlder