Skip to content

Instantly share code, notes, and snippets.

from typing import List, Set
import logging
from superset.security import SupersetSecurityManager
log = logging.getLogger(__name__)
class KeycloakSecurityManager(SupersetSecurityManager):
def oauth_user_info(self, provider, resp):
import pprint
#!/usr/bin/env bash
decode_base64() {
echo -n "$1" | tr -d - | tr _ / | base64 -d 2>/dev/null
}
IFS='.' read header payload signature <&0
echo $(decode_base64 $header)
echo $(decode_base64 $payload)
@ragnard
ragnard / routify-breadcrumds.md
Last active March 4, 2021 12:08
Routify Breadcrumbs

Scenario

Let's say I have something like this:

src/pages/foo/index.svelte

  • a page listing some foos
(Thread. (reify Runnable
(run [] (println "Running!"))))
@ragnard
ragnard / JavaFX.java
Last active October 10, 2017 18:51
Clojure and static class initialization
import javafx.scene.control.Cell;
public class JavaFX {
public static Class f() {
return Cell.class;
}
}
@ragnard
ragnard / gist:94e5838c860e80ec97b00dff95510395
Created August 28, 2017 12:55
ImageSingletons do not contain key com.oracle.svm.graal.GraalSupport
$ ~/projects/graalvm/graalvm-0.27/bin/native-image -cp com.github.ragnard.shentruffle.klambda/target/classes:com.github.ragnard.shentruffle.shen/target/classes com.github.ragnard.shentruffle.KLambda
classlist: 1,761.15 ms
(cap): 960.01 ms
setup: 1,509.68 ms
analysis: 2,407.04 ms
fatal error: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.svm.core.util.UserError$UserException: ImageSingletons do not contain key com.oracle.svm.graal.GraalSupport
at parsing com.oracle.svm.graal.GraalSupport.get(GraalSupport.java:235)
at org.graalvm.compiler.java.BytecodeParser.asParserError(BytecodeParser.java:2157)
at org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:2840)
at org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:2659)
@ragnard
ragnard / count-down.lisp
Last active August 17, 2017 13:27
tail recursion
(defun count-down (n)
(if (= n 0)
done
(count-down (- n 1))))
(count-down 1000000)
(count-down 1000000)
(count-down 1000000)
(count-down 1000000)
(count-down 1000000)
@ragnard
ragnard / shen-truffle.log
Created August 16, 2017 20:21
shen-truffle
$ ./scripts/shen-truffle
Loading toplevel.kl
Loading core.kl
Loading sys.kl
Loading sequent.kl
Loading yacc.kl
Loading reader.kl
Loading prolog.kl
Loading track.kl
Loading load.kl
$ mvn compile
...
$ ./scripts/kl --dump < tests/kl/count-down.kl
@ragnard
ragnard / count-down.lisp
Last active August 15, 2017 16:30
klambda recursion
(defun count-down (N)
(if (= N 0)
done
(count-down (- N 1))))