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/bash | |
git_root=$(git rev-parse --show-toplevel) | |
if [[ "$git_root" == "" ]]; then | |
exit 1 | |
fi | |
cd "$git_root/.git/hooks" | |
curl -LO https://gist.github.com/piksel/af64b9ca445c1354be862cd1485e15c0/raw/pre-commit | |
chmod a+x pre-commit |
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/bash | |
tree --noreport -F $* | sed -E 's/ ?([0-9|A-Z|a-z|.|*|_|-]+)$/📄 \1/gm; s/ ?(\S+)\//📁 \1/gm' |
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/bash | |
if [[ -z "$BB_WORKSPACE" ]]; then echo "Missing variable BB_WORKSPACE"; exit 1; fi | |
if [[ -z "$BB_TOKEN" ]]; then echo "Missing variable BB_TOKEN"; exit 1; fi | |
if [[ -z "$BB_REPO" ]]; then echo "Missing variable BB_REPO"; exit 1; fi | |
step=0 | |
while read id; do | |
if [[ -d "prs/pr-$id" ]]; then |
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/bash | |
tmp_dir=${TMPDIR:-/tmp} | |
max_itm_len=24 | |
max_val_len=100 | |
hth_key_col=35 | |
hth_val_col=97 | |
hth_itk_col=94 | |
hth_itv_col=97 | |
sec_hdr_col=96 |
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
class FakeWindow implements Window { | |
[index: number]: Window; | |
get clientInformation(): Navigator { | |
console.log('Called get clientInformation'); | |
return {} as Navigator; | |
} | |
closed: boolean = false; | |
customElements: CustomElementRegistry = {} as CustomElementRegistry; | |
devicePixelRatio: number = globalThis.devicePixelRatio; |
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 readline from 'node:readline/promises'; | |
/** | |
* conlib v6 | |
* @author nils måsén | |
* @copyright 2018-2024, nils måsén | |
*/ | |
export default class ConLib { | |
constructor(stream) { |
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
#!/usr/bin/env node | |
/* | |
Serves files from a directory, injecting a script into HTML pages that reloads the page whenever a POST request to the file completes. | |
Requires Node.js v18+ | |
Usage: | |
node http-serve-autoreload.mjs [ROOT-PATH] [PORT] | |
*/ | |
import { createServer } from 'node:http'; |
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 { readdir, readFile, writeFile, access, stat } from 'node:fs/promises'; | |
import { resolve } from 'node:path'; | |
const [, , path] = process.argv; | |
const HEADER = '// AUTO-GENERATED by export-all.mjs DO NOT CHANGE!'; | |
if (!path) { | |
console.error('Missing argument PATH') | |
process.exit(1); |
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
func (MarkdownTreeRenderer) writeFieldExtras(sb *strings.Builder, field *FieldInfo) { | |
if len(field.Keys) > 1 { | |
sb.WriteString(" Aliases: `") | |
for i, key := range field.Keys { | |
if i == 0 { | |
// Skip primary alias (as it's the same as the field name) | |
continue | |
} | |
if i > 1 { | |
sb.WriteString("`, `") |
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
export PATH=$(echo $PATH | tr ":" "\n" | grep -v '/mnt/' | paste -sd ":") |
NewerOlder