# HG changeset patch # User Steve Losh # Date 1545245703 18000 # Node ID a9e85b8e5f66cea8ac7b4130fd85586d2405830b # Parent deda525820e34732176904c2d157e3cfff2300ab More diff -r deda525820e3 -r a9e85b8e5f66 bin/addcontact --- a/bin/addcontact Wed Dec 19 10:18:23 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -#!/bin/bash -osascript -e "tell application \"Address Book\"" \ --e " set firstParam to \"$1\"" \ --e " set secondParam to \"$2\"" \ --e " set thirdParam to \"$3\"" \ --e " set fourthParam to \"$4\"" \ --e " set contactEmailLabel to \"\"" \ --e " set spaceOffset to (offset of \" \" in firstParam)" \ --e " if (spaceOffset is not equal to 0) then" \ --e " set AppleScript's text item delimiters to \" \"" \ --e " set firstName to (text item 1 of firstParam)" \ --e " set lastName to (text item 2 of firstParam)" \ --e " set firstEmailParam to secondParam" \ --e " set secondEmailParam to thirdParam" \ --e " else" \ --e " set firstName to firstParam" \ --e " set lastName to secondParam" \ --e " set firstEmailParam to thirdParam" \ --e " set secondEmailParam to fourthParam" \ --e " end if" \ --e " set atOffset to (offset of \"@\" in firstEmailParam)" \ --e " if (atOffset is not equal to 0) then" \ --e " set contactEmail to firstEmailParam" \ --e " else" \ --e " set contactEmailLabel to firstEmailParam" \ --e " set contactEmail to secondEmailParam" \ --e " end if" \ --e " set bracketOffset to (offset of \"<\" in contactEmail)" \ --e " if (bracketOffset is not equal to 0) then" \ --e " set contactEmail to text 2 thru -2 of contactEmail" \ --e " end if" \ --e " if (contactEmailLabel is equal to \"\") then" \ --e " set contactEmailLabel to \"Home\"" \ --e " end if" \ --e " set newPerson to (make new person with properties {first name:firstName, last name:lastName})" \ --e " make new email at end of emails of newPerson with properties {label:contactEmailLabel, value:contactEmail}" \ --e " save" \ --e " if (newPerson exists) then" \ --e " if (firstName exists) then" \ --e " set returnString to (\"First name: \" & firstName)" \ --e " end if" \ --e " if (lastName exists) then" \ --e " set returnString to (returnString & \"; Last name: \" & lastName)" \ --e " end if" \ --e " if (contactEmailLabel exists) then" \ --e " set returnString to (returnString & \"; Email label: \" & contactEmailLabel)" \ --e " end if" \ --e " if (contactEmail exists) then" \ --e " set returnString to (returnString & \"; Email address: \" & contactEmail)" \ --e " end if" \ --e " return returnString" \ --e " end if" \ --e "end tell" - diff -r deda525820e3 -r a9e85b8e5f66 bin/frameworkpython --- a/bin/frameworkpython Wed Dec 19 10:18:23 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -#!/bin/bash - -# what real Python executable to use -PYVER=3.4 -PATHTOPYTHON=/usr/local/bin/ -PYTHON=${PATHTOPYTHON}python${PYVER} - -# find the root of the virtualenv, it should be the parent of the dir this script is in -# ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"` - -# now run Python with the virtualenv set as Python's HOME -export PYTHONHOME=$VIRTUAL_ENV -exec env PYTHONPATH= $PYTHON -m IPython "$@" diff -r deda525820e3 -r a9e85b8e5f66 bin/lec --- a/bin/lec Wed Dec 19 10:18:23 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -echo $* | peat "lecdown $* > index.html" - diff -r deda525820e3 -r a9e85b8e5f66 bin/lecdown --- a/bin/lecdown Wed Dec 19 10:18:23 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo "" - -cat < - -EOF - - -cat < -EOF - -cat < -MathJax.Hub.Config({ - tex2jax: { - inlineMath: [[',,',',,']], - displayMath: [['!!!','!!!']], - processEscapes: true - }, - TeX: { - equationNumbers: {autoNumber: "AMS"} - } -}); - - -EOF - -cat < -
- -!!! -\\newcommand{\\qed}{\\square} -!!! - -!!! -\\newcommand{\\abs}[1]{\\left|#1\\right|} -!!! - -!!! -\\newcommand{\\R}{\\mathbb{R}} -!!! - -!!! -\\newcommand{\\limas}[3]{\\lim\\limits_{#1 \\to #2}{#3}}} -!!! - -!!! -\\newcommand{\\limx}[2]{\\lim\\limits_{x \\to #1}{#2}} -!!! - -!!! -\\newcommand{\\deriv}[2]{\\frac{d}{d#1}\\left(#2\\right)} -!!! - -
-EOF - - -cat $* | sed -Ee 's_\\_\\\\_g' | pandoc --from markdown --to html - -echo "" - diff -r deda525820e3 -r a9e85b8e5f66 bin/pass-work --- a/bin/pass-work Wed Dec 19 10:18:23 2018 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -PASSWORD_STORE_DIR=$HOME/.password-store-work pass "$@" diff -r deda525820e3 -r a9e85b8e5f66 lisp/Makefile --- a/lisp/Makefile Wed Dec 19 10:18:23 2018 -0500 +++ b/lisp/Makefile Wed Dec 19 13:55:03 2018 -0500 @@ -2,10 +2,10 @@ all: binaries/clhs binaries/lispindent -binaries/clhs: clhs.lisp - sbcl --eval '(load "clhs.lisp")' --eval "(build)" --eval "(exit)" +binaries/clhs: clhs.lisp compile + ./compile clhs.lisp mv clhs binaries/clhs -binaries/lispindent: lispindent.lisp - sbcl --no-userinit --eval '(load "lispindent.lisp")' --eval "(build)" --eval "(exit)" +binaries/lispindent: lispindent.lisp compile + ./compile lispindent.lisp --no-userinit mv lispindent binaries/lispindent diff -r deda525820e3 -r a9e85b8e5f66 lisp/_skeleton.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/_skeleton.lisp Wed Dec 19 13:55:03 2018 -0500 @@ -0,0 +1,33 @@ +(ql:quickload '(:adopt)) + +;;;; Config ------------------------------------------------------------------- +(defparameter *default-name* "World") + + +;;;; Functionality ------------------------------------------------------------ +(defun run (name) + (format t "Hello, ~A~%" name)) + + +;;;; CLI ---------------------------------------------------------------------- +(adopt:define-interface *ui* "NAME" + "Say Hello." + ((help) "display help and exit" + :long "help" + :short #\h + :reduce (constantly t)) + ((name) (format nil "say hello to NAME (default ~A)" *default-name*) + :long "name" + :short #\n + :parameter "NAME" + :initial-value *default-name* + :reduce #'adopt:newest)) + +(defun toplevel () + (multiple-value-bind (arguments options) (adopt:parse-options *ui*) + (when (gethash 'help options) + (adopt:print-usage *ui*) + (adopt:exit 0)) + (unless (null arguments) + (cerror "Ignore them" "Unrecognized command-line arguments: ~S" arguments)) + (run (gethash 'name options)))) diff -r deda525820e3 -r a9e85b8e5f66 lisp/clhs.lisp --- a/lisp/clhs.lisp Wed Dec 19 10:18:23 2018 -0500 +++ b/lisp/clhs.lisp Wed Dec 19 13:55:03 2018 -0500 @@ -137,10 +137,3 @@ (format *error-output* "Symbol not found: ~A~%" target) (adopt:exit 1))))))) - -;;;; Build -------------------------------------------------------------------- -(defun build () - (sb-ext:save-lisp-and-die "clhs" - :executable t - :toplevel 'toplevel - :save-runtime-options t)) diff -r deda525820e3 -r a9e85b8e5f66 lisp/compile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/compile Wed Dec 19 13:55:03 2018 -0500 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +LISP=$1 +BINARY=$(basename "$1" .lisp) +shift + +sbcl --load "$LISP" --eval "(sb-ext:save-lisp-and-die \"$BINARY\" :executable t :save-runtime-options t :toplevel 'toplevel)" "$@" diff -r deda525820e3 -r a9e85b8e5f66 lisp/compile-parenscript.ros diff -r deda525820e3 -r a9e85b8e5f66 lisp/lispindent.lisp --- a/lisp/lispindent.lisp Wed Dec 19 10:18:23 2018 -0500 +++ b/lisp/lispindent.lisp Wed Dec 19 13:55:03 2018 -0500 @@ -253,12 +253,7 @@ (incf i)))))))) -(defun main () +(defun toplevel () (source-config-files) (indent-lines) t) - -(defun build () - (sb-ext:save-lisp-and-die "lispindent" - :toplevel 'main - :executable t))