This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun scan-to-ranges (regex target-string) | |
(let ((matches (ppcre:all-matches regex target-string)) | |
(end-pos (length target-string)) | |
(starts-with-match nil) | |
(all-ranges nil)) | |
(when (not matches) | |
(return-from scan-to-ranges | |
(list (cons 0 end-pos)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.side .spacer | |
{ | |
margin:4px 0 3px; | |
} | |
.submit-text | |
{ | |
display:none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun 5-random-base64-encoded-bytes () | |
(base64:usb8-array-to-base64-string | |
(map 'vector (lambda (place) | |
(declare (ignore place)) | |
(random 255)) | |
(make-sequence 'vector 5)))) | |
(defun digest-password (password &optional (salt (5-random-base64-encoded-bytes))) | |
(values | |
(base64:usb8-array-to-base64-string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :cl-user) | |
(defun yaclml-defaults (thunk) | |
(eval `(let ((,(intern "*YACLML-INDENT*" :yaclml) nil)) | |
(funcall ,thunk)))) | |
(asdf:defsystem :foo | |
:serial t | |
:description "Foo is baz for bar." | |
:author "Joe Taylor" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; cl-who | |
(let ((colors '("red" "green" "blue"))) | |
(who:with-html-output-to-string (s) | |
(:html | |
(:head | |
(:title "Colors")) | |
(:body | |
(:ul | |
(dolist (c colors) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CL-USER> (setf yaclml::*yaclml-indent* t) | |
T | |
CL-USER> (<:html (<:head (<:title "Hello, world"))) | |
<html | |
><head | |
><title | |
>Hello, world</title | |
></head | |
></html | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar *foo* (get-foo)) | |
(defun get-foo () | |
42) | |
(format t "~a" *foo*) | |
;; The above code will not work, but it's analogous to the JavaScript below, which will: | |
;; var foo = getFoo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun a-bound-p () | |
(boundp 'a)) | |
(defun funcall-with-a-as-special-variable (function &optional a) | |
(declare (special a)) | |
(funcall function)) | |
(funcall-with-a-as-special-variable | |
#'a-bound-p) ;;; => T |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun draw-frame () | |
(sdl:clear-display sdl:*black*) | |
(sdl:draw-box-* 0 0 100 100) | |
(sdl:update-display)) | |
(sdl:with-init () | |
(sdl:window 1024 768) | |
(sdl:with-events () | |
(:quit-event () t) | |
(:idle () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun draw-frame () | |
(sdl:clear-display sdl:*black*) | |
(sdl:draw-box-* 30 30 100 100) | |
(sdl:update-display)) | |
(sdl:with-init () | |
(sdl:window 1024 768) | |
(sdl:with-events () | |
(:quit-event () t) | |
(:idle () |