Skip to content

Instantly share code, notes, and snippets.

Avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / youtube_clean_watch_later_videos.js
Created Feb 21, 2021
Clean YouTube Watch Later Videos
View youtube_clean_watch_later_videos.js
// 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
(async function() {
const sleep = (timeout) => new Promise(res => setTimeout(res, timeout))
const untilDefined = async (factory, timeout = 100) => {
@qoomon
qoomon / jira_card_shrinker_bookmarklet.js
Last active Jan 25, 2021
JIRA Card Shrinker Bookmarklet
View jira_card_shrinker_bookmarklet.js
javascript: (function() {
let style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(`
.ghx-column > .ghx-parent-group.ghx-away > .ghx-parent-stub > .ghx-group {
padding-left: 6px;
height: 16px;
}
.ghx-column > .ghx-parent-group.ghx-away > .ghx-parent-stub > .ghx-group > .ghx-key {
margin: 0;
View jira-queries.md

Board Quick Filters

  • Recently Updated

    • updatedDate >= -1d OR ( updatedDate <= endOfWeek(-1w) AND updatedDate >= -3d)
    • Filter issues updated since last weekday
  • Flagged

    • Flagged is not EMPTY
    • Flter flagged issues
@qoomon
qoomon / clipperz2enpass.js
Created Oct 26, 2020
clipperz export to enpass converter
View clipperz2enpass.js
#!/usr/bin/env node
// requirenments
// npm install --save \node-html-parser uuid
const fs = require('fs')
const parseHtml = require('node-html-parser').parse
const uuid = require('uuid').v4
@qoomon
qoomon / git_configure.sh
Last active Feb 26, 2021
Opinionated Git Config
View git_configure.sh
#!/bin/bash
SELF_DIR="$(dirname "$0")"
cd "$SELF_DIR"
# git global config see $HOME/.gitconfig
git config --global color.ui 'auto'
git config --global merge.ff false
# ensures to convert CRLF to LF when writing to database
git config --global core.autocrlf 'input'
git config --global pull.rebase 'merges'
@qoomon
qoomon / aws-cloudformation-deployer.sh
Last active Aug 13, 2020
Deploy CloudFormation Templates including Packaging and Deploy Event Watching
View aws-cloudformation-deployer.sh
#!/usr/bin/env bash
set -o errexit # exit when a command line fails
set -o pipefail # pipes exit code will be the last non-zero exit code of all pipe commands
set -o nounset # exit on read a undeclared variable
#set -o xtrace # enable debug logging
cd "$(dirname "${BASH_SOURCE[0]}")"
### SOURCE: https://gist.github.com/qoomon/7e6f751415389a8bd67f05dd0b984d06
### REQUIREMENTS #######################################################################################################
@qoomon
qoomon / iptables-local-port-forward.sh
Created Apr 26, 2020
iptables - forward traffic from local port to target address
View iptables-local-port-forward.sh
#!/usr/bin/env bash
set -o errexit # exit when a command line fails
set -o pipefail # pipes exit code will be the last non-zero exit code of all pipe commands
set -o nounset # exit on read a undeclared variable
#set -o xtrace # enable debug logging
cd "$(dirname "${BASH_SOURCE[0]}")"
# Target Address e.g '123.123.123.123:1024'
TARGET_ADDRESS="$1"
@qoomon
qoomon / JsonbColumnType.kt
Last active Feb 12, 2021
Kotlin Exposed Postgres JsonColumnType
View JsonbColumnType.kt
package me.qoomon.examples
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import me.qoomon.examples.JsonbColumnType.Companion.JSONB
import me.qoomon.examples.JsonbColumnType.Companion.TEXT
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.Function
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
@qoomon
qoomon / hibp
Last active Oct 20, 2020
Have I been pwned! Script to check your password against https://haveibeenpwned.com/
View hibp
#!/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 / Log4jCollector.kt
Last active Sep 13, 2019
Log4jCollector Junit5 Extension
View Log4jCollector.kt
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.core.Filter.Result
import org.apache.logging.log4j.core.LogEvent
import org.apache.logging.log4j.core.Logger
import org.apache.logging.log4j.core.filter.AbstractFilter
import org.junit.jupiter.api.extension.AfterAllCallback
import org.junit.jupiter.api.extension.BeforeAllCallback
import org.junit.jupiter.api.extension.BeforeEachCallback
import org.junit.jupiter.api.extension.ExtensionContext