Skip to content

Instantly share code, notes, and snippets.

View steshaw's full-sized avatar
👨‍💻
Loves programming languages

Steven Shaw steshaw

👨‍💻
Loves programming languages
View GitHub Profile
@edolstra
edolstra / nix-ui.md
Last active July 14, 2024 21:22
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@simonmichael
simonmichael / envelope-budgeting.journal
Last active March 20, 2025 08:52
envelope budgeting example
; An example of YNAB-ish envelope budgetting with hledger/ledger
; cf https://github.com/simonmichael/hledger/issues/315
; Using accounts like the following:
;
; assets
; business
; bank
; wf
; bchecking
@parmentf
parmentf / GitCommitEmoji.md
Last active July 3, 2025 14:14
Git Commit message Emoji
@manigandham
manigandham / rich-text-html-editors.md
Last active June 2, 2025 03:59
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@CMCDragonkai
CMCDragonkai / fold_ideas.md
Last active June 11, 2024 02:53
Haskell: Foldl vs Foldr

Foldl vs Foldr

I like to call foldr as "fold from the right", while foldl is "fold from the left".

@pellet
pellet / NSURLProtocol with NSURLSession pains.md
Last active August 29, 2015 14:23
NSURLProtocol with NSURLSession

My Rant

So I started writing my some swift code and decided to use a NSURLSession with my existing NSURLProtocol implementation instead of the as of now deprecated NSURLConnection. The protocol seemed to be working ok after adding it to the .customProtocols property on the NSURLSession.

However after attempting to run my tests, they were failing... why? I couldn't work out for hours...

I set up a break point in the canInit and startLoading methods. The application broke twice in the startLoading method, but only once in the canInit method... how could this be? Turns out that the NSURLProtocol was being 're-used' by NSURLSession, this mean't I now had to initialize the protocol object on every startLoad, not just when the object was actually initialised....

After making this fix, I noticed even after this the NSURLProtocol was constantly stopped and started mid way transfer, for this reason I decided to abandon using it via NSURLSession all together and explicitly now call startLoading and stopLoading

@flbuddymooreiv
flbuddymooreiv / passgitgpg.md
Last active June 27, 2025 17:40
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@queertypes
queertypes / read-dt.org
Last active January 10, 2025 02:25
Implement a Dependently Typed Language and Then Some
@pchiusano
pchiusano / scalaz-stream-design.markdown
Last active August 29, 2015 14:22
WIP design for new scalaz-stream core

All right, here we go! The API is quite a bit different than what we have currently, but it's simpler to use, more general, and the implementation can be much more efficient. The encoding for Tee, Process1, Channel is greatly simplified, these become just regular functions, rather than a Process[F,_] with a funky F. Stepping a Process is now a first-class concept, exposed publicly, in a safe way. The resulting style looks a lot like ordinary list processing, and doing things like a 3-way or N-way merge are trivial.

The algebra and the canonical model for this algebra are given in the attached streams.scala. The algebra for streams is given by the trait Stream[P[+_[_],+_]], and there's a canonical instance, Stream[NF], which specifies what the operations mean. A couple notes:

  • The Process[F,A] data type we have currently would have a Stream instance. (Name of Stream TBD)
  • The Chunk type is TBD
  • Free is just the free monad (well, one formulation of it)
  • I still have some uncert