Skip to content

Instantly share code, notes, and snippets.

# Description:
# Lisp Drinking Game
#
# Configuration:
# None
#
# Commands:
# None
#
# Author:
@bhyde
bhyde / graph-quicklisp-system
Last active December 21, 2015 11:29
Generate a graphviz of the systems required by a the given system, let dot render that, then have emacs display it. Calls back to emacs via swank::eval-in-emacs.
(in-package #:cl-user)
;; Must do ...
;; (setf slime-enable-evaluate-in-emacs t)
;; ... in emacs first. And, dot must be installed.
(defun graph-quicklisp-system (ql-system-designation)
"Display graph of system requirements."
(let ((dot-file "/tmp/ql-system.dot")
(png-file "/tmp/ql-system.png"))
@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
;; FILE: /home/chu/Programming/lisp/common-lisp/tinywm.lisp
;; AUTHOR: twb (copyleft 2006)
(shadow 'char-width)
(use-package :xlib)
(defparameter *mods* '(:mod-1))
(defparameter *move* 1)
(defparameter *resize* 3)
(defparameter *lower* 4)
(defparameter *raise* 5)
@m2ym
m2ym / clack+optima.lisp
Created November 25, 2012 16:15
Clack + Optima
(ql:quickload '(:clack :optima :optima.ppcre))
(defpackage :demo
(:use :cl :optima :optima.extra :optima.ppcre))
(in-package :demo)
(defun app (env)
(match env
((plist :request-method :get
:request-uri (or "/" (ppcre "^/(.+)$" name)))
@dto
dto / rlx.el
Created November 19, 2012 18:48
RLX, early elisp prototype of Blocky
;;; rlx.el --- RLX development tools for GNU Emacs
;; Copyright (C) 2006, 2007, 2008 David O'Toole
;; Author: David O'Toole <[email protected]>
;; Keywords: multimedia, games
;; Version: 0.81
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@fukamachi
fukamachi / gist:4109289
Created November 19, 2012 06:42
Make the color of parenthesis gray.
(defvar paren-face 'paren-face)
(make-face 'paren-face)
(set-face-foreground 'paren-face "#666666")
(dolist (mode '(lisp-mode
emacs-lisp-mode
scheme-mode))
(font-lock-add-keywords mode
'(("(\\|)" . paren-face))))
@fukamachi
fukamachi / gist:4109258
Last active May 27, 2016 21:05
Pretty lambda/nil for Emacs
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@robhudson
robhudson / gist:3848832
Last active December 28, 2024 16:13
Quick way to set CORS headers on django-tastypie resources
class CORSResource(object):
"""
Adds CORS headers to resources that subclass this.
"""
def create_response(self, *args, **kwargs):
response = super(CORSResource, self).create_response(*args, **kwargs)
response['Access-Control-Allow-Origin'] = '*'
response['Access-Control-Allow-Headers'] = 'Content-Type'
return response