Skip to content

Instantly share code, notes, and snippets.

Avatar
💯

Florian Wendelborn FlorianWendelborn

💯
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am FlorianWendelborn on github.
  • I am dodekeract (https://keybase.io/dodekeract) on keybase.
  • I have a public key whose fingerprint is A1E4 7ADC D550 DAE9 2337 7CF2 647E 95F1 6C71 B29F

To claim this, I am signing this object:

View shitty-rotation-hack.html
<html>
<head>
<title>Shitty Hack to Reverse Children in CSS Without Flex-Direction</title>
<style>
body {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
View replace-object-strings.ts
const replaceObjectStrings = <T extends object>(
data: T,
from: string | RegExp,
to: string
): T =>
Object.fromEntries(
Object.entries(data).map(([key, value]) => {
if (value === null) return [key, null]
switch (typeof value) {
@FlorianWendelborn
FlorianWendelborn / wtf-sliders.html
Created Oct 26, 2019
AFAIK, this is supposed to be impossible behvavior. Yet, all browsers seem to be affected.
View wtf-sliders.html
<html>
<head>
<!-- Any idea whatsoever why input.works works and input.wtf is completely
unstyled in firefox & chrome? Also, input.half-wtf works in Firefox, even
when swapping around the lines. -->
<style>
input {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
View mapGetters.ts
const mapBranchesGetter = <G extends keyof BranchesStore>(
getter: G
): BranchesStore[G] => {
return this.context.rootGetters[`branches/${getter}`]
}
const getBranch = mapBranchesGetter('getBranch')
const mapGetter = <S, G extends keyof S>(namespace: string, getter: string): S[G] => {
return this.context.rootGetters[`${namespace}/${getter}`]
}
@FlorianWendelborn
FlorianWendelborn / illuminati.js
Last active Dec 23, 2018
Exploiting https://button.mohsh.com to make the Illuminati the Top Country
View illuminati.js
#!/usr/bin/env node
const WebSocketClient = require('websocket').client
const attempt = () =>
new Promise((resolve, reject) => {
const client = new WebSocketClient()
client.on('connectFailed', error => {
console.log('Connect Error: ' + error.toString())
resolve()
View appointments.js
const appointments = [[100, 125], [200, 230], [230, 400]]
const requests = [[10, 50], [130, 210], [240, 250]]
const times = [[0]]
for (let i = 0; i < appointments.length; i++) {
const [ra, rb] = appointments[i]
const last = times[times.length - 1]
last[1] = ra
@FlorianWendelborn
FlorianWendelborn / retag.sh
Last active Oct 9, 2018
Adds a prefix/suffix to all existing git tags.
View retag.sh
#!/usr/bin/env bash
PREFIX="versions/my-app/"
SUFFIX=""
git tag -l | while read t; do
NEW_NAME="${PREFIX}${t}${SUFFIX}"
git tag $NEW_NAME $t
git tag -d $t
done
View monorepo-merge.md

Monorepo Merge

Assuming you have two git repositories monorepo, and my-project and want to add my-project to monorepo/projects/my-project:

cd my-project
git filter-branch --index-filter '
    git ls-files -s |
    sed "s,     ,&'"projects/my-project/"'," |
    GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info &&
View sort.js
someArray.sort(({ [key]: a }, { [key]: b }) => ((ascending ? a < b : a > b) ? 1 : -1))
You can’t perform that action at this time.