Skip to content

Instantly share code, notes, and snippets.

View sellout's full-sized avatar
🍌
semper φ

Greg Pfeil sellout

🍌
semper φ
View GitHub Profile
@sellout
sellout / secret-santa.lisp
Created October 17, 2010 15:53
A simple script for sending out secret santa emails.
(ql:quickload "mel-base")
(defparameter *debugp* t)
(defvar *purchasers* ()
"A list of lists in the format (name email exclusion-list historical-results)")
(define-condition bad-match (condition)
())
(defun secret-santa (historical-exclusion-function &rest purchasers)
@sellout
sellout / gist:662106
Created November 4, 2010 03:46
in-place modification
(include-component "library/characters")
;; all valid sequence operations are valid string operations, so we `load` the
;; component instead of using one of the `*-component operations`.
(load "library/sequences")
(trigger {upcase (list ?string {?rc}) up} ...)
A thought … if there's a
@sellout
sellout / color-theme-solarized.el
Created March 26, 2011 13:48
First step of a Solarized color theme for Emacs (http://ethanschoonover.com/solarized)
(eval-when-compile
(require 'color-theme))
(defun color-theme-solarized (mode)
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
(interactive "Slight or dark? ")
(let ((base03 "#002b36")
(base02 "#073642")
(base01 "#586e75")
@sellout
sellout / Solarized dark.terminal
Created April 5, 2012 15:06
Simple Solarized theme for OS X Terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VVTlNSR0KAAhAB
TxAoMC4wMzkzODA3MzY2NSAwLjE2MDExNjQ2MzkgMC4xOTgzMzI3NTY4ANIQERITWiRj
bGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVjdF8QD05TS2V5ZWRBcmNo
@sellout
sellout / gist:2495083
Created April 26, 2012 01:38
comment formatting
;;; 1 2 3 4 5 6 0
;;;456789012345678901234567890123456789012345678901234567890123456789012345678
;;;12345678 1 2 3 4 5 6
;;; 123456789012345678901234567890123456789012345678901234567890123456.
;;;
;;; This document is intended to show better comment formatting. It
;;; allows for 66 characters of main body text, with an 8-space margin
;;; to the left, and a one-space margin to the right, while fitting
;;; within 78 columns.
@sellout
sellout / gist:2794138
Created May 26, 2012 14:29
transactions in Kilns
;; This simple snapshotting trigger example keeps a kell running but
;; sends a copy of its current state over `?rc`.
(trigger* {snapshot (list {?kell} {?rc})}
(trigger [kell ?a]
[kell ?a]
{rc {kell ?a}}))
;; This is a simple example of a rollback trigger. (Actually, it’s
;; more general than a rollback – there is no restriction on the new
;; state.) It simply grabs a kell and replaces its state in situ.
(defun fishspam (input) (if (member input '("tunafish" "tuna" "sardines") :test #'string=)
'(<:p "thanks for your comments")
'(addcomment article (hunchentoot:post-parameter "comment") (document-property :comments (get-document article))(hunchentoot:post-parameter "name"))
'(<:p "are you a robot?") ))

Keybase proof

I hereby claim:

  • I am sellout on github.
  • I am sellout (https://keybase.io/sellout) on keybase.
  • I have a public key whose fingerprint is 6A45 7A06 CB07 E916 EC88 EC74 1193 ACD1 96ED 61F2

To claim this, I am signing this object:

scanl : (b -> a -> b) -> b -> Vect n a -> Vect (S n) b
scanl f q ls = q :: (case ls of
[] => []
x::xs => scanl f (f q x) xs)
-- When elaborating left hand side of Main.case block in scanl:
-- When elaborating argument ls to Main.case block in scanl:
-- Can't unify
-- Vect 0 a
-- with
@sellout
sellout / gist:10744574
Last active August 29, 2015 13:59
very confused, as usual
import Data.Bits
trim : Bits (1 + n) -> Bits n
trim b = truncate b
BoundedInt : Integer -> Nat -> Type
BoundedInt min max = (x : Integer ** so (min <= x && x < toIntegerNat max))
postulate bounds : (x : Integer) -> so (lower <= x && x < toIntegerNat upper) -> so (lower <= x && 1+2*x < pow 2 upper)