Skip to content

Instantly share code, notes, and snippets.

Avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / parse-body.js
Created Oct 25, 2022
Parse http.IncomingMessage body
View parse-body.js
async function parseBody(res) {
return new Promise((resolve, reject) => {
let body = '';
res.on('data', (chunk) => body += chunk);
res.on('end', () => resolve(body));
}).then(body => res.body = body ? JSON.parse(body) : undefined);
}
@qoomon
qoomon / base-vpc.ts
Created Sep 30, 2022
AWS CDK - Vpn Construct - Configure default security group according to "CIS AWS Foundations Benchmark controls",
View base-vpc.ts
import {Stack} from "aws-cdk-lib";
import {Vpc, VpcProps} from "aws-cdk-lib/aws-ec2";
import {AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId} from "aws-cdk-lib/custom-resources";
import {Construct} from "constructs";
export class BaseVpc extends Vpc {
constructor(scope: Construct, id: string, props: VpcProps) {
super(scope, id, props);
// Configure default security group according to "CIS AWS Foundations Benchmark controls",
// section "4.3 – Ensure the default security group of every VPC restricts all traffic".
@qoomon
qoomon / GitHubBulkOperations.sh
Created Jul 29, 2022
GitHub Bulk Operations
View GitHubBulkOperations.sh
# list repos
# gh repo list $owner --json nameWithOwner -q '.[].nameWithOwner'
repos=(
example/example
)
for repo in "${repos[@]}"
do
echo $repo
View ticktok_clean_favourites.js
async function sleep (timeout) {
return new Promise(res => setTimeout(res, timeout))
}
let videoElement = document.querySelector('div[data-e2e="user-liked-item"]').parentElement
while(videoElement) {
console.log(videoElement)
videoElement.scrollIntoView()
await sleep()
@qoomon
qoomon / ATOSS Bulk Insert Bookmarklet.js
Last active Jun 1, 2022
ATTOS Time Insert Bookmarklet
View ATOSS Bulk Insert Bookmarklet.js
javascript:(async function() {
console.info('author: bengt brodersen - www.qoomon.de');
console.info('version: 1.0.1');
'// this bookmarklet will insert configured workingTimes for all visible empty days in the past';
'// === configuration ====================================================';
const workingTimes = {
'Mo': [{checkIn: '08:00', checkOut: '16:30'}],
'Di': [{checkIn: '08:00', checkOut: '16:30'}],
@qoomon
qoomon / ecs-execute-command.sh
Last active Feb 1, 2022
Connect into AWS ECS Container
View ecs-execute-command.sh
CLUSTER_NAME=$1
SERVICE_NAME=$2
CONTAINER_NAME=$3
COMMAND=${4:-'/bin/sh'}
# get first running task
TASK_ID=$(aws ecs list-tasks \
--cluster $CLUSTER_NAME \
--service-name $SERVICE_NAME \
--desired-status RUNNING \
@qoomon
qoomon / jira_script runner_behaviour.groovy
Last active Nov 23, 2021
Jira Script Runner - Behaviour - Issue Templates, Restrict Links Types
View jira_script runner_behaviour.groovy
// ------------------------------------------
// ---- Set default Description -------------
// ------------------------------------------
def defaultDescriptions = [
Story: """
*As a* USER
*I want* FEATURE
*so that* BENEFIT
@qoomon
qoomon / convert-pdf2scan.sh
Last active Jan 21, 2022
fake pdf scanner.
View convert-pdf2scan.sh
#!/usr/bin/env bash
set -e # exit on error
################################################
#
# Prerequisits:
# ensure ImageMagick is installed
#
# Usage:
# convert-pdf2scan [--gray] files...
#
@qoomon
qoomon / youtube_clean_watch_later_videos.js
Last active Nov 24, 2022
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 in your browser console
// adjust REMOVE_BUTTON_TEXT accordingly to your language, see examples below
(async function() {
const REMOVE_BUTTON_TEXT = 'Remove from Watch later'
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