This file contains 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 fibonacci [n, &optional, [a, 0], [b, 1], acc] | |
- if | |
- [zerop, n] | |
- [nreverse acc] | |
- fibonacci | |
- [1-, n] | |
- b | |
- [+, a, b] | |
- [cons, a, acc] |
This file contains 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 *static-server* (lack.app.file:make-app)) | |
(defun my-server (env) | |
(cond | |
((equal (getf env :path-info) "/socket") | |
(let ((ws (websocket-driver:make-server env))) | |
(websocket-driver:on | |
:message ws | |
(lambda (message) | |
(websocket-driver:send ws message))) | |
(lambda (responder) |
This file contains 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 *fast-prng-cipher* nil) | |
(defun fast-random (nbytes) | |
(unless *fast-prng-cipher* | |
(setf *fast-prng-cipher* | |
(ironclad:make-cipher 'ironclad:salsa20 | |
:key (ironclad:random-data 32) :mode :stream))) | |
(let ((result (make-array nbytes :element-type '(unsigned-byte 8)))) | |
(ironclad:encrypt *fast-prng-cipher* (make-array nbytes :element-type '(unsigned-byte 8) :initial-element 0) result) | |
result)) | |
#| |
This file contains 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 process(cells) | |
(do ((moves 0 (+ 1 moves)) | |
(position 0) | |
(cell-value (elt cells 0) (ignore-errors (elt cells position)))) | |
((null cell-value) (print moves)) | |
(psetf | |
position (+ cell-value position) | |
(elt cells position) (1+ cell-value)))) | |
(defun start() |
This file contains 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
[jasom@motoko:~]$ nix-channel --list | |
[jasom@motoko:~]$ sudo nix-channel --list | |
nixos https://nixos.org/channels/nixos-17.03 |
This file contains 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
#!/bin/sh | |
usage() { | |
cat <<EOF >&1 | |
Usage: $1 [OPTION].. SRC DSTDIR | |
Recursively copy SRC to destination directory DSTDIR. | |
-f Create DSTDIR if it does not exist | |
-H FORMAT Use tar format FORMAT (default=pax) |
This file contains 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
{ stdenv }: | |
stdenv.mkDerivation rec { | |
name = "foo-1.0"; | |
src = ./foo.txt; | |
id = let contents = builtins.readFile ./foo.txt; | |
hash = builtins.hashString "sha256" contents; | |
in hash; | |
builder = ./foo.sh; |
This file contains 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
Processing section "[homes]" | |
[2016/10/26 21:28:39.748280, 2] ../source3/param/loadparm.c:2596(lp_do_section) | |
Processing section "[public]" | |
[2016/10/26 21:28:39.748366, 3] ../source3/param/loadparm.c:1476(lp_add_ipc) | |
adding IPC service | |
[2016/10/26 21:28:39.748423, 3] ../source3/auth/auth.c:178(auth_check_ntlm_password) | |
check_ntlm_password: Checking password for unmapped user []\[GUEST]@[MACBOOK-AIR-2] with the new password interface | |
[2016/10/26 21:28:39.748445, 3] ../source3/auth/auth.c:181(auth_check_ntlm_password) | |
check_ntlm_password: mapped user is: [SA]\[GUEST]@[MACBOOK-AIR-2] | |
[2016/10/26 21:28:39.748488, 3] ../source3/auth/check_samsec.c:400(check_sam_security) |
This file contains 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
(declaim (optimize (debug 3))) | |
(defpackage dynamic-flet | |
(:use :cl :alexandria) | |
(:export #:defdynamic #:dynamic-flet)) | |
(in-package dynamic-flet) | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(defvar *dynamic-fbindings* (make-hash-table))) | |
(defmacro defdynamic (fname &optional args &body b) |
This file contains 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
(defpackage "PARENSCRIPTM-GARBAGE") | |
(defun split-tag-parts (tree) | |
(loop with tag = (car tree) | |
for rest on (cdr tree) by #'cddr | |
while (keywordp (car rest)) | |
if (cadr rest) | |
collect (ps::encode-js-identifier (string (car rest))) into attrs | |
and | |
collect (cadr rest) into attrs |