Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Legner simon04

  • Innsbruck, Austria
View GitHub Profile
@simon04
simon04 / JwtAuthenticator.java
Created Dec 30, 2021
Jetty Authenticator for JWT/JWKS
View JwtAuthenticator.java
package at.tbbm.manual_input.util;
import com.auth0.jwk.Jwk;
import com.auth0.jwk.JwkException;
import com.auth0.jwk.JwkProvider;
import com.auth0.jwk.UrlJwkProvider;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.DecodedJWT;
@simon04
simon04 / README.md
Created Dec 7, 2021
IntelliJ IDEA // external tools // javap
View README.md
@simon04
simon04 / README.md
Last active Dec 7, 2021
IntelliJ IDEA // external tools // oxipng
View README.md
@simon04
simon04 / index.html
Created Jun 9, 2021
Leaflet example using JavaScript modules
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
/>
</head>
@simon04
simon04 / fontAwesome.ts
Last active Jun 11, 2021
Font Awesome directive for Angular.js 1.x
View fontAwesome.ts
import angular from 'angular';
import fontawesome from '@fortawesome/fontawesome-svg-core';
import {faPrint} from '@fortawesome/free-solid-svg-icons/faPrint';
import {faSearch} from '@fortawesome/free-solid-svg-icons/faSearch';
fontawesome.library.add(faPrint, faSearch);
function directive(): ng.IDirective {
return {
restrict: 'E',
View MacBook Air.md
> neofetch
                    c.'          simon@simon-mac 
                 ,xNMM.          --------------- 
               .OMMMMo           OS: macOS Monterey 12.3 21E230 x86_64 
               lMM"              Host: MacBookAir10,1 
     .;loddo:.  .olloddol;.      Kernel: 21.4.0 
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Packages: 242 (brew), 48 (nix-user) 
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Shell: fish 3.4.1 
 XMMMMMMMMMMMMMMMMMMMMMMMX. Resolution: 2560x1600 , 3440x1440 @ -Hz 
@simon04
simon04 / JwtTest.java
Created Feb 10, 2021
Configure RSA512 algorithm for com.auth0.jwt.JWT using an RSA private/public key generated by openssl
View JwtTest.java
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import org.bouncycastle.util.io.pem.PemReader;
import org.junit.Test;
import java.io.BufferedReader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.interfaces.RSAPrivateKey;
@simon04
simon04 / README.md
Created Aug 21, 2020
Java URI copy constructor
View README.md

Using the URI copy constructor on an URI where the userinfo part contains a percent-escaped colon (U+003A as %3A) produces a different result.

View docker-compose.yml
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
@simon04
simon04 / t.js
Created Aug 12, 2020
Minimalistic i18n for JavaScript
View t.js
var i18nMessages = {};
["en", "de", "it"].forEach(function (lang) {
jQuery.ajax({
url: "./i18n/" + lang + ".json",
dataType: 'json',
async: false,
success: function (data) {
i18nMessages[lang] = data;
}
})