Skip to content

Instantly share code, notes, and snippets.

View Syzygies's full-sized avatar

Dave Bayer Syzygies

View GitHub Profile
@Syzygies
Syzygies / JetBrainsMono.rb
Last active August 30, 2022 05:27
Script for merging fonts to create lighter ()[]{} brackets for Lisp
FONT_SOURCE = '/Volumes/All/Sources/@ Fonts/Fonts/JetBrains Mono/JetBrainsMono-2.242'
FONT_OUTDIR = '/Volumes/All/Sources/@ Fonts/Fonts/JetBrains Mono/JetBrainsLisp'
FONT_TTXDIR = "#{FONT_OUTDIR}/ttx"
FONT_KIND = 'ttf'
FONT_NAME1 = 'JetBrainsMono'
FONT_NAME2 = 'JetBrains Mono'
OUTPUT_NAME1 = 'JetBrainsLisp'
@Syzygies
Syzygies / install.sh
Last active August 27, 2022 16:54
Build script for Idris 2 on Apple silicon
#!/bin/bash
# script to install Idris2, once chez scheme already installed
# abort on any error
set -e
# we assume this script is in project/bin, and cd to project
cd "$(dirname "$0")/.."
echo
@Syzygies
Syzygies / build.ninja
Created August 1, 2022 15:04
Example Ruby script to create build.ninja file
# ninja - link Macaulay.bin in build/
# ninja clean - remove build/
cflags = -g -w -std=c99
lflags =
rule CC
depfile = $out.d
command = gcc -MD -MF $out.d $cflags -c $in -o $out
description = CC $out
module Main where
import qualified Data.ByteString.Char8 as B
import Data.Char (chr,ord)
isSpace ∷ Char → Bool
isSpace ' ' = True
isSpace '\t' = True
isSpace '\n' = True
isSpace '\r' = True
module Main where
import Data.Word8 (Word8, _cr, _space, _tab, isAsciiLower)
import qualified Data.ByteString as B
isSpace ∷ Word8 → Bool
isSpace w = w == _space || w <= _cr && w >= _tab
toUpper ∷ Word8 → Word8
toUpper w = if isAsciiLower w then w - _space else w
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv) {
int bread;
char c, buf[256 * 1024];
char *ptr, *end;
FILE *file = fopen("input.txt", "r");
bread = fread(buf, 1, 256 * 1024, file);
@Syzygies
Syzygies / brew-doctor.txt
Created September 14, 2011 13:46
brew doctor after fresh Homebrew install
/usr/local/include isn't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew.
If a brew tries to write a header file to this folder, the install will\nfail during the link step.
You should probably `chown` /usr/local/include
/usr/local/lib/pkgconfig isn't writable.
This can happen if you "sudo make install" software that isn't managed
@Syzygies
Syzygies / concise.txt
Created August 20, 2011 13:46
Hoembrew cache reuse bug
book % echo $FORMULA
/usr/local/Library/Formula
book % echo $CACHE
/Users/dave/Library/Caches/Homebrew
book % brew remove --force macaulay2
book % rm -rf $CACHE/macaulay*