Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
hyperupcall / settings.jsonc
Last active March 31, 2024 22:52
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@hyperupcall
hyperupcall / goto.sh
Last active August 21, 2022 05:01
Dumb Bash Goto
# shellcheck shell=bash
goto() {
local current_file="$0"
local label="$1"
# shellcheck disable=SC1090
source <(
local eval_line='no'
@hyperupcall
hyperupcall / lookahead.sh
Created December 12, 2021 10:17
Hacky lookahead / peek with `read -N1`
# shellcheck shell=bash
# Caveat: Only one start_peek can be ran for any particular case block
start_peek() {
if [ "$peek_status" = not_peeking ]; then
peek_status='currently_peeking'
peek_current=0
peek_total="$1"
REPLY_PEEKED_CHARACTERS="$2"
@hyperupcall
hyperupcall / keybase.md
Last active July 16, 2021 17:29
keybase.md

Keybase proof

I hereby claim:

  • I am hyperupcall on github.
  • I am kofler (https://keybase.io/kofler) on keybase.
  • I have a public key ASDvl9eavF5GcQPBYILol_kSykhUEmf4100BewIrJ4WgHAo

To claim this, I am signing this object:

// goal: to read `user-dirs.dirs` and
// generate parts of fstab for that
package main
import (
"fmt"
"strings"
)
@hyperupcall
hyperupcall / fetchLicenses.sh
Created July 10, 2020 23:51
Fetch SPDX Licenses
#!/usr/bin/env bash
set -euo pipefail
# little script that extracts some SPDX licenses from the choosealicense.com project using sed and grep.
# this was before i found https://github.com/spdx/license-list-data
# you will very likely have to tweak things to get this to work. it's just a paste of a shell script in one of my repositories that will be removed in the near future
cd ../licenses
licenses="$(curl -o- --silent https://github.com/github/choosealicense.com/tree/gh-pages/_licenses \
#!/usr/bin/env bash
IsShellVariable() { declare -p $1; } &>/dev/null
PrintShellVariable() {
if IsShellVariable $@; then
echo [\'$1\' as Shell Variable]: "${!1}"
else
echo [\'$1\' as Shell Variable]: "NOT FOUND"
return 1
fi
@hyperupcall
hyperupcall / change-master-branch-to-main.sh
Last active May 14, 2021 04:35
Cross-platform shell script to change the 'master' branch to 'main' for the local and remote repository
#!/bin/sh -eu
# code licensed under BSD 2-Clause "Simplified" License
# see `change-master-branch-to-main.sh --help` for usage
# see twitter thread for more details: https://twitter.com/EdwinKofler/status/1272729160620752898
site="github.com"
oldDefaultBranch="master"
newDefaultBranch="main"
/**
* @description given the location of this file, find the package.json of the closest parent package
* @async
* @return {string} absolute path of parent packageJson file
*/
export function findParentPackageJson() {
function parentDirOf(fileOrDir: string): string {
return path.join(fileOrDir, '..')
}
async function packageJsonExists(dir: string): Promise<boolean> {
FROM python:3
WORKDIR /usr/src/app
COPY . .
RUN pip install flask waitress
EXPOSE 8080