Skip to content

Instantly share code, notes, and snippets.

View alexkli's full-sized avatar

Alexander Klimetschek alexkli

View GitHub Profile
@alexkli
alexkli / urlencode-readme.md
Last active February 23, 2024 02:03
urlencode

This runs a basic set of ASCII chars through standard url encode functions in Java and Fastly VCL.

Corresponding Fastly VCL Fiddle: https://fiddle.fastly.dev/fiddle/82e91fbd

Java encoded output:

%09+%21%22%23%24%25%26%27%28%29*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7EDEL%E2%82%AC%E2%80%9A%C6%92%E2%80%9E%E2%80%A6%E2%80%A0%E2%80%A1%CB%86%E2%80%B0%C5%A0%E2%80%B9%C5%92%C5%BD%E2%80%98%E2%80%99%E2%80%9C%E2%80%9D%E2%80%A2%E2%80%93%E2%80%94%CB%9C%E2%84%A2%C5%A1%E2%80%BA%C5%93%C5%BE%C5%B8%C2%A1%C2%A2%C2%A3%C2%A4%C2%A5%C2%A6%C2%A7%C2%A8%C2%A9%C2%AA%C2%AB%C2%ACSHY%C2%AE%C2%AF%C2%B0%C2%B1%C2%B2%C2%B3%C2%B4%C2%B5%C2%B6%C2%B7%C2%B8%C2%B9%C2%BA%C2%BB%C2%BC%C2%BD%C2%BE%C2%BF%C3%80%C3%81%C3%82%C3%83%C3%84%C3%85%C3%86%C3%87%C3%88%C3%89%C3%8A%C3%8B%C3%8C%C3%8D%C3%8E%C3%8F%C3%90%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%9B%C3%9C%C3%9D%C3%9E%C3%9F%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%A8%C3%A9%C3%AA%C3%AB%C3%
@alexkli
alexkli / trello-collapsible-list.md
Last active March 24, 2023 19:16
Trello collapsible list userscript (tested with Safari)

Trello does not support collapsing lists out of the box. There are different solutions such as an extension for Chrome. But nothing that works in Safari any more, as of March 2023, so I wrote my own user script.

Use this with the Userscripts extension for Safari.

It looks like this:

trello-collapsible-list-screenshot

Click on the ▼ icon to toggle the list.

@alexkli
alexkli / circleci-vars.md
Last active September 10, 2022 00:29
How to safely export CircleCI environment variables

How to safely export CircleCI environment variables

Steps with SSH

Connect to the job with ssh (use Rerun job with SSH) and then simply run env and copy&paste the vars.

Note: make sure you have a ssh key in your Github settings. If it's missing, CircleCI will silently fail to show the "Enable SSH" setting in the re-run.


@alexkli
alexkli / invokelocal.js
Last active August 11, 2018 01:04
serverless-openwhisk invoke local using docker for https://github.com/serverless/serverless-openwhisk/issues/119
'use strict';
const fs = require('fs');
const rw = require('rw');
const { spawn, execSync } = require('child_process');
const request = require('requestretry');
const OPENWHISK_DEFAULTS = {
// https://github.com/apache/incubator-openwhisk/blob/master/docs/reference.md#system-limits
@alexkli
alexkli / serverless-webpack-auto.js
Last active May 23, 2018 18:25
serverless-webpack automatic config and externals prototype https://github.com/serverless-heaven/serverless-webpack/issues/399
// prototype for https://github.com/serverless-heaven/serverless-webpack/issues/399
'use strict';
const fs = require('fs');
const webpackConfigFile = "webpack.config.js";
class OpenWhiskExtServerlessPlugin {
@alexkli
alexkli / oak-browse-tree.groovy
Last active March 12, 2022 15:42
Groovy script for displaying hidden Oak content structures
// --------------------------------------------------------------
// change these input values
// path: what oak path to show
def path = "/oak:index/nodetype/:index";
// depth: how deep the tree structure should be rendered
def depth = 2;
// --------------------------------------------------------------
@alexkli
alexkli / parse-replication-publish.sh
Last active July 29, 2021 09:16
Retrieving replication actions from AEM error.log
#!/bin/sh
# parses replication receive events from an AEM publish error.log or
# replication.log and outputs them in the format <action>,<path>
#
# example output:
# ACTIVATE,/content/dam/assets/foo
# DEACTIVATE,/content/some/page
grep -oh "/bin/receive.*Processed replication action.*" "$1" \
import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeStore
import org.apache.jackrabbit.oak.commons.PathUtils
def removeNodes(def session, String fileWithPaths) {
println "Reading paths from ${fileWithPaths}..."
new File(fileWithPaths).eachLine { path ->
println "Removing node ${path}"
@alexkli
alexkli / keybase.md
Created February 13, 2016 02:28
keybase.md

Keybase proof

I hereby claim:

  • I am alexkli on github.
  • I am alexkli (https://keybase.io/alexkli) on keybase.
  • I have a public key whose fingerprint is 9513 7F5C 6E62 56D8 9FE9 E2F1 804F 627B 2D1B D1A0

To claim this, I am signing this object:

#!/usr/bin/python
# CLI program to control the mediakeys on OS X. Used to emulate the mediakey on a keyboard with no such keys.
# Easiest used in combination with a launcher/trigger software such as Quicksilver.
# Main part taken from http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac
# Glue to make it into cli program by Fredrik Wallner http://www.wallner.nu/fredrik/
import Quartz
import sys