Skip to content

Instantly share code, notes, and snippets.

View fernanfs's full-sized avatar

Francois Fernandes fernanfs

  • ING DiBa AG
  • Germany
View GitHub Profile
@fernanfs
fernanfs / fixme.kt
Created April 22, 2022 20:06
The FIXME that will actually be fixed one day.
fun FIXME(reason: String) {
val callStack = Thread.currentThread().stackTrace
.filter { stackTraceElement -> stackTraceElement.methodName != "FIXME" && (stackTraceElement.className != "java.lang.Thread" && stackTraceElement.methodName != "getStackTrace") }
.take(4)
.joinToString(separator = "\n") { stackTraceElement -> " at $stackTraceElement" }
System.err.println("FIXME: $reason\ncallstack:\n$callStack")
}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: digitalfrontiers-sample-ingress
spec:
rules:
- host: sample-service.example.com
http:
paths:
- path: /
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="MY_SSID"
psk="SOME_AMAZING_SECURE_PASSWORD"
key_mgmt=WPA-PSK
}
# download the docker installation script
curl -fsSL https://get.docker.com -o get-docker.sh
# I prefer to have a brief look at the contents of such scripts
# this is optional - as long as you trust the source
# vim get-docker.sh
# finally run the installation
chmod +x get-docker.sh
./get-docker.sh
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.levigo</groupId>
<artifactId>junit5-playground</artifactId>
<version>1.0-SNAPSHOT</version>
@fernanfs
fernanfs / ConfigurationContextListener.java
Last active August 29, 2015 14:08
Print a jadice web toolkit document using server side printing.
/**
* Configuration context listener which registers the PrintDocumentServerTransaction within the jadice web toolkit.
*/
public class ConfigurationContextListener extends WebtoolkitServletContextListener {
@Override
protected void contextInitialized(ServletContextEvent sce, WebtoolkitServerContext webtoolkitContext) {
// ...
@fernanfs
fernanfs / ListInstalledPrintservices.java
Created October 29, 2014 11:29
Listing all available print services
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
public class ListInstalledPrintservices {
public static void main(String[] args) {
for (PrintService service : PrintServiceLookup.lookupPrintServices(null, null)) {