Skip to content

Instantly share code, notes, and snippets.

@ChrisTollefson
ChrisTollefson / bash_startup_files.md
Last active May 5, 2024 19:28
Bash Startup Files

Bash Startup Files

def slerp(t, v0, v1, DOT_THRESHOLD=0.9995):
'''
Spherical linear interpolation
Args:
t (float/np.ndarray): Float value between 0.0 and 1.0
v0 (np.ndarray): Starting vector
v1 (np.ndarray): Final vector
DOT_THRESHOLD (float): Threshold for considering the two vectors as
colineal. Not recommended to alter this.
Returns:
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 19:25
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@kupietools
kupietools / Docker Desktop v 4.0.0 thru 4.22.1 direct download links
Last active May 5, 2024 19:23
List of Direct Download links for Docker Desktop from version 4.0.0 released 2021-08-31 thru 4.22.1 released 2023-08-24, as archived on archive.org
@jozefg
jozefg / closconv.lhs
Last active May 5, 2024 19:23
Tutorial on Closure Conversion and Lambda Lifting
This is my short-ish tutorial on how to implement closures in
a simple functional language: Foo.
First, some boilerplate.
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-}
> import Control.Applicative
> import Control.Monad.Gen
> import Control.Monad.Writer
> import Data.Functor.Foldable
@dominictarr
dominictarr / await.js
Last active May 5, 2024 19:23
wasm zig async example
const fs = require('fs');
const source = fs.readFileSync("./await2.wasm");
const typedArray = new Uint8Array(source);
;(async function () {
var callback, frame
var buffer = Buffer.from("hello world!!!\n")
var result = await WebAssembly.instantiate(typedArray, {
env: {
print: function (ptr, len) {
@jerome-labidurie
jerome-labidurie / HALegoTrain.ino
Last active May 5, 2024 19:21
Lego PoweredUp control from HomeAssistantt
/**
* Lego (Powered Up) train control from Home Assistant / MQTT with BellRing
*
* Licence: GPLv3
*
* needed libraries:
* legoino https://github.com/corneliusmunz/legoino
* > 1.1.0, tested with commit 4daae4f683b087b8c443a4c813934e3dfff41d69
* home-assistant-integration https://github.com/dawidchyrzynski/arduino-home-assistant
* 1.3.0
@mahdyar
mahdyar / AllowedUsername.php
Last active May 5, 2024 19:18
Prevent your users to register with your route paths like login, or reserved usernames as their usernames in Laravel. More: https://blog.mahdyar.me/2021/04/18/route-paths-and-reserved-usernames-in-laravel/
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Route;
class AllowedUsername implements Rule
{
/**
@9to5IT
9to5IT / Get-RDM.ps1
Last active May 5, 2024 19:18
PowerShell: Searching for RDM disks using PowerCLI
#requires -version 4
<#
.SYNOPSIS
Seaches for an RDM with the specified LUN ID.
.DESCRIPTION
Searches the vCenter environment to find the Virtual Machine that has an RDM configured with a particular LUN ID.
.PARAMETER None
@9to5IT
9to5IT / Set-HostSNMP.ps1
Created June 7, 2016 13:03
PowerShell: Configure SNMP on an ESXi Host
#requires -version 4
<#
.SYNOPSIS
Configure SNMP Settings on ESXi Hosts
.DESCRIPTION
Connect to vCenter Server and configure all ESXi hosts with SNMP settings
.PARAMETER None