Skip to content

Instantly share code, notes, and snippets.

@sdilts
sdilts / magit.sh
Created August 4, 2021 17:33
Script to open magit buffer in current project
#!/bin/sh
if [ -z "$1" ]
then
OPEN_DIR=$(PWD)
else
OPEN_DIR=$1
fi
cd $OPEN_DIR
@sdilts
sdilts / main.c
Last active May 24, 2020 19:35
Dump of Carp compiler output
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
@sdilts
sdilts / my-defmacro.carp
Created February 7, 2020 23:14
Defmacro implemented in Carp
(defndynamic my-nth [x lst]
(if (not (= (length lst) 0))
(if (= x 0)
(car lst)
(my-nth (- x 1) (cdr lst)))
(macro-error "my-nth: x provided was too big")))
(defndynamic my-nthcdr [x lst]
(if (not (= (length lst) 0))
(if (= x 0)