Skip to content

Instantly share code, notes, and snippets.

@marcojahn
marcojahn / PublishingArtifactsWithAWSCodeartifactAndGitHubPackages.md How to publish software artifacts with AWS Codeartifact and GitHub Packages
@marcojahn
marcojahn / update-asdf-plugins.sh
Created December 21, 2021 06:45 — forked from developer-guy/update-asdf-plugins.sh
Update asdf plugins to their latest versions if necessary
#!/usr/bin/env sh
function update() {
for i in `asdf plugin list`
do
CURRENT_VERSION=`asdf current $i | awk '{print $2}'`
LATEST_VERSION=`asdf latest $i`
echo "Working with $i current version $CURRENT_VERSION but latest version is $LATEST_VERSION"
if [[ $(semver_check $LATEST_VERSION $CURRENT_VERSION) -lt 0 ]]; then
echo "Needs to update"
@marcojahn
marcojahn / tag.sh
Created December 2, 2021 09:09 — forked from julienperon/tag.sh
This shell tags all resources in a bucket. This is meant to be used at deploy time with cdk in conjunction with a life cycle policy to avoid keeping useless files.
#!/usr/bin/env bash
# This script manages a simple tagging lifecycle: current -> previous -> outdated.
# It is meant to be used with a bucket lifecycle policy, in order to delete all outdated tags.
# Why ?
# The deployment bucket has to be cleaned regularly, otherwise it will become a mess.
# However, having a simple lifecycle policy based on time is dangerous
# Deleting old objects without a recent deployment can lead to deletion of currently used assets.
# In case of error in the next deployment, the stack will try to rollback and will not find assets
@marcojahn
marcojahn / delete_local_branches.sh
Created June 7, 2021 10:31 — forked from TSMMark/delete_local_branches.sh
Delete local branches that don't exist on remote/origin
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -r -n 1 git branch -D
@marcojahn
marcojahn / iterm2-solarized.md
Created March 15, 2021 22:21 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@marcojahn
marcojahn / upload.js
Created March 11, 2021 07:23 — forked from tonkla/upload.js
Parsing 'multipart/form-data' Excel (.xlsx) with Busboy on AWS Lambda (Node.js)
'use strict'
const Busboy = require('busboy')
const XLSX = require('xlsx')
function parseMultipartFormData(input, contentType) {
return new Promise((resolve, reject) => {
const buffers = []
const busboy = new Busboy({
headers: { 'content-type': contentType },
@marcojahn
marcojahn / generate-docusaurus-sidebar.js
Created February 19, 2021 09:05 — forked from rudasn/generate-docusaurus-sidebar.js
Generate docusaurus sidebar from folder structure
//
// Generates a sidebar based on file structure and
// markdown frontmatter properties.
//
// ---
// title: My Cool Feature
// sidebar_label: Introduction
// ---
//
// sidebar_sort_order: the sort order of this page in the sidebar
@marcojahn
marcojahn / conventional-commit-regex.md
Last active April 13, 2024 13:27
Conventional Commit Regex

the following regex will validate all examples provided here: https://www.conventionalcommits.org/en/v1.0.0/

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)

a grep/posix compatible variant

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)

Keybase proof

I hereby claim:

  • I am marcojahn on github.
  • I am marcojahn (https://keybase.io/marcojahn) on keybase.
  • I have a public key ASCn9XaOS-RZThVl2lHTvDSwY4icEOkrWi1BYDX2nzymIwo

To claim this, I am signing this object:

@marcojahn
marcojahn / self-signed-certificate-with-custom-ca.md
Created October 17, 2018 10:56 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096