Skip to content

Instantly share code, notes, and snippets.

View 5HT's full-sized avatar
🌐
I'm very skeptical that person without empathy can create beautiful mathematics.

Namdak Tonpa 5HT

🌐
I'm very skeptical that person without empathy can create beautiful mathematics.
View GitHub Profile

DX7

image

Note: One of the algorithms is incorrect due to a missing operator. Need to update the image. Will have to get on that soon.

These are the original 32 algorithms as used in Yamaha DX7.

The later Yamaha FS1R and Yamaha SY77 may have compatibility with these algorithms, but that's beyond the current scope. The FS1R contains 88 algorithms, while the SY77 contains 45 algorithms.

@esmolanka
esmolanka / natMaybeEq.ctt
Created October 22, 2017 21:50
nat = fix maybe
import prelude
import equiv
data nat
= zero
| suc (n : nat)
data fix (f : U -> U) = mk (x : f (fix f))
data maybe (A : U)
@lexi-lambda
lexi-lambda / Main.hs
Last active December 21, 2024 10:20
Minimal Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.HigherRank.Main
( Expr(..)
, EVar(..)
, Type(..)
, TVar(..)
, TEVar(..)
, runInfer
) where
@useronym
useronym / Topology.agda
Last active May 20, 2020 08:00 — forked from copumpkin/Topology.agda
Topology!
module Topology where
import Level
open import Function
open import Data.Empty
open import Data.Unit
open import Data.Nat hiding (_⊔_)
open import Data.Fin
open import Data.Product
open import Relation.Nullary
@quetz
quetz / norm.c
Created February 17, 2017 18:13
path normalizer, ugly c
char *normalize(char *src) {
char *r = (char *)(malloc(strlen(src)+2));
char *dst = r;
if (*src != '/') {
*dst++ = '/';
}
char *bt = dst;
char *bt2 = dst;
int dot = 0;
while (*src) {
@gelisam
gelisam / Main.agda
Last active September 2, 2024 13:20
cat in Agda using copatterns
{-# OPTIONS --copatterns #-}
module Main where
-- A simple cat program which echoes stdin back to stdout, but implemented using copatterns
-- instead of musical notation, as requested by Miëtek Bak (https://twitter.com/mietek/status/806314271747481600).
open import Data.Nat
open import Data.Unit
open import Data.Bool
open import Data.Char
@joepie91
joepie91 / blockchain.md
Last active June 25, 2023 08:40
Is my blockchain a blockchain?

Your blockchain must have all of the following properties:

  • It's a merkle tree, or a construct with equivalent properties.
  • There is no single point of trust or authority; nodes are operated by different parties.
  • Multiple 'forks' of the blockchain may exist - that is, nodes may disagree on what the full sequence of blocks looks like.
  • In the case of such a fork, there must exist a deterministic consensus algorithm of some sort to decide what the "real" blockchain looks like (ie. which fork is "correct").
  • The consensus algorithm must be executable with only the information contained in the blockchain (or its forks), and no external input (eg. no decisionmaking from a centralized 'trust node').

If your blockchain is missing any of the above properties, it is not a blockchain, it is just a ledger.

//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
predicate sorted(a: array<int>)
requires a != null;
reads a;
{
forall j,k :: 0 <= j < k < a.Length ==> a[j] <= a[k]
}
predicate sortedPart(a: array<int>, n : int)
requires a != null;
requires n <= a.Length;
@ggrandes
ggrandes / openssl-smime.sh
Last active September 6, 2024 22:33
OpenSSL S/MIME 3.1 (CMS) - Encrypt/Signature - Verify/Decrypt
# Original Source:
# https://gist.github.com/ggrandes/a57c401f1bad6bd0ffd87a557b7b5790
# SIGN / VERIFY
openssl cms -sign -keyid -md sha256 -nodetach -binary -in /etc/passwd -signer user.crt -inkey user.key -out x.smime -outform SMIME
openssl cms -verify -CAfile ca.crt -in x.smime -inform SMIME
# ENCRYPT / DECRYPT
openssl cms -encrypt -keyid -aes-256-cbc -in /etc/passwd -binary -out x.smime -outform SMIME user.crt
openssl cms -decrypt -in x.smime -inform SMIME -recip user.crt -inkey user.key