Skip to content

Instantly share code, notes, and snippets.

View Photonios's full-sized avatar

Swen Kooij Photonios

View GitHub Profile
@Photonios
Photonios / build-keycloak-15-macos-arm64.md
Created August 3, 2023 07:08
build-keycloak-15-macos-arm64

Upgrade frontend-maven-plugin

The version that Keycloak comes with doesn't know how to form URLs to download ARM64 distributions of Node. By upgrading it, it downloads the appropiate Node version built for ARM64.

diff --git a/themes/pom.xml b/themes/pom.xml
index 2502cbea7d..b09e5bac74 100755
--- a/themes/pom.xml
+++ b/themes/pom.xml
@@ -37,6 +37,7 @@
             <plugin>
@Photonios
Photonios / sync-repo-over-ssh.sh
Created April 10, 2019 08:58
Syncs Git repository over SSH in real time on macOS using rsync and fswatch
#!/usr/bin/env bash
source_dir=$1
dest_dir=$2
dest_host=$3
cd "$source_dir"
echo "* watching '$source_dir'"
@Photonios
Photonios / auto-enter-py-virtualenv.sh
Last active September 25, 2019 22:20
Auto-enter Python virtual environment.
# Finds a Python virtual environment in the current
# directory or any of its parents and enters it, or
# exits an virtual environment if we're in one
# but the current directory does not contain a virtualenv
function find_and_enter_virtualenv {
# See if the current directory, or any of its
# parents have a 'env/bin/activate' script
path=$(pwd)
while [ ! -z $path ]; do
if [ -f "$path/env/bin/activate" ]; then
@Photonios
Photonios / .gitconfig
Created August 2, 2016 10:24
My git aliases
[alias]
# Pretty log
lg = log --graph --oneline --decorate --date=relative --all
# Shows just the current branch, useful to use the output in other commands
# in case you don't wanna type the current branch name
cbranch = "!f() { git branch | grep '*' | cut -d' ' -f2; }; f"
# Force pushes the current branch
cpush = "!f() { git push origin `git cbranch` --force; }; f"
@Photonios
Photonios / add-copyright.py
Created August 1, 2016 06:55
Add copyright to a C++ file
@Photonios
Photonios / gist:ec95b67b5f4ed3ae0ca1
Created March 21, 2016 13:48 — forked from robindegen/gist:c37176036d9b4b64fde4
Export dependency tree based on CMake scripts
# CMakeGraphVizOptions.cmake
set(GRAPHVIZ_EXTERNAL_LIBS OFF)
set(GRAPHVIZ_IGNORE_TARGETS "[Tt]est")
cmake --graphviz=test.dot .
sfdp -Goverlap=ortho -Gsplines=true -n -Tpng test.dot 1>dependencies.png
@Photonios
Photonios / bus.sh
Created January 20, 2016 13:17
Pulls next few busses from ctpcj.ro
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: bus [bus line number]"
exit 1
fi
wget -qO- http://ctpcj.ro/orare/csv/orar_$1_lv.csv | cut -d , -f1 | grep --color=never : | grep `date +%H` -A 3 -B 3