Skip to content

Instantly share code, notes, and snippets.

View jl2's full-sized avatar

Jeremiah LaRocco jl2

View GitHub Profile
(ql:quickload :cl-glfw3)
(glfw:def-key-callback keyboard-handler (window key scancode action mod-keys)
(format t "Window ~a key ~a scancode ~a action ~a mod-keys ~a~%" window key scancode action mod-keys)
(when (eq key :escape)
(glfw:set-window-should-close window)))
(defun show-window (name)
(let ((win (glfw:create-window :title (format nil "GLFW Window (~a)" name)
:width 100
;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*-
;;(declaim (optimize (speed 3) (safety 1) (debug 1)))
(setf *read-default-float-format* 'double-float)
#-quicklisp
(let ((quicklisp-init "/home/jeremiah/quicklisp/setup.lisp"))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(ql:quickload :cl-csv)
(ql:quickload :zip)
(ql:quickload :cl-strings)
;; Download transit data from this French site:
;; https://www.data.gouv.fr/fr/datasets/transport-donnees-gtfs/
(defun read-transit-data (&key (zip-file-path "~/Downloads/gtfs_current.zip"))
(flet ((csv-name-to-lisp (name)
(string-upcase (cl-strings:replace-all name "_" "-"))))
@jl2
jl2 / .emacs
Created November 8, 2019 18:54
(load "~/src/gtd/config")
;; Source: http://www.emacswiki.org/emacs-en/download/misc-cmds.el
(defun revert-buffer-no-confirm ()
"Revert buffer without confirmation."
(interactive)
(revert-buffer :ignore-auto :noconfirm))
(defun toggle-kbd-macro-recording-on ()
(declaim (ftype (function (fixnum function) ) triples))
(time
(defun triples (n func)
(declare (optimize (speed 3) (debug 0) (safety 0)))
(declare (type function func)
(type fixnum n))
(let ((count 0))
(declare (type fixnum count))
(loop for z fixnum from 1 do
(loop for x fixnum from 1 to z do
@jl2
jl2 / .emacs
Last active December 4, 2018 18:30
customize-target-features.lisp
(setq default-frame-alist
'((width . 124)))
(add-to-list 'load-path "~/.emacs_stuff/")
(load "~/.emacs_stuff/my_functions")
(load "~/src/gtd/config")
(autoload 'gid "idutils" nil t)
;; Source: http://www.emacswiki.org/emacs-en/download/misc-cmds.el
@jl2
jl2 / mandelbrot.lisp
Last active September 21, 2018 16:29
;; The Computer Language Benchmarks Game
;; https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
;;;
;;; resubmitted by Wade Humeniuk (Fix Stream Problem)
;;; resubmitted by Jon Smith (Remove silly assertion causing it to break on 16000 size)
;;; re-resubmitted by Jon Smith (with a silly hack to make it parallel).
;;; Original contributed by Yannick Gingras
;;;
;;; To compile
;;; sbcl --load mandelbrot.lisp --no-userinit --eval "(declaim (optimize (speed 3) (safety 0) (debug 0)))" --eval "(save-lisp-and-die \"mandelbrot\" :executable t :purify t :toplevel (lambda () (main) (quit)))"
(defun create-makefile (package-name
&key
(entry "main")
(directory (format nil "~~/src/lisp/~a/" package-name))
(binary-name package-name)
(extra-buildapp-flags "--compress-core")
(manifest-file-name "manifest.txt")
(quicklisp-setup "~/quicklisp/setup.lisp"))
"Create a Makefile for building an executable image from a Common Lisp package."
@jl2
jl2 / .emacs
Created November 4, 2017 23:19
Most recent .emacs
(setq default-frame-alist
'((width . 124)))
(add-to-list 'load-path "~/.emacs_stuff/")
(load "~/.emacs_stuff/my_functions")
(autoload 'gid "idutils" nil t)
;; (setq vc-handled-backends nil)
(setq vc-handled-backends '(Git))
This file has been truncated, but you can view the full file.
James Joyce
Finnegans Wake
Sources : Finwake.com; Finnegans Web.
Paris, 2011