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
(in-package #:grok-cl-parenscript-react) | |
(hunchentoot:define-easy-handler (handle-tutorial :uri "/tutorial") | |
() | |
(cl-who:with-html-output-to-string (stream) | |
(:html | |
(:head | |
(:title "React Tutorial") | |
(:script :type "text/javascript" :src *react-url*)) | |
(:body |
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
(in-package :famiclom) | |
(require 'sb-sprof) | |
(defun check-for-input () | |
(let ((event (sdl:new-event))) | |
(loop | |
;; Pops the event-queue and binds it to event, return 0 if no pending | |
;; events. | |
:for event-poll = (sdl-cffi::SDL-Poll-event event) |
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 event-p (x) t) ;; constantly t | |
(defun key-p (x) t) ;; constantly t | |
;; w/o defpattern | |
(match event | |
((and (sdl:event- (type (eq :key-down-event))) | |
;;^^^^^^^^^^ this specify the container type | |
;;^^^^ this is a slot | |
;; ^^^^^^^^^^^^^^^^^^ and this specifies the type of the slot. | |
(sdl::key- (key (eq :sdl-key-z)) state))) |
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
#!/usr/bin/cl -Q -sp coleslaw --entry entry | |
;;;; | |
;; This script assumes it is executed from the repository's top level directory | |
;; to determine correctly the blog-dir variable. | |
;;;; | |
;; (coleslaw:preview #P"/home/puercopop/Projects/RunaRimac/hello-world.md") | |
(defun entry (argv) | |
(declare (ignorable argv)) | |
(let |
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
;; Lambkin, a garbage-collected heap suitable for microcontrollers. | |
;; Copyright (C) 2015 Andy Wingo <wingo@igalia.com>. | |
;; | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. | |
;; | |
;; This program is distributed in the hope that it will be useful, | |
;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
;;; Usage (percentage (analyze-systems '(a b c d))) => 42.23 | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(when (asdf:find-system :named-readtables nil) | |
(asdf:load-system :named-readtables))) | |
(defun analyze-form (form) | |
(typecase form | |
(symbol | |
(when (eql (symbol-package form) (find-package 'cl)) |
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
(require :sb-concurrency) | |
(defpackage :demo (:use :cl :sb-thread :sb-concurrency :sb-ext)) | |
(in-package :demo) | |
(defun make-atomic-boolean (&optional (init nil)) | |
(list init)) | |
(defun atomic-boolean-get (ab) | |
(barrier (:read) |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
abort "Usage: fuck you <name>" unless ARGV[0] == "you" && ARGV.size == 2 | |
a = "abcdefghijklmnopqrstuvqxyz".each_char.to_a | |
b = "ɐqɔpǝɟƃɥıɾʞʃɯuodbɹsʇnʌʍxʎz".each_char.to_a | |
ws = Hash[a.zip(b)] | |
ws.default = ->(f){f} |
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
; Pure Lisp based assembler | |
(def my-fun (input1 :in d1 | |
input2 :in d2 | |
output :out d0) | |
(move.l input1 output) | |
(add.l input2 output)) | |
---------------------------------------------------------------------------------------- | |
; We can also have loop constructions by doing a macro (no need for it to be 'built-in') |
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 | |
#|-*- mode:lisp -*-|# | |
#| | |
exec ros -Q -- $0 "$@" | |
|# | |
(progn ;;init forms | |
(ros:ensure-asdf) | |
#+quicklisp (ql:quickload '(:alexandria :trivia :iterate) :silent t)) | |
(defpackage :ros.script.case.3724474528 |
OlderNewer