Skip to content

Instantly share code, notes, and snippets.

@BaksiLi
BaksiLi / install_zellij.sh
Created August 9, 2023 10:48
Install Zellij (latest release) on Linux (incl. Ubuntu) and Darwin
#!/bin/bash
# Get the architecture of the machine
arch=$(uname -m)
os=$(uname -s)
# Download the Zellij binary
if [ "$os" == "Darwin" ]; then
filename="zellij-${arch}-apple-darwin.tar.gz"
url="https://github.com/zellij-org/zellij/releases/latest/download/$filename"
@itowlson
itowlson / Cargo.toml
Created June 21, 2023 21:18
Code for minimal Spin embedding sample
[package]
name = "spinhost"
version = "0.1.0"
edition = "2021"
[dependencies]
# Spin runtime
spin-app = { git = "https://github.com/fermyon/spin", tag = "v1.3.0" }
spin-core = { git = "https://github.com/fermyon/spin", tag = "v1.3.0" }
spin-oci = { git = "https://github.com/fermyon/spin", tag = "v1.3.0" }
@VictorTaelin
VictorTaelin / implementing_fft.md
Last active July 3, 2025 14:29
Implementing complex numbers and FFT with just datatypes (no floats)

Implementing complex numbers and FFT with just datatypes (no floats)

In this article, I'll explain why implementing numbers with just algebraic datatypes is desirable. I'll then talk about common implementations of FFT (Fast Fourier Transform) and why they hide inherent inefficiencies. I'll then show how to implement integers and complex numbers with just algebraic datatypes, in a way that is extremely simple and elegant. I'll conclude by deriving a pure functional implementation of complex FFT with just datatypes, no floats.

@VictorTaelin
VictorTaelin / FFT.hvm
Last active May 4, 2023 02:05
fast fourier transform using only integers on HVM
(Rot (V z)) = (V (- 0.0 z))
(Rot (G x y)) = (G (Rot y) x)
(Add (V z) (V w)) = (V (+ z w))
(Add (G x y) (G w z)) = (G (Add x w) (Add y z))
(Get (V x) f) = (f x)
(Get (G x y) f) = (f x y)
Nil = λm λx (m x)
Flip (n: Nat) : Nat
Flip Nat.zero = 1n
Flip (Nat.succ Nat.zero) = 0n
Mod2 (n: Nat) : Nat
Mod2 Nat.zero = Nat.zero
Mod2 (Nat.succ n) = Flip (Mod2 n)
IsEven (n: Nat) : Type
IsEven Nat.zero = Unit
@LukeMathWalker
LukeMathWalker / audit.yml
Last active June 26, 2025 08:17
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@PurpleBooth
PurpleBooth / README.md
Last active September 8, 2023 20:52
A github workflow pipeline for rust that does test, build and deploy windows, linux and mac, creates releases, and does SemVer Versioning, and releases to a homebrew tap

Features

  • Automatically bump SemVer
  • Update a personal homebrew tap
  • Keep that pesky version in the Cargo.toml up to date
  • (From dependabot) Get new versions out as soon as possible

Assumptions

  • You don't want a changelog
@Pilotin
Pilotin / tailwindcss-postcss-autoprefixer-cssnano.md
Last active February 25, 2025 13:36
TailwindCSS + PostCSS + AutoPrefixer + CSS Nano Install

Setup

  • Create new working folder /tailwind/. Open in terminal
  • run npm init -y
  • run npm install tailwindcss @tailwindcss/custom-forms postcss-cli autoprefixer postcss-nested cssnano
  • run npx tailwind init
  • Edit tailwind.config.js and replace plugins: [], with:
plugins: [
@Boscop
Boscop / Delete Subword Backward.sublime-macro
Created March 10, 2020 07:53 — forked from Schlechtwetterfront/Delete Subword Backward.sublime-macro
Subword Delete Macros for Sublime Text. Similar to alt+delete/ alt+backspace in other software packages.
// Delete Backward.
// Put this into your user packages folder. Can be found by navigating to Preferences > Browse Packages... in Sublime Text.
// Then add something like this to your user Key Bindings.
// { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/User/Delete Subword Backward.sublime-macro"} }
[
{
"args":
{
"by": "subwords",
"extend": true,
@tbjgolden
tbjgolden / bitwardenTidy.js
Last active December 30, 2022 23:57
Import bitwarden export json, interactive deduplicate and export bitwarden import json
const fs = require('fs');
const path = require('path');
const inquirer = require('inquirer');
const uuidv4 = require('uuid/v4');
const owasp = require('owasp-password-strength-test');
const words = new Set([...require('wordlist-english')['english/10'], ...require('wordlist-english')['english/20']]);
const thingsIDontDoAnyMore = require("./thingsIDontDoAnyMore.json");
const { items } = require('./bitwarden_export_file.json');