Skip to content

Instantly share code, notes, and snippets.

@phoe
phoe / package-local-nicknames.md
Last active February 27, 2024 08:14
Package-local nicknames in Common Lisp - a semishitpost about PLNs

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

(ql:quickload :closer-mop)
(defclass foo ()
((bar :initarg :bar :initform nil :reader foo-bar)))
(defclass fuu (foo)
((baz :initarg :baz :initform nil :reader fuu-baz)))
(defmethod print-object ((f foo) stream)
(print-unreadable-object (f stream :type t)))
@mboeh
mboeh / tng-4x22.markdown
Last active November 20, 2016 19:00
TNG episode guide: 4x22, "Half A Life"
@jessicard
jessicard / macarons.md
Last active February 3, 2023 03:53
Macarons!

Basic macaron shell recipe

  • This will make approximately 100 shells, or about 4 dozen cookies
  • When practicing, I generally half this recipe to only make 1 sheet of cookies
  • When making macarons, you will generally flavor the filling but not the shells
  • You want to make the macarons the day before the event. You will store them in the refrigerator over night, and then take them out a few hours before to come to room temperature. This is because macarons are best when "ripened", or allowed to sit for at least one night and have the filling seep into the shells a bit. Otherwise, straight out of the oven, they can be too crunchy or hard
  • Macarons shells freeze well! Filled macarons can also freeze well depending on the filling. Buttercream fillings freeze great. Put the cookies into an airtight container before freezing
  • Everyones baking temperature and baking time vary depending on their oven - you might have to experiment a bit!
  • _I always separate egg whites myself by cracking the egg, p

things I don't know

I took this list from What CS majors should know.

I think it is fun to list things I don't know so I did it =D. I actually found it to be a cool exercise -- maybe I should do a fun graphics project and learn about Open GL!

i wrote this because, while i think the things on this list are potentially worth knowing, and I actually think it's an awesome list of project ideas as well as good food for thought for people developing CS curricula (many of the things I don't know are great exercises!) -- I thought it was really weird to say that every CS student should know all of them. I have a CS degree and I learned very few of the things I do know inside my degree.

I classify "do know" as anything that I have a reasonable grasp of or at least some basic experience with -- the kind of experience I'd expect a CS student to be able to get. If I say I don't know something, it means either I know pretty much nothing about it (for "gr

@rampion
rampion / 0.md
Last active April 18, 2016 19:19
Composing bijections, surjections, and injections

It's occasionally useful to consider a slightly richer function definition than ->, one where you can reason about the preimage of the function's codomain.

One approach is to bundle each -> with another function describing the preimage:

data Bidirectional p q a b = Bidirectional
  { forwards :: p a b
  , backwards :: q b a
  }

I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal

I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at

@lispm
lispm / gist:6066e1eeadf943910c47
Last active August 29, 2015 14:11
longest graph, version without a NODE structure
; https://github.com/logicchains/LPATHBench/blob/master/writeup.md
(eval-when (:load-toplevel :compile-toplevel :execute)
(defstruct route
(dest 0 :type fixnum)
(cost 0 :type fixnum)))
(defun parse-line (line &aux (pos 0) n)
(declare (ignorable n))
(loop repeat 3
@fukamachi
fukamachi / twitpic-dl.lisp
Last active August 29, 2015 14:06
Twitpic backup script
#|
Twitpic Downloader
==================
This Common Lisp script downloads all image/video files from Twitpic account to the current directory.
## Usage
;; SBCL