Skip to content

Instantly share code, notes, and snippets.

View Typiqally's full-sized avatar

Jelle Maas Typiqally

View GitHub Profile
@Typiqally
Typiqally / OrientationCube.tsx
Last active April 17, 2024 15:05
OrientationCube for React and TailwindCSS, can be used with Three.js easily
/* Example usage
const [rotationMatrix, setRotationMatrix] = useState<number[]>(new Array(16).fill(0));
<OrientationCube
sizeInPixels={64}
rotationMatrix={rotationMatrix}
/>
setRotationMatrix(camera.matrixWorldInverse.clone().elements);
*/
@Typiqally
Typiqally / aspnetcore-vite.js
Created March 16, 2023 08:59
ASP.NET Core + Vite, HTTPS proxy configuration
// This script configures the .env.development.local file with additional environment variables to configure HTTPS using the ASP.NET Core
// development certificate in the webpack development proxy.
import fs from "fs";
import path from "path";
const baseFolder =
process.env.APPDATA !== undefined && process.env.APPDATA !== ''
? `${process.env.APPDATA}/ASP.NET/https`
: `${process.env.HOME}/.aspnet/https`;
@Typiqally
Typiqally / simd+HamardProduct.swift
Created December 5, 2022 13:34
Hadamard product implementation using simd matrices written in Swift
//
// PlantMorphology
//
// Created by Jelle Maas on 05/12/2022.
//
import Foundation
import simd
// Extension functions for vDSP implementing the hadamard product operation for matrices
@ExperimentalUnsignedTypes
fun main() {
val aes = AES()
val bondingKey = "83 69 6c e4 44 fa b0 f1 0b f6 17 af 58 2e 3f e4 54 34 16 36 4c 76 de e7 2c 43 dd 8a 63 ac 0f 49".decodeHex()
println("Bonding key: ${bondingKey.contentToString()}")
val bondingKeyIv = "16 64 ef 48 03 58 ca 84 3c 82 e2 54 6f ff 49 28".decodeHex()
val secretKey = DeviceKey().create("B8:8E:82:3A:17:CB")
println("Secret key (${secretKey.size}): ${secretKey.contentToString()}")
winget uninstall "windows web experience pack"
Get-AppxPackage * | Remove-AppxPackage
@Typiqally
Typiqally / drawio_mime_type.sh
Created November 23, 2021 21:24 — forked from giner/drawio_mime_type.sh
Give *.drawio files MIME type to make application association work
#!/bin/sh
# drawio.xml is taken from Draw.io debian package
cat > ~/.local/share/mime/packages/drawio.xml << 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.jgraph.mxfile">
<glob pattern="*.drawio"/>
<comment>draw.io Diagram</comment>
<icon name="x-office-document" />
@Typiqally
Typiqally / dotnet-uninstall.sh
Created October 28, 2021 17:48
Uninstall .NET SDK and runtimes
version="6.0.0-rc.1"
rm -rf ~/.dotnet/$version*
rm -rf ~/.dotnet/sdk/$version*
rm -rf ~/.dotnet/shared/Microsoft.NETCore.App/$version*
rm -rf ~/.dotnet/shared/Microsoft.AspNetCore.All/$version*
rm -rf ~/.dotnet/shared/Microsoft.AspNetCore.App/$version*
rm -rf ~/.dotnet/host/fxr/$version*
[Unit]
Description=MEGAcmd server
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
ExecStart=/usr/bin/mega-cmd-server
@Typiqally
Typiqally / post-receive
Created September 1, 2021 10:30
Git server deployment post-receive hook
#!/bin/sh
set -eu
NAME="maastelecom"
SERVICE="kestrel-$NAME"
GIT_DIRECTORY="/home/deploy/$NAME.git"
WORK_TREE="/home/deploy/$NAME"
OUTPUT_DIRECTORY="/var/www/$NAME"
BRANCH="master"
@Typiqally
Typiqally / update-unifi.sh
Last active March 15, 2022 17:58
UniFi controller update script
#! /bin/bash
colour='\033[1;32m'
less='\033[0m'
read -p "Please enter a STABLE version or press enter for version 7.0.23: " version
if [[ -z "$version" ]]; then
version='7.0.23'
fi