This file contains hidden or 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
| kill() { | |
| local name="${1}" | |
| if [ -z "$name" ]; | |
| then | |
| echo ">> Enter a process name and press [ENTER] (partial matching)" | |
| read name | |
| fi | |
| wmic process where "name like '%$name%'" delete | |
| } |
This file contains hidden or 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
| module.exports = async function getDevDependencies(globs = ['package.json', 'packages/*/*.json']) { | |
| const globby = require('globby'); | |
| const packageFiles = await globby(globs, { absolute: true }); | |
| return packageFiles.reduce((result, file) => { | |
| const pkg = require(file); | |
| if (pkg.devDependencies) { | |
| const names = Object.keys(pkg.devDependencies); | |
| return result.concat(names.filter(name => !result.includes(name))); | |
| } |
This file contains hidden or 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
| export function renameObjKeys(obj, mapping) { | |
| // based on https://stackoverflow.com/a/48110891/368254 | |
| const renameObjKey = (obj, { oldKey, newKey }) => { | |
| const keys = Object.keys(obj); | |
| const newObj = keys.reduce((acc, val) => { | |
| if (val === oldKey) { | |
| acc[newKey] = obj[oldKey]; | |
| } else { | |
| acc[val] = obj[val]; | |
| } |
This file contains hidden or 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
| (function getGitlabSecrets() { | |
| const secrets = [ | |
| ...document.querySelectorAll('.ci-variable-row-body'), | |
| ].reduce((result, row) => { | |
| const key = row.querySelector( | |
| '[name="variables[variables_attributes][][key]"]', | |
| ).value; | |
| const value = row.querySelector( | |
| '[name="variables[variables_attributes][][secret_value]"]', | |
| ).value; |
This file contains hidden or 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
| dockerized-ubuntu() { dockerized ubuntu ubuntu:latest /bin/bash bash } | |
| dockerized-curl() { dockerized curl pstauffer/curl:latest /bin/sh sh } | |
| # based on https://stackoverflow.com/a/56690087/368254 | |
| dockerized() | |
| { | |
| name=$1 | |
| image=$2 | |
| containercmd=$3 | |
| runcmd=$4 |
This file contains hidden or 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
| // ---- | |
| // libsass (v3.5.4) | |
| // ---- | |
| @mixin spacing-helpers( | |
| $style, | |
| $sizes: (0, 5, 10, 15, 20, 25, 30, 50), | |
| $positions: ('', 'top', 'left', 'bottom', 'right') | |
| ) { | |
| @each $size in $sizes { |
This file contains hidden or 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
| // ------------------------------------------------------------------------ | |
| // | |
| // @mixin variate($style, $sizes, $variations, $withUnits) | |
| // | |
| // creates a list of shortcut utitlity classes, with variations for each side | |
| // | |
| // Usage: | |
| // | |
| // variate(margin); | |
| // variate(margin, (0em, 6em, 12em, 24em, 48em)); |
This file contains hidden or 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
| # just delete all node_modules recursively without reinstalling | |
| alias delete-node-modules='find . -name node_modules -type d -exec rm -rf "{}" + ' | |
| # delete all node_modules and reinstall via npm | |
| nuke-npm() { | |
| if [ "$1" == "-f" ]; then | |
| rm -f package-lock.json | |
| fi | |
| find . -name node_modules -type d -exec rm -rf "{}" + | |
| npm install |
This file contains hidden or 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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions | |
| // - XState (all XState exports) |