Skip to content

Instantly share code, notes, and snippets.

View cyrillkuettel's full-sized avatar

Cyrill Küttel cyrillkuettel

  • seantis
  • Switzerland
View GitHub Profile
@cyrillkuettel
cyrillkuettel / print_methods.py
Created January 10, 2023 10:18
Get all methods of object at runtime
def get_methods(object, spacing=20):
""" Convenience method to print all methods at runtime. """
method_list = []
for method_name in dir(object):
try:
if callable(getattr(object, method_name)):
method_list.append(str(method_name))
except Exception:
method_list.append(str(method_name))
process_func = (lambda s: ' '.join(s.split())) or (lambda s: s)

Java / elasticsearch

First, remove all existing java installations:

sudo apt-get purge openjdk-\*
sudo rm -rf /usr/lib/jvm/*

Install Java 8, same version as on build server:

# Xcode to Map Vim Keys

There is no built-in way to add custom key mappings in Xcode 13’s Vim Mode.

This is a workaround.

It depends on karabiner-elements.

@cyrillkuettel
cyrillkuettel / asvz_userscript_auto_load_more.js
Created November 7, 2024 21:23
ASVZ automatically fetch more results.
// ==UserScript==
// @name ASVZ Auto Load More
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically clicks "Mehr laden" button when it becomes visible. (This saves one button click, nothing more.)
// @author cyrillkuettel
// @match https://asvz.ch/426-sportfahrplan
// @grant none
// ==/UserScript==
#!/bin/bash
# Warning: Assumes /opt is used for installation dir
cd ~/Downloads
curl --location -o firefox.tar.gz "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US"
tar --extract --verbose --preserve-permissions -f firefox.tar.gz --use-compress-program=xz
INSTALL_DIR="/opt/firefox"