Skip to content

Instantly share code, notes, and snippets.

@DammianMiller
DammianMiller / implementing_fft.md
Created June 7, 2023 02:47 — forked from VictorTaelin/implementing_fft.md
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.

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@DammianMiller
DammianMiller / gist:c4df924c5508ebcd599d4034eb137615
Created September 3, 2018 13:12 — forked from jpetitcolas/gist:5967887
Encode/decode a base64 encoded string in PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;

Keybase proof

I hereby claim:

  • I am DammianMiller on github.
  • I am dammianmiller (https://keybase.io/dammianmiller) on keybase.
  • I have a public key whose fingerprint is F47D DD58 F8A4 D556 0C3C 016E 1A96 87A3 1433 F785

To claim this, I am signing this object:

@DammianMiller
DammianMiller / about.md
Created March 21, 2016 22:04 — forked from adamjgrant/about.md
Scoped components is a pattern to group css classes and ids into "Components" which identify high-level units of visual organization in the application.

Scoped components

CSS class names quickly get out of hand. Repos end up with unorganized CSS files all over the place making it difficult to name things and find them in the code.

The scoped components pattern addresses this by grouping classes into "component" scopes.

<div data-component="news-menu">
  <h1 class="title">...</h1>
  <ul class="items">
    <li class="item">...</li>