Skip to content

Instantly share code, notes, and snippets.

View dk5ax's full-sized avatar
🏠

Markus Hammelmann dk5ax

🏠
View GitHub Profile
@dk5ax
dk5ax / code100_hny2024.js
Last active January 4, 2024 13:29
Code100 HNY 2024 edition
// Sample solution for the following Code100 task:
// https://gist.github.com/codepo8/0c671bfebd4d3ab38e222c5fc247d819?utm_medium=email&_hsmi=288717159&utm_content=288717159&utm_source=hs_email
const input = [
0,0,0,121,231,143,195,118,216,195,54,223,195,182,216,121,231,
143,0,0,0,3,15,30,97,155,183,49,153,179,1,157,187,3,207,30,0,0,0
];
const toBin = value => (value >>> 0).toString(2).padStart(8, '0').split('').map(c => (c === '1') ? '😄' : '🍾').join('');
@dk5ax
dk5ax / code100_20231109.js
Created November 9, 2023 09:18
Code 100 2023-11-09
// Based on: https://gist.github.com/codepo8/31b9ad820c03916941c294c404831829
const input = {
"cols": 30,
"sine": [
"-0.93", "-0.60", "-0.33", "-0.13", "0.00",
"0.00", "-0.13", "-0.33", "-0.60", "-0.93"
],
"parts": ["💻", "💖"]
};
const input = {
"columns": 80,
"padChar": "·",
"events": [
{ "name": "Code 100", "location": "Zagreb, Croatia", "date": "29.11.2023" },
{ "name": "LIVE", "date": "ongoing" },
{ "name": "Coffee With Developers", "location": "various", "date": "ongoing"} ,
{ "name": "World Congress","location": "Berlin, Germany", "date":"17-19.07.2024" }
]
};
@dk5ax
dk5ax / keycloak_create_realm_and_client.sh
Created October 8, 2023 14:49 — forked from lukaszbudnik/keycloak_create_realm_and_client.sh
youtube.com - Keycloak Multi-Tenant JavaScript Clients
# don't forget to update below variables to point to your Keycloak instance, main realm, and admin user
export KEYCLOAK_URL="http://localhost:8080"
export KEYCLOAK_MAIN_REALM=master
export KEYCLOAK_USER=lb
export KEYCLOAK_PASSWORD=***
# get the access token
access_token=$(curl --silent \
-d "client_id=admin-cli" \
-d "username=$KEYCLOAK_USER" \
@dk5ax
dk5ax / bfs.js
Created March 4, 2022 07:20 — forked from tksilicon/bfs.js
// Get the queue from https://github.com/swarup260/Learning_Algorithms/blob/master/data_structure/Queue.js
const { Queue } = require('./queue.js')
let graphAdj;
var visited;
let queue;
const initGraph = (maxVertice) => {
visited = new Array(maxVertice);