Skip to content

Instantly share code, notes, and snippets.

View eddiejessup's full-sized avatar

Elliot Marsden eddiejessup

View GitHub Profile
@eddiejessup
eddiejessup / openssl_equiv_script.py
Created September 14, 2022 22:11
Transcrypt migration script
import bisect
import os
import sys
C_PAD = b"\0"
KEY_SIZES = [16, 24, 32]
def normalize_key(key: bytes) -> bytes:
@eddiejessup
eddiejessup / gist:f0c3694bf96912cae34348995327e76d
Created July 18, 2022 19:56
Example of hastype with eff, needs lots of type annotations
data EnvData = EnvData
data GetEnv :: Effect where
DoFoo :: GetEnv m EnvData
doFoo :: (GetEnv :> es) => Eff es EnvData
doFoo = send DoFoo
type instance DispatchOf GetEnv = 'Dynamic
@eddiejessup
eddiejessup / ian_feedback.md
Created February 23, 2021 13:12
Ian feedback

2021-02-17-ian-feedback

Pattern matching is better than equality

I think this is common to people new to Haskell, but you need equality (i.e. the == operator) less often than you might think.

in this sort of case:

rotN :: (Enum a, Bounded a) => CryptoProc -> Int -> a -> a
@eddiejessup
eddiejessup / feedback.md
Created February 17, 2021 22:21
Track feedback

Track project feedback

In general the code seems really well written, especially given that I think you're pretty new to this coding thing? I'd say the code is a good balance between being overly wordy, and being too terse to easily understand.

I haven't commented much on the Flask- and database-specific choices you've made, because I'm not familiar enough with Flask and SQLAlchemy to give great feedback, and also I imagine this is less useful than more general Python- and programming-relevant suggestions.

I've no substantial feedback on the javascript and CSS, because I've less experience with good practice here. But it all looks fine as far as I can tell.

Comment vs documentation content

@eddiejessup
eddiejessup / waw.ipynb
Last active November 28, 2018 17:04
Soft stop simulation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@eddiejessup
eddiejessup / mac_os_sierra_setup.md
Last active April 25, 2017 09:37 — forked from paddykontschak/osx_mountain_lion_setup.md
Personal Setup for Mac OS 10.12

Setup new Mac with macOS Sierra from scratch

These commands are good as of 2017-04-24.

MacOS

Settings

import sys
SLOW_THRESHOLD = 20
def parse_line(line):
time_str, content = line.strip().split(' ', 1)
return int(time_str), content
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[books]
- René Descartes: Discourse on Method and the Meditations
- Terry Pratchett: Feet of Clay
- Alexander Pope: Selected Poetry
- Voltaire: Candide, or Optimism
- Donald E. Knuth: Computers and Typesetting Volume A: The TeXBook
- Donald E. Knuth: Computers and Typesetting Volume B: TeX the Program
[people]
- pretend_person.com/my_book_list