Skip to content

Instantly share code, notes, and snippets.

View qoomon's full-sized avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active April 21, 2025 03:56
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@qoomon
qoomon / youtube_clean_watch_later_videos.js
Last active April 4, 2025 04:38
Clean YouTube Watch Later Videos
// Version 2.0.1
// This script will remove all videos from watch later list
//
// Usage
//
// #1 go to https://www.youtube.com/playlist?list=WL
// #2 run following script in your browser console
(async function() {
const playlistName = document.querySelector('.metadata-wrapper #container #text')?.textContent || document.querySelector('#text')?.textContent
@qoomon
qoomon / Sandbox.md
Created November 1, 2024 08:08
Sandbox

Moin

@qoomon
qoomon / keyoxide-proof.md
Last active February 21, 2025 15:25
keyoxide.org Proof

aspe:keyoxide.org:X2TJUL5QWM6CYZRFO6LLKFJ72Q

@qoomon
qoomon / github-for-each-org-repository.ts
Created September 3, 2024 15:47
Script to iterate over all GitHub org repos
import {Octokit} from 'octokit';
import * as process from 'node:process'
import YAML from 'yaml';
const metaDataPath = '.github/metadata.yaml';
const input = {
token: process.env.GITHUB_TOKEN ?? _throw(new Error('environment variable GITHUB_TOKEN is required')),
owner: process.env.GITHUB_OWNER ?? _throw(new Error('environment variable GITHUB_OWNER is required')),
}
@qoomon
qoomon / hibp
Last active October 5, 2024 15:39
Have I been pwned! Script to check your password against https://haveibeenpwned.com/
#!/usr/bin/env sh
set -e
color_red=$'\e[1;31m'
color_green=$'\e[1;32m'
color_reset=$'\e[0m'
########################### Usage ##############################################
#
# password prompt 'hibp'
# or
@qoomon
qoomon / TravisGitHub.md
Last active September 16, 2024 18:50
Setup GitHub Deploy Keys For Travis
@qoomon
qoomon / resultOf.ts
Last active August 27, 2024 11:25
Run functions or await promises in a safe way by return a result object
function resultOf<T>(fn: () => T): SafeResult<T>;
function resultOf<T>(fn: () => Promise<T>): Promise<SafeResult<T>>;
function resultOf<T>(promise: Promise<T>): SafeResult<T>;
function resultOf<T>(input: (() => T | Promise<T>) | Promise<T>): Result<T> | Promise<Result<T>> {
if (typeof input === 'function') {
try {
const result = input()
if (result instanceof Promise) {
return safe(result);
}
@qoomon
qoomon / git_configure.sh
Last active July 23, 2024 11:04
Opinionated Git Config
#!/bin/bash
# git global config see $HOME/.gitconfig
# ensures to convert CRLF to LF when writing to database
git config --global core.autocrlf 'input'
git config --global core.editor '$EDITOR'
git config --global core.pager 'less -R -M'
git config --global color.ui 'auto'
@qoomon
qoomon / gist:700f68ca890edd5802fd768652f231cc
Last active February 22, 2024 13:22
GitHub Actions Commit Identity
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'