Skip to content

Instantly share code, notes, and snippets.

View RaymondKroon's full-sized avatar
😃

Raymond RaymondKroon

😃
View GitHub Profile
@RaymondKroon
RaymondKroon / GitHubCopilotCLIAlias.ps1
Created April 19, 2023 15:23 — forked from MattJeanes/GitHubCopilotCLIAlias.ps1
Alias commands to use GitHub Copilot CLI in PowerShell
# You should insert this script into your PowerShell Profile script so it exists in every session
# Fun fact: This script was mostly generated by ChatGPT by giving it the bash version of the output
# from `github-copilot-cli alias -- "$0"` with a few fixes from me
function Invoke-CopilotWhatTheShell {
$TMPFILE = New-TemporaryFile;
try {
github-copilot-cli what-the-shell $args --shellout $TMPFILE
if ($LASTEXITCODE -eq 0) {
@RaymondKroon
RaymondKroon / snippet.text
Created February 4, 2020 09:32
clean local only branches
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@RaymondKroon
RaymondKroon / sideeffect_workflow.go
Created November 6, 2019 12:40
Minimal workflow to (NOT) show UI history bug Can be run from cadence-sample
package main
import (
"context"
"github.com/uber-common/cadence-samples/cmd/samples/common"
"go.uber.org/cadence/client"
"go.uber.org/cadence/worker"
"go.uber.org/cadence/workflow"
"go.uber.org/zap"
"time"
@RaymondKroon
RaymondKroon / HelloSideEffect.java
Created November 1, 2019 07:26
Minimal workflow to show UI history bug Can be run from cadence-java-sample
package com.uber.cadence.samples.hello;
import com.uber.cadence.client.WorkflowClient;
import com.uber.cadence.worker.Worker;
import com.uber.cadence.workflow.QueryMethod;
import com.uber.cadence.workflow.Workflow;
import com.uber.cadence.workflow.WorkflowMethod;
import static com.uber.cadence.samples.common.SampleConstants.DOMAIN;
@RaymondKroon
RaymondKroon / buffer-horspool.js
Created August 7, 2019 11:11
A simple implementation of the Boyer-Moore string search algorithm for use with node.js' Buffer objects.
function boyerMooreHorspool( haystack, needle, start ) {
var nlen = needle.length
var hlen = haystack.length
if( nlen <= 0 || hlen <= 0 )
return -1
var jump, offset = start || 0
var scan = 0
@RaymondKroon
RaymondKroon / delete_all_object_versions.sh
Created May 15, 2017 20:54 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
for p in $(find . -name "*.shp"); do
f=${p##*/}
layer=${f%.*}
echo "file:$f -> $(ogrinfo $p $layer -so | grep PROJCS)"
done
@RaymondKroon
RaymondKroon / gpg2qrcodes.sh
Created April 11, 2016 15:50 — forked from joostrijneveld/gpg2qrcodes.sh
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@RaymondKroon
RaymondKroon / llvm-update-alternatives
Last active July 6, 2020 16:48 — forked from jc00ke/llvm-update-alternatives
LLVM & clang alternatives
#!/usr/bin/env sh
sudo update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.6 200 \
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.6 \
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.6 \
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.6 \
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.6 \
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.6 \
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.6 \
@RaymondKroon
RaymondKroon / ngrok-selfhosting-setup.md
Last active August 29, 2015 14:26 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems