Skip to content

Instantly share code, notes, and snippets.

@ghosty141
ghosty141 / Buttery_Smooth_Emacs.md
Created February 13, 2023 17:51
Buttery Smooth Emacs - Mirror of Daniel Colasciones great blog post about emacs' inner workings

original url - https://www.facebook.com/notes/daniel-colascione/buttery-smooth-emacs/10155313440066102/

Buttery Smooth Emacs

30 October 2016

Public Emacs has flickered for 30 years. Now, it should be flicker-free. I’ve just landed support for double-buffered rendering for the X11 port. Now you should be able to edit, resize, and introduce bugs in your awful codebase without seeing a partially-rendered buffer or being incited to murder by barely-perceptible white flashes while editing that

@stufield
stufield / GitHub-private-mirror.md
Last active June 30, 2025 02:47
Create private repo with public mirror
@9999years
9999years / scheme-infix.scm
Created August 22, 2019 02:04
Infix evaluation in scheme...?
#lang r5rs
(#%require schemeunit)
(define ** expt)
(define (!= x y) (not (= x y)))
(define (^^ a b) (or (and a (not b))
(and b (not a))))
; can you believe they made && and || special forms???
(define (&& a b) (and a b))
(define (|| a b) (or a b))
@xydinesh
xydinesh / sed.txt
Created August 21, 2019 18:03 — forked from shreeshga/sed.txt
sed quick help guide
HANDY ONE-LINERS FOR SED (Unix stream editor) Oct. 29, 1997
compiled by Eric Pement <epement@jpusa.chi.il.us> version 4.3
Latest version of this file is always at <http://www.wollery.demon.co.uk>
FILE SPACING:
# double space a file
sed G
# triple space a file
sed 'G;G'
@lukechampine
lukechampine / monads.c
Last active September 27, 2025 07:36
Maybe and Either Monads in C
#include <stdio.h>
#include <stdbool.h>
// Maybe
typedef struct MaybeInt {
int just;
bool nothing;
} MaybeInt;
@fabiomontefuscolo
fabiomontefuscolo / xz.markdown
Last active July 17, 2025 06:14
XZ and tricks

XZ

  1. Compress a file (filename.sql will be replaced by filename.sql.xz)
xz filename.sql
  1. Uncompress file (filename.sql.xz will be replaced by filename.sql)
@lukechampine
lukechampine / Y Combinator in Haskell.md
Last active March 25, 2025 06:52
Deriving the Y Combinator in Haskell

The Y Combinator

The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.

The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:

fac n = if n == 0 then 1
        else n * fac (n-1)
@ramntry
ramntry / automemoization.hs
Last active September 25, 2022 13:05
Auto-memoization in Haskell by State monad
import Control.Monad.State
import qualified Data.Map as Map
recall :: Ord a => a -> State (Map.Map a r) (Maybe r)
recall n = do
memory <- get
return (Map.lookup n memory)
memorize :: Ord a => a -> r -> State (Map.Map a r) ()
memorize n result = do
@ericavonb
ericavonb / git-commit-style-guide.md
Last active November 1, 2025 21:06
Git Commit Style Guide

Git Commit Style Guide

Inspiration: Deis Commit Style Guide

I often quote Deis in sections below.

Motivation

It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.

@shreeshga
shreeshga / sed.txt
Created September 26, 2012 17:57
sed quick help guide
HANDY ONE-LINERS FOR SED (Unix stream editor) Oct. 29, 1997
compiled by Eric Pement <epement@jpusa.chi.il.us> version 4.3
Latest version of this file is always at <http://www.wollery.demon.co.uk>
FILE SPACING:
# double space a file
sed G
# triple space a file
sed 'G;G'