Skip to content

Instantly share code, notes, and snippets.

View christian-korneck's full-sized avatar
💭
I may be slow to respond.

Christian Korneck christian-korneck

💭
I may be slow to respond.
View GitHub Profile
@christian-korneck
christian-korneck / README.md
Created February 14, 2022 19:42
R-Go Split Break - MacOS fixes

a config for Karabiner Elements, a MacOS keyboard mapper, that solves the following problem with the R-Go Split Keyboard (US/QWERTY) on MacOS:

  • Problem: key combinations only work on one half of the keyboard (i.e. [LEFT SHIFT]+ [A] works, but [RIGHT SHIFT] + [A] doesn't).
    • Solution: [Right Shift] <-> [Left Shift] swapped
  • Problem: Function (i.e. volume, etc) are mapped to the function keys
    • Solution: Function keys mapped to Function keys

More notes:

  • How to turn off blinking logo LED (top left) on the R-Go Split keyboard: press FN + A
@christian-korneck
christian-korneck / main.go
Created February 5, 2022 13:30
golang errors.As()
package main
import (
"errors"
"fmt"
"io/fs"
"os"
)
// output: Failed at path: non-existing
@christian-korneck
christian-korneck / bookmarklet.txt
Created January 16, 2022 10:17
ios bookmarklet - show page source
javascript:(function(){var a=window.open('about:blank').document;a.write('<!DOCTYPE html><html><head><title>Source of '+location.href+'</title><meta name="viewport" content="width=device-width" /></head><body></body></html>');a.close();var b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode(document.documentElement.innerHTML))})();
@christian-korneck
christian-korneck / cdk_s3_destroy.md
Created December 25, 2021 18:07
CDK - create destroyable S3 bucket

when creating a S3 bucket with CDK it is per default protected from getting deleted with cdk destroy.

To remove this protection for faster testing:

  • RemovalPolicy: awscdk.RemovalPolicy_DESTROY = destroy if empty
  • AutoDeleteObjects: jsii.Bool(true) = destroy even if not empty
package main
write installed packages to freeze file (here stdout):
```
brew bundle dump --file=-
```
install from freeze file:
```
brew bundle install --file=<f>
```
@christian-korneck
christian-korneck / README.md
Last active October 16, 2021 13:24
get aws account id
# get asws account id
aws sts get-caller-identity --query Account --output text

MacOS quicklook for unknown text files (qlstephen), code (qmcolorcode), markdown (qlmarkdown), etc

brew install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package apparency quicklookase qlvideo
xattr -d -r com.apple.quarantine ~/Library/QuickLook
qlmanage -r
killall Finder
/lib/ld-linux.so /bin/chmod +x /bin/chmod
{
"metadata": {
"name": "busybox"
},
"image":{
"image": "mcr.microsoft.com/windows/nanoserver:1809"
},
"command": [
"ping",
"-t",
@christian-korneck
christian-korneck / partial.go
Last active July 10, 2021 13:55 — forked from noamt/partial.go
Partial unmarshal for Medium post "Using Go's json.RawMessage"
contents := []byte(`
{
"key": "value",
"key2": "value2"
}
`)
type Custom struct {
Key string
Key2 json.RawMessage