Skip to content

Instantly share code, notes, and snippets.

View LuxXx's full-sized avatar

David LuxXx

View GitHub Profile
@LuxXx
LuxXx / test.ts
Created August 14, 2023 22:25
exhausting switch
View test.ts
type Book = "dune" | "snowcrash" | "dune2"
const b: Book = Math.random() > 0.5 ? "dune" : "snowcrash"
function f() {
switch (b) {
case "dune":
return 0
case "snowcrash":
return 0
@LuxXx
LuxXx / test.vtl
Created March 3, 2021 18:28
ElasticSearch to Meldung map
View test.vtl
#set($inputRoot = $input.path('$'))
[
#foreach($elem in $inputRoot.hits.hits)
{
"titel": "$util.escapeJavaScript($elem.get("_source").titel).replaceAll("\\'","'")",
"vorname": "$util.escapeJavaScript($elem.get("_source").vorname).replaceAll("\\'","'")",
"nachname": "$util.escapeJavaScript($elem.get("_source").nachname).replaceAll("\\'","'")",
"name": "$util.escapeJavaScript($elem.get("_source").name).replaceAll("\\'","'")",
"position": "$util.escapeJavaScript($elem.get("_source").position).replaceAll("\\'","'")",
"is_company": $util.escapeJavaScript($elem.get("_source").is_company).replaceAll("\\'","'"),
@LuxXx
LuxXx / PCASVDComp.ipynb
Last active January 22, 2021 01:58
PCA SVD Compression
View PCASVDComp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / LinMapping.ipynb
Created December 1, 2020 12:45
Linear Mapping Animation
View LinMapping.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / noerw.ipynb
Created November 12, 2020 00:28
Nicht existierende Momente
View noerw.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / MetropolisHastings.ipynb
Created October 27, 2020 12:25
Metropolis Hastings Algorithm
View MetropolisHastings.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / LinearesModell.ipynb
Last active August 20, 2020 16:57
Lineares Modell in numpy
View LinearesModell.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / LinearModel.ipynb
Created August 20, 2020 10:14
Linear Regression with sympy
View LinearModel.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / IstanbulGame.ipynb
Created August 13, 2020 09:02
Istanbul Game Random Mechanic
View IstanbulGame.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LuxXx
LuxXx / bedrock.c
Created August 2, 2020 11:46
2b2t Bedrock Finder by ChromeCrusher
View bedrock.c
/*
Written by ChromeCrusher for finding bases on 2b2t.org
This program requires you to know a top-level bedrock pattern.
A chunk-aligned 16x16 pattern (a complete chunk) is preferable and is the fastest method, but it can find any smaller pattern too (it just takes longer)
You could technically search for an area larger than 16x16 (up to 48x48), but it will be slower and the chances of finding two identical 16x16 bedrock patterns is basically zero.
An 8x8 pattern is usually enough to uniquely identify a location with a fairly low chance of false positives.
You'll need to know which direction is north. This can be found by looking at the textures of some blocks (cobblestone for example, see http://gaming.stackexchange.com/a/23103)
If you can't find which direction is north, you'll have to search for all 4 rotations of the pattern separately. I did not include a function to do it automatically because I haven't needed it.