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 am->br (am br amf) | |
(flet ((str->arr (str) | |
(make-array (length str) :initial-contents (coerce str 'list)))) | |
(with-accessors ((as diff:original-start) (al diff:original-length) | |
(bs diff:modified-start) (al diff:modified-length)) | |
(find (find-class 'diff:modified-diff-region) | |
(diff:compute-raw-diff (str->arr am) | |
(str->arr br)) | |
:key 'class-of) | |
(strcat (slice amf 0 as) |
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 read-listcomp (stream char) | |
(declare (ignore char)) | |
(let (rezs srcs conds state) | |
(dolist (item (read-delimited-list #\} stream)) | |
(if (eql '|| item) | |
(setf state (if state :cond :src)) | |
(case state | |
(:src (push item srcs)) | |
(:cond (push item conds)) | |
(otherwise (push item rezs))))) |
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
(ql:quickload "usocket") | |
(ql:quickload "cl-json") | |
(ql:quickload "salza2") | |
(ql:quickload "babel") | |
(ql:quickload "local-time") | |
(ql:quickload "rutils") | |
(named-readtables:in-readtable rutil:rutils-readtable) | |
(defvar *hostname* nil) |
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:in-package #:cl-pdf) | |
(defun draw-image (image x y dx dy rotation &optional keep-aspect-ratio) | |
(when keep-aspect-ratio | |
(unless (zerop dx) | |
(let ((r1 (/ dy dx)) | |
(r2 (/ (height image) (width image)))) | |
(if (> r1 r2) | |
(setf dy (* dx r2)) | |
(setf dx (/ dy r2)))))) |
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
(ql:quickload :cl-ppcre) | |
(ql:quickload :rutils) | |
(use-package :rutil) | |
(named-readtables:in-readtable rutils-readtable) | |
(defpar *orig* | |
#/I joined Hacker News around 5 years ago. I used to wake up and do the grim commute each morning to London from my home and the only thing that made it vaguely ok was Hacker News. It was a great place to go and find interesting articles from genuinely passionate people. It also used to be a really safe place to launch a startup that you'd spent days, weeks, years on - your project. It was a place where you could launch your startup and know you'd get great constructive feedback. People may not necessarily like your site but they'd admire you for having the balls to launch it, for spending time developing something that you hoped could benefit people in some way. They'd want you to succeed and they'd try and help you succeed with feedback that would ultimately help you. Unfortunately, today's Hacker News audience is no longer the same. Today's Hacker News is a place where us |
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
(ql:quickload :usocket) | |
(defun start-blackhole (&optional (port 80)) | |
(let ((sock (usocket:socket-listen "0.0.0.0" port :reuse-address t))) | |
(loop (let ((conn (usocket:socket-accept sock))) | |
(format t "Connected ~A~%" (slot-value conn 'usocket::stream)))))) |
NewerOlder