Skip to content

Instantly share code, notes, and snippets.

View Klowner's full-sized avatar
🤡
total bozo

Mark Riedesel Klowner

🤡
total bozo
View GitHub Profile
# Klowner's SkeletonIK FABRIK solver
# Copyright (C) 2025 Mark Riedesel
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@tool
extends Node
class_name SimpleSkeletonIK3D
var selected_bone_indices: PackedInt32Array
var bones := []
var bone_chain_length: float
var bone_lengths: PackedFloat32Array
var bone_origins: PackedVector3Array
var bone_directions: PackedVector3Array
@Klowner
Klowner / journal
Created February 29, 2024 19:47
Simple command line daily journaling script
#!/usr/bin/env sh
# Journal by Mark Riedesel
set -e
SCRIPT_DIR="$( cd "$(dirname $0)" &> /dev/null && pwd )"
EDITOR=${EDITOR:-nvim}
ENTRY_SUBDIR="entries"
ENTRY_DIR="${SCRIPT_DIR}/${ENTRY_SUBDIR}"
type NewProjectRecord = Omit<Partial<ProjectRecord>, 'id'>;
type DeletableProjectRecord = Pick<ProjectRecord, 'id'>;
export class ProjectsContext {
constructor(private service: ProjectService) {}
private readonly remoteRefresh$ = new BehaviorSubject<void>(null);
private readonly create$ = new Subject<NewProjectRecord>();
private readonly delete$ = new Subject<DeletableProjectRecord>();
export class AuthService {
private readonly createRequest: AjaxCreationMethod = this.config.createRequest;
private readonly refreshToken$ = this.refreshToken();
constructor(private readonly config: AuthServiceConfig) {}
authenticate(username: string, password: string): Observable<AjaxResponse> {
return this.createRequest({
url: '/account/login',
method: 'POST',
// (C) 2018 Mark Riedesel <[email protected]>
// http://sensible.website/posts/serializing-tasks-with-c++-metaprogramming/
// The following code is licensed under the MIT license.
#include <cstdint>
#include <cstring>
#include <iostream>
using CommandId = uint16_t;
@Klowner
Klowner / lockjob.cpp
Last active September 29, 2017 02:53
Lock-free C++ single producer job scheduler thing that probably is secretly broken
#include <mutex>
#include <thread>
#include <vector>
#include <iostream>
#include <atomic>
class Scheduler
{
public:
@Klowner
Klowner / autossh
Created May 23, 2017 17:01
autossh connection with openrc
#!/sbin/openrc-run
name=$RC_SVCNAME
command="/usr/bin/autossh"
pidfile="/run/${RC_SVCNAME}.pid"
AUTOSSH_LOGFILE="${AUTOSSH_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
start_stop_daemon_args="-e AUTOSSH_PIDFILE=\"${pidfile}\" -e AUTOSSH_LOGFILE=\"${AUTOSSH_LOGFILE}\""
command_args="-M 10984 -N -f -o 'PubkeyAuthentication=yes' -o 'PasswordAuthentication=no' \
-i /root/.ssh/id_rsa -R 6666:localhost:22 middleman@middleman"
#include <iostream>
#include <string>
#include <vector>
#define DEF(_name_) _name_,
typedef enum {
#include "types_defs.h"
MAX_TYPES,
} Types;
@Klowner
Klowner / xinput-automatrix.sh
Last active February 27, 2020 23:00
A short script for auto calculating and setting an xinput coordinate transform matrix
#!/bin/sh
#
# Automatically calculate and set xinput coordinate transformation matrix
# for all matching devices listed in DEVICES array
#
# usage:
# ./xinput-automatrix.sh
#
# Mark Riedesel <[email protected]>
#