Skip to content

Instantly share code, notes, and snippets.

View sebastianrothbucher's full-sized avatar

Sebastian Rothbucher sebastianrothbucher

View GitHub Profile
I have the prod01 skates already - now can you get me more rolls for that?
@sebastianrothbucher
sebastianrothbucher / 01-schema.graphqls
Created November 12, 2023 11:09
Appsync dynamodb JS
type ItemsResponse {
listid: ID!
items: [ListItem]
}
type ListItem {
listid: ID!
ts_uuid: ID!
title: String!
done: Boolean!
@sebastianrothbucher
sebastianrothbucher / Application.java
Last active November 11, 2023 18:41
JAMstack with Keycloak and Boot
// ...
@Autowired
private JwtAuthFilter jwtAuthFilter;
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.addFilterBefore(jwtAuthFilter, UsernamePasswordAuthenticationFilter.class)
// ...
return http.build();
@sebastianrothbucher
sebastianrothbucher / fetch-override.js
Last active November 11, 2023 16:40
Track fetch API for more stable tests
const __legacyFetch = window.fetch;
let __openFetchPromises = 0;
let __waitForFetchPromise = Promise.resolve();
let __waitForFetchResolve = null;
// need a function to instrument promise-ified methods from fetch down
function __instrumentPromise(legacyThis, legacyFct, legacyFctName) {
return function() {
if (__openFetchPromises === 0) {
__waitForFetchPromise = new Promise(resolve => __waitForFetchResolve = resolve);
@sebastianrothbucher
sebastianrothbucher / fix.sh
Created November 8, 2023 07:47
Fix delta-rs
find . -name '00000*.json' | xargs gsed -i 's/"partitionBy":\[\]/"partitionBy":"\[\]"/g'
@sebastianrothbucher
sebastianrothbucher / lime.R
Last active December 6, 2020 11:30
Explaining nnet with LIME (and SHAP)
library(lime)
library(datasets)
library(nnet)
library(caret)
#View(iris)
train_index <- sample(1:nrow(iris), 0.8 * nrow(iris))
test_index <- setdiff(1:nrow(iris), train_index)
iris_net <- nnet(Species~., data = iris[train_index,], size = 20)
test_pred <- predict(iris_net, iris[test_index, c(1:4)], type = 'class')
test_conf <- confusionMatrix(factor(test_pred), iris$Species[test_index], mode = 'prec_recall')
@sebastianrothbucher
sebastianrothbucher / index.html
Created January 12, 2020 16:59
interactive effect
<button onclick="clck()">click me!</button>
@sebastianrothbucher
sebastianrothbucher / index.js
Last active December 7, 2019 12:45
Vue-SSR edge cases
// Step 1: Create a Vue instance
const Vue = require('../vue/dist/vue.runtime.common.dev');
const app = require('./vue/app');
// Step 2: Create a renderer
const rendererFactory = require('../vue/packages/vue-server-renderer/build.dev');
const renderer=rendererFactory.createRenderer();
// Step 3a: Render the Vue instance to HTML
let renderedHtml = null;
@sebastianrothbucher
sebastianrothbucher / button-styles-vert-gradient-flex.markdown
Created September 4, 2019 05:36
button-styles vert gradient flex
@sebastianrothbucher
sebastianrothbucher / index.html
Last active September 4, 2019 05:38
vue-replace-static
<div id="rootDiv">
<div v-if="!loaded">Content from Server</div>
<test-comp v-if="loaded"></test-comp><!-- do NOT shorthand, vue does swallow the rest of rootDiv then -->
<test-bt><button>from Server</button></test-bt>
<div v-text="vueText">Text from Server</div>
</div>
<br /><br />
<button onclick="igniteVue()">Go, vue!</button> (normally on load)