moved from gitlab

This commit is contained in:
Chema Alonso Josa 2022-10-17 22:00:28 +02:00
commit 99dfa32c10
No known key found for this signature in database
GPG Key ID: 297FC75094B25AED
56 changed files with 2624 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.#*
*.swp

22
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,22 @@
before_script:
- apt-get update -y
- apt-get install -y locales
- echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- export LC_ALL="es_ES.utf8"
- apt-get install sbcl tree -y
- wget "https://beta.quicklisp.org/quicklisp.lisp"
- sbcl --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --eval "(quit)"
- echo '#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))' >> "${HOME}/.sbclrc"
- sbcl --load install.lisp
- mkdir "${HOME}/common-lisp"
- ln -s `pwd` "${HOME}/common-lisp/lisperes"
run-tests:
stage: test
script:
- "bin/run-tests.sh"

1
CHANGELOG.org Normal file
View File

@ -0,0 +1 @@
Moved to codeberg.org

30
INSTALL.org Normal file
View File

@ -0,0 +1,30 @@
* Dependencies
** Mandatory
*** [[https://common-lisp.net/project/asdf/][ASDF]]
*** [[https://edicl.github.io/cl-who/][CL-WHO]]
*** [[https://edicl.github.io/hunchentoot/][Hunchentoot]]
*** [[https://www.quicklisp.org/beta/][Quicklisp]]
*** [[https://github.com/Shinmera/LASS][LASS]]
*** [[https://common-lisp.net/project/parenscript/][Parenscript]]
*** [[http://sbcl.org/][SBCL]]
** Not mandatory but recommended for development
*** [[https://www.gnu.org/software/emacs/][GNU Emacs]] and [[https://github.com/joaotavora/sly][SLY]]
*** [[https://common-lisp.net/project/linedit/][Linedit]]
** Testing
*** [[https://github.com/fukamachi/prove][prove]]
* Installation
** Install SBCL for your operating system (Any other LISP implementation should work but not tested)
** Install Quicklisp as described in its official page
** Run sbcl --load install.lisp
** Follow the steps described in the Linedit page to configure it when SBCL starts
** Place this project in a place where ASDF can find it. Read the ASDF manual. Placing it under ~/.local/share/common-lisp/source should do the trick
** Change the parameters defined in file specials.lisp like log and error directories to suit your needs
** Install Emacs for your operating system
** Launch emacs and connect to your inferior lisp (sly)
** If your LISP is running in remote you'll need to start SBCL and run:
*** (require :lisperes)
*** (lisperes:start-slynk)
** Start the webserver:
*** (require :lisperes)
*** (lisperes:start-httpd)
** Point your broser to localhost:4242

19
LICENSE Normal file
View File

@ -0,0 +1,19 @@
Copyright (c) 2012-2022 José María Alonso Josa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
README.org Normal file
View File

@ -0,0 +1 @@
A Lisper site developed with a LISP framework

28
bin/bump-version.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
VERSIONFILE=version.sexp
CHANGELOGFILE="CHANGELOG.org"
PROJECTURL="http://codeberg.org/nimiux/lisperes"
CURRENTVERSION=$(git tag | tail -1)
NEWVERSION=${1}
[ -z "${NEWVERSION}" ] && echo "Usage: $(basename $0) <version>" && exit 1
add_to_top () {
logfile=${1}
temp=$(mktemp)
cat - ${1} > $temp && mv $temp ${1}
}
# Version file
echo ";; -*- lisp -*-" > ${VERSIONFILE}
echo "\"${NEWVERSION}\"" >> ${VERSIONFILE}
# Changelog
touch ${CHANGELOGFILE}
echo | add_to_top ${CHANGELOGFILE}
git log ${CURRENTVERSION}...HEAD --pretty=format:"** [[${PROJECTURL}/commit/%H][%s]]" | add_to_top ${CHANGELOGFILE}
echo "* Version: ${NEWVERSION} $(date +%Y-%m-%d) $(git config --get user.name) <$(git config --get user.email)>" | \
add_to_top ${CHANGELOGFILE}
git commit -am "Bump version to ${NEWVERSION}"

30
bin/deploy.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
SRCDIR="${HOME}/lisperes/"
DSTDIR="${HOME}/common-lisp/lisperes/"
HTDOCSDIR="${SRCDIR}/htdocs/"
PUBLICDIR="${HOME}/public_html/"
syncdir () {
dir=$1
targetdir="${PUBLICDIR}/$dir/"
rsync -avzt --delete "${HTDOCSDIR}/$dir/" "${targetdir}"
find $targetdir -type f -exec chmod 644 {} \;
find $targetdir -type d -exec chmod 755 {} \;
}
deploy () {
rsync -avzt --delete --exclude .git $SRCDIR $DSTDIR
syncdir css
syncdir fonts
syncdir img
}
while : ; do
echo "Waiting for changes in $SRCDIR..."
inotifywait -q ${SRCDIR}
echo "$(date): Changes detected in $SRCDIR. Deploying..."
deploy
sleep 2
done

12
bin/make-dist.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# To make distribution from current code use: version="HEAD"
version="$1"
[ -z "${version}" ] && echo "Usage: $((basename $0)) <version>" && exit 1
base="lisperes-${version}"
rm -vf "${base}".tar{,.bz2}
git archive "--prefix=${base}/" --format=tar -v "--output=${base}.tar" ${version}
bzip2 -v9 "${base}.tar"

16
bin/notify.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
MAILADDRESS=me@me.com
LOGFILE="${HOME}/log/lisperes/cgi.log"
a=$(sha1sum $LOGFILE)
while : ; do
b=$(sha1sum $LOGFILE)
if [ "$a" != "$b" ] ; then
echo "$(date) Notifying... a = $a . b = $b"
echo "Number: $(wc -l $LOGFILE)" | mail -s "Lisper.es" $MAILADDRESS
a=$b
fi
sleep 3600
done

3
bin/run-tests.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
sbcl --eval '(asdf:test-system :lisperes)' --eval '(quit)'

64
cgi/index.cgi Normal file
View File

@ -0,0 +1,64 @@
#!/usr/bin/perl
# Proxy to publish the app
#use LWP::UserAgent;
use warnings;
use DateTime qw( );
use File::Spec;
my ($vol, $dir, $file) = File::Spec->splitpath($ENV{SCRIPT_FILENAME});
my $logfile = "$dir/../log/lisperes/cgi.log";
sub printenvvars {
foreach $key (sort keys(%ENV)) {
print FH "$key = $ENV{$key}\n";
}
}
sub logit {
# TODO: Use interpolation
open(FH, '>>', $logfile) or die "Could not open file '$logfile' $!";
print FH $ENV{REMOTE_ADDR};
print FH " - ";
my $dt = DateTime->now( time_zone => 'local' );
$dt->subtract( days => 7 );
print FH "[";
print FH $dt->strftime("%Y-%m-%d %H:%M:%S");
print FH "] \"";
print FH $ENV{REQUEST_METHOD};
print FH " ";
print FH $ENV{REQUEST_URI};
print FH " ";
print FH $ENV{SERVER_PROTOCOL};
print FH "\" ";
## ....
##127.0.0.1 - [2022-08-28 16:00:04] "GET / HTTP/1.1" 200 7445 "-" "curl/7.68.0"
print FH $ENV{HTTP_USER_AGENT};
print FH "\n";
close FH;
}
#my $uri = $ENV{REQUEST_URI};
#$uri = s/~nimiux//;
# URL
#my $url = URI->new( 'http://127.0.0.1:4242' );
# user agent to use a proxy
#my $user_agent = LWP::UserAgent->new;
#$user_agent->proxy( 'http', 'http://our_proxy:port/' );
# request
#my $req = HTTP::Request->new( GET => "$url/$uri" );
# response
#my $res = $user_agent->request( $req );
# Log it
logit;
# Render content
print "Content-Type: text/html\n\n";
system "curl http://127.0.0.1:4242";
#print $res->content;

1402
db/fortunes.lisp Normal file

File diff suppressed because it is too large Load Diff

76
fortune.lisp Normal file
View File

@ -0,0 +1,76 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
;; Inspired in the book Practical Common Lisp by Peter Seibel
(in-package :lisperes)
(defun make-fortune (category text author item date)
"Creates a fortune"
`(:category ,category :text ,text :author ,author :item ,item :date ,date))
(defun append-fortune (fortunes fortune)
"Appends a fortune to the end of a list of fortunes"
(append fortunes (list fortune)))
(defun pick-fortune (fortunes)
"Picks a fortune randomly"
(nth (random (length fortunes)) fortunes))
(defun where (&key category text author item date)
"Query fortune"
#'(lambda (fortune)
(and
(if category (equal (getf fortune :category) category) t)
(if text (equal (getf fortune :text) text) t)
(if author (equal (getf fortune :author) author) t)
(if item (equal (getf fortune :item) item) t)
(if date (equal (getf fortune :date) date) t))))
(defun select (selector-fn fortunes)
"Use a selector to locate a fortune"
(remove-if-not selector-fn fortunes))
(defun read-file (filename)
"Read fortunes from file"
(with-open-file (stream filename :direction :input)
(with-standard-io-syntax
(read stream))))
(defun save-file (filename data)
"Save fortunes to file"
(with-open-file (stream filename :direction :output :if-exists :supersede)
(with-standard-io-syntax
(print data stream))))
(defun prompt-read (prompt)
"Read string from terminal"
(format *query-io* "~a: " prompt)
(force-output *query-io*)
(read-line *query-io*))
(defun prompt-for-fortune ()
"Makes a fortune from input data"
(make-fortune
(prompt-read "Category")
(prompt-read "Text")
(prompt-read "Author")
(prompt-read "Item")
(prompt-read "Date")))
(defun print-fortunes (fortunes)
"Prints all fortunes"
(dolist (fortune fortunes)
(format t "~{~a:~10t~a~%~}~%" fortune)))
(defun say-fortune (fortunes)
"Prints a random fortune"
(let ((fortune (pick-fortune fortunes)))
(format nil "~a~%-- ~a --" (getf fortune :text) (getf fortune :author))))
(defun add-fortune (fortunes-filename)
"Adds a fortune to the fortunes file"
(let ((fortunes (read-file fortunes-filename)))
(setf fortunes (append-fortune fortunes (prompt-for-fortune)))
(save-file fortunes-filename fortunes)))

139
htdocs/css/style.css Normal file
View File

@ -0,0 +1,139 @@
:root {
--header_color: rgb(45, 55, 80);
--footer_color: rgb(45, 55, 80);
}
@font-face {
font-family: 'OpenSans';
src: url('../fonts/OpenSans/OpenSans-Regular.ttf') format('truetype');
}
* {
box-sizing: border-box;
overflow-wrap: break-word;
}
hr {
height: 0;
border-width: 0;
border-top: .0625rem dotted #a0a0a0;
}
a {
color: orangered; /* orange */
text-decoration: none;
cursor: pointer; /* even if no href */
}
a:hover,
a:active,
a:focus {
color: yellowgreen;
}
ul,
ol {
margin: 1rem 0;
padding-inline-start: 1.5rem;
}
ol {
list-style-type: decimal;
}
ul {
list-style-type: disc;
}
ul ul {
list-style-type: circle;
}
ul ul ul {
list-style-type: square;
}
dl {
margin: 1rem 0 1rem 2rem;
}
dt {
margin: 1rem 0;
font-weight: bold;
}
dd {
margin: 1rem 0;
}
.html {
background-color: rgb(50, 60, 90);
font-family: 'OpenSans', Helvetica, Arial, sans-serif;
font-size: 1em;
}
.body {
line-height: 1.3333;
color: #eeeeee;
flex-direction: column;
}
.responsive {
width: 80%;
height: auto;
display: block;
margin: auto;
padding: 2em;
}
/* smartphone */
@media (pointer:none), (pointer:coarse) {
.responsive {
width: 100%;
height: auto;
}
}
.copyright {
text-align: center;
display: block;
margin: auto;
}
#header {
background-color: red;
display: grid;
grid-template-columns: auto;
background-color: var(--header_color);
padding: 1em;
}
#fortune {
width: 80%;
margin: auto;
padding: 1em;
color: black;
margin-bottom: 1em;
border: .2em;
border-style: solid;
border-color: black;
border-radius: .9em;
background-color: rgb(244, 43, 255);
}
#footer {
display: grid;
grid-template-columns: auto;
background-color: var(--footer_color);
padding: 1em;
}
.footer-element {
padding: 1em;
font-size: 1em;
text-align: center;
}

9
htdocs/errors/404.html Normal file
View File

@ -0,0 +1,9 @@
<html>
<head>
<title>Not found</title>
</head>
<body>
<h2>Resource ${script-name} not found.</h2></br>
<img src="/img/lambda-y.png"/>
</body>
</html>

18
htdocs/errors/500.html Normal file
View File

@ -0,0 +1,18 @@
<html>
<head>
<title>Internal Server Error</title>
</head>
<body>
<h1>Internal Server Error</h1>
An error occurred while processing your ${script-name} request.
<hr/>
<h1>Error Message</h1>
<pre>${error}</pre>
<h1>Backtrace</h1>
<pre>${backtrace}</pre>
<hr/>
<a href="http://weitz.de/hunchentoot">Hunchentoot</a> ${hunchentoot-version} running on ${lisp-implementation-type} ${lisp-implementation-version}
<hr/>
<img src="/img/lambda-y.png"/>
</body>
</html>

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

189
htdocs/humans.txt Normal file
View File

@ -0,0 +1,189 @@
/* TEAM */
Head: Chema Alonso Josa
Contact: nimiux@tutanota.com
Linkedin: https://www.linkedin.com/in/chemaalonsojosa
From: Earth
/* THANKS */
Mom, Dad & Kids
Sebastian Krajenski
Abelson, Hal
Andreessen, Marc Lowell
Aho, Alfred
Aiken, Howard
Allman, Eric
Allen, Paul
Armstrong, Joe
Babbage, Charles
Backus, John
Baer, Ralph
Barski M.D., Conrad
Bechtolsheim, Andy
Behlendorf, Brian
Berners-Lee, Tim
Boole, George
Bos, Bert
Bourne, Steve
Brin, Sergey
Bushnel, Nolan
Canion, Rod
Carnegie, Andrew
Catmull, Ed
Church, Alonzo
Cobartó, Fernando José
Codd, Edgar
Colley, Steve
Colmerauer, Alain
Cook, Stephen Arthur
Corbett, Bob
Crockford, Douglas
Curry, Haskell Brooks
Curry, Christopher
Dahl, Ole-Johan
Daniels, Steve
Draper, John
Dijkstra, Edsger
Eich, Brendan
Ellis, Jim
Ellison, Lawrence
Englebart, Douglas
Engressia, Joseph Carl
Ewing, Marc
Feldman, Stuart
Felsenstein, Lee
Fraser, Sandy
Gates, William
Gettys, Jim
Goldman, Jack
Gosling, James
Greenspun, Philip
Grimes, Rasmusodney
Gutmans, Andy
Hamming, Richard W.
Harris, Jim
Hart, Michael S
Hart, Timothy
Hecker, Frank
Henderson, Peter
Hennesey, John L.
Hewitt, Carl
Hewlett, William R.
Higinbotham, William
Hoare, Tony
Holub, Allen
Hopper, Grace Murray
Hopcroft, John E.
Hoyte, Doug
Hubbard, Jordan
Jobs, Steve
Johnson, Stephen C.
Joy, William
Kaplan, Larry
Kay, Alan
Kemeny, John G.
Kernighan, Brian
Kildall, Gary
Kimball, Spencer
Kleinrock, Leonard
Knuth, Donald
Khosla, Vinod
Teuvo, Kohonen
Kurtz, Thomas
Lampson, Butler
Lerdorf, Rasmus
Lesk, Michael
Levin, Mike
Limpkin, Fred
Lovelace, Ada
Mattis, Peter
McCarthy, John
McKusick, Kirk
McCulloch, Warren
Mcilroy, Doug
McNealy, Scott
Mealy, G. H.
Meyer, Bertrand
Michels, Doug
Michels, Larry
Milner, Robin
Mims, Forrest
Miner, Jay
Minsky, Marvin
Mitnick, Kevin David
Moore, Edward F.
Morris, Robert Tappan
Morris, Noel
Murdock, Ian
Murto, Bill
Naur, Peter
Nielsen, Jakob
Ousterhout, John
Nygaard, Kristen
Packard, David
Page, Larry
Papert, Seymour
Paxson, Vern
Perens, Bruce
Perlis, Alan
Petri, Carl Adam
Pike, Robert
Pitts, Walter
Ragazzini, John R.
Raskin, Jeff
Ray, Alvy
Raymond, Eric
Ritchie, Dennis
Roberts, Edgar
Robbins, Daniel
Rochester, Nathaniel
Rosenthal, David
Russell, Steve
Schmidt, Eric
Schönfinkel, Moses
Shannon, Claude
Simony, Charles
Sinclair, Clive
St. Jonh, Alex
Stallman, Richard
Steele, Guy L.
Strachey, Christopher
Stroustrup, Bjarne
Suraski, Zeev
Sussman, Gerald J.
Szpakwoski, Mark
Taylor, Robert
Thompson, Ken
Tiemann, Michael
Tomlinson, Ray
Torvalds, Linus
Tramiel, Jack
Truscott, Tom
Turing, Alan
Turner, David
Ullman, Jeffrey
Van Rossum, Guido
Van Vleck, Tom
Vixie, Paul
Volkerding, Patrick
Von Neumann, John
Wall, Larry
Wang, An
Wayne, Ronald
Wei, Pei-Yuan
Weitz, Edmun
Weinberger, Peter
Wiener, Norbert
Williams, Nate
Wirth, Niklaus
Wium Lie, Håkon
Wozniak, Stephen
Zadeh, Lotfi Askar
Zuse, Konrad
/* SITE */
Last update: 2022/06/13
Language: English
DocType: HTML
Software: SBCL, Sly, Hunchentoot, Perl, tmux
Editor: Emacs

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
htdocs/img/gentoo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
htdocs/img/lambda-y.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 KiB

BIN
htdocs/img/lisp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

BIN
htdocs/img/lisp_cycles.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

10
install.lisp Normal file
View File

@ -0,0 +1,10 @@
;;; Dependencies
(ql:quickload "cl-who")
(ql:quickload "hunchentoot")
(ql:quickload "lass")
(ql:quickload "parenscript")
;;; Needed for testing
(ql:quickload "prove")
;;; Needed for development
(ql:quickload "linedit")
(ql:quickload "slynk")

51
lisperes.asd Normal file
View File

@ -0,0 +1,51 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
#-(or sbcl)
(warn "This system hasn't been tested in your lisp implementation")
(in-package :cl-user)
(defpackage :lisperes-asd
(:use :cl :asdf))
(in-package :lisperes-asd)
(defsystem :lisperes
:serial t
:version (:read-file-form "version.sexp")
:description "Web app written in Common Lisp"
:author "Chema Alonso Josa <nimiux@tutanota.com>"
:maintainer "Chema Alonso Josa <nimiux@tutanota.com>"
:licence "UNLICENSE"
:depends-on (:cl-who
:hunchentoot
:lass
:parenscript
:slynk
:swank
:linedit)
:components ((:static-file "version.sexp")
(:static-file "README.org")
(:static-file "CHANGELOG")
(:static-file "INSTALL.org")
(:static-file "UNLICENSE")
(:static-file "db/fortunes")
(:file "package")
(:file "specials")
(:file "fortune")
(:file "pages")
(:file "lisperes")
(:file "install"))
:in-order-to ((test-op (test-op lisperes/test))))
(defsystem :lisperes/test
:description "Self test functionality for this web application."
:depends-on (:lisperes
:prove)
:defsystem-depends-on (:prove-asdf)
:components ((:file "test/package")
(:test-file "test/tests"))
:perform (test-op :after (op c)
(funcall (intern #.(string :run) :prove) c)))

55
lisperes.lisp Normal file
View File

@ -0,0 +1,55 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :lisperes)
; The Hunchentoot logic goes in here
; this can be just a simple package loading
; calling some methods or it might be something else
(define-easy-handler (lisperes :uri "/") ()
(index-page "Lisperes"))
(define-easy-handler (fortune :uri "/sayfortune") ()
(say-fortune *fortunes*))
(define-easy-handler (robots :uri "/robots.txt") ()
(robots-page))
(define-easy-handler (repl :uri "/repl") ()
(repl))
;; Sly
(let ((slynk-instance))
(defun start-slynk ()
"Starts slynk server"
(setf slynk-instance (slynk:create-server :port *listening-port* :dont-close t)))
(defun stop-slynk ()
"Stops slynk server"
(slynk:stop-server slynk-instance)))
;; Swank
(let ((swank-instance))
(defun start-swank ()
"Starts swank server"
(setf swank-instance (swank:create-server :port *listening-port* :dont-close t)))
(defun stop-swank ()
"Stops swank server"
(swank:stop-server swank-instance)))
(setf hunchentoot:*show-lisp-errors-p* t)
;; HTTPD instance
(let ((httpd-instance (make-instance 'hunchentoot:easy-acceptor
:address *httpd-address*
:port *httpd-port*
:document-root *document-root*
:access-log-destination *access-log*
:message-log-destination *message-log*
:error-template-directory *error-template-directory*)))
(setf *fortunes* (read-file *fortunes-filename*))
(defun start-httpd ()
(hunchentoot:start httpd-instance))
(defun stop-httpd ()
(hunchentoot:stop httpd-instance)))

13
package.lisp Normal file
View File

@ -0,0 +1,13 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :cl-user)
(defpackage #:lisperes
(:use :cl :hunchentoot :cl-who :slynk)
(:export #:start-slynk
#:stop-slynk
#:start-httpd
#:stop-httpd))

176
pages.lisp Normal file
View File

@ -0,0 +1,176 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :lisperes)
(setf (html-mode) :html5)
(setf parenscript::*js-string-delimiter* #\")
(defun fortune-css ()
(lass:compile-and-write
`("#fortune" :width "80%"
:margin "auto"
:padding "20px"
:background-color "#f44336"
:color "white"
:margin-bottom "15px"
:border "5px"
:border-style "solid"
:border-color "black"
:border-radius "20px"
:background "red")))
(defun rest-css ()
(lass:compile-and-write
`("#rest" :text-align "center")))
(defun count-lines (file)
"Count lines in a file"
(let ((counter 0)
(in (open file :if-does-not-exist nil)))
(when in
(loop for line = (read-line in nil)
while line do (setf counter (1+ counter)))
(close in)
counter)))
(defparameter *core-images*
'(("http://xkcd.com/224/" "https://imgs.xkcd.com/comics/lisp.jpg" "Lisp" "http://xkcd.com/224/")
("http://0xbabaf000l.blogspot.com.es/" "https://2.bp.blogspot.com/_P6813spMtmM/Sk9HQBYU_bI/AAAAAAAABDU/R-rsdDA9YQE/s1600/0010_en_vi-vs-emacs.png" "vi vs emacs" "0xbabaf000l")
("http://xkcd.com/297/" "https://imgs.xkcd.com/comics/lisp_cycles.png" "Lisp cycles" "http://xkcd.com/297/")
("https://www.reddit.com/r/lisp/comments/aqcqx/how_a_common_lisp_programmer_views_users_of_other/" "https://external-preview.redd.it/38BV_S1bnar7v2ih0t9Jn0dGPQGHpogw9coRn97b7-g.jpg?auto=webp&s=2f9f89f1b56487acc7cff9244df9c5cbe6ab5935" "How a Common Lisp programmer views users of other languages" "© http://vintage-digital.com/hefner/misc/lisp-programmers.jpg")
("http://xkcd.com/378/" "https://imgs.xkcd.com/comics/real_programmers.png" "Real programmers" "http://xkcd.com/378/")
("https://toggl.com/blog/save-princess-8-programming-languages" "https://toggl.com/blog/wp-content/uploads/2018/04/toggl-how-to-save-the-princess-in-8-programming-languages-0c32e93f47f3f6401913846c4c184e3e.jpg" "How to save the Princess" "2016 Mark Virkus")
("https://toggl.com/blog/programming-languages-explained-with-music-comic" "https://toggl.com/blog/wp-content/uploads/2019/07/programming-explained-with-music-toggl.jpg" "Programming explained as music" "2019 Mark Virkus")
("https://toggl.com/blog/programming-languages-games" "https://toggl.com/blog/wp-content/uploads/2020/08/toggl-programming-languages-as-games_1-721x1024.jpg" "Programming languages as games" "Mark Virkus")
("https://forums.scotsnewsletter.com/index.php?/topic/94361-man-loses-will-to-live-during-gentoo-install/" "img/gentoo.png" "Gentoo increasing blood pressure since 1999" "")))
(defmacro image (link src alt class)
`(htm (:a :href ,link
(:img :src ,src
:alt ,alt
:class ,class))))
(defmacro unordered-list (items)
`(htm (:ul
(loop for (link . title) in ,items
do (htm (:li (:a :href link (str title))))))))
(defun index-page (title)
"Index page"
(with-html-output-to-string
(*standard-output* nil :prologue t :indent t)
(:html :class "html"
(:head
(:title title)
(:meta :http-equiv "content-type" :content "text/html; charset=UTF-8")
(:meta :charset "utf-8")
(:meta :name "viewport" :content "width=device-width, initial-scale=1")
(:link :rel "author" :href "humans.txt")
(:link :rel "shortcut icon" :href "/img/lambda-y.png")
(:link :rel "stylesheet" :type "text/css" :href "css/style.css"))
;; (:style (str (fortune-css))
;; (str (rest-css))))
(:body :class "body"
(:blockquote "")
(:div :id "header"
(:div :id "fortune"
"#"
(str (count-lines *access-log*))
(:nbsp)
(str (say-fortune *fortunes*))))
(:div :id "core"
(loop for img in *core-images*
do (progn (image (first img)
(second img)
(third img)
"responsive")
(htm (:p :class "copyright" (str (conc "©" (fourth img)))))))
(:p "Contact")
(:hr)
(unordered-list
'(("https://es.linkedin.com/in/chemaalonsojosa" . "LinkedIn")
("https://codeberg.org/nimiux" . "Codeberg")))
(:p "Personal web pages")
(:hr)
(unordered-list
'(("http://www.educa2.madrid.org/web/jose.alonsojosa" . "EducaMadrid")
("http://es.wikipedia.org/wiki/Usuario:Alonsojosa" . "Wikipedia")))
(:p "Webcams")
(:hr)
(unordered-list
'(("http://www.restaurantebarlabodeguilla.com/camara/gredos.jpg" . "Gredos")
("http://www.refugiolagunagrandegredos.es/?page_id=1114" . "Laguna Grande de Gredos")
("http://grupogredos.com/index.php/webcam-victory/" . "Victory")
("http://webcam.valdeon.org/devisionnetwok.jpg" . "Valdeón")
("https://cantur.com//camaras/home/cantucom/public.html/camaras/fuentede.jpg" . "Fuente Dé")
("https://www.webcamsdeasturias.com/asturias/oriente/cangas-de-onis/cangas-de-onis/lagos-de-covadonga-lago-enol/159/" . "Lago Enol")
("https://www.webcamsdeasturias.com/asturias/refugio-de-urriellu/cabrales/bulnes/refugio-del-urriellu/135/" . "Picu Urriellu")
("https://www.hispacams.com/webcams/webcam-vega-de-ario-refugio-vega-ario-marques-villaviciosa-222.html?fbclid=IwAR0jEMOtlkH1nr3qsTVbHzqnvpVg-oRD-COEXLPHP7Ba52HsJsn8Wa4eeX4" . "Vega de Ario")
("https://babia.net/webcam" . "San Emiliano")
("https://www.youtube.com/watch?v=tH13XPt1Mn8" . "Collado Jermoso")
("https://www.hispacams.com/get_imagen_ws.php?id=53" . "Camarmeña")
("https://www.hispacams.com/get_imagen_ws.php?id=140" . "Amieva")
("http://www.refugiodelmeicin.es/webcam/image.jpg" . "Meicín")
("http://www.refugiodelmeicin.es/webcam/image2.jpg" . "Meicín 2")
("http://www.curavacas.es/cam" . "Curavacas")
("https://aviaciondeportiva.senasa.es/camarasIP/CamaraOcanaHangar/camHangar000M.jpg" . "Ocaña")))
(:p "Common Lisp resources and books")
(:hr)
(unordered-list
'(("http://mitpress.mit.edu/sicp" . "Structure and Interpretation of Computer Programs")
("http://www.paulgraham.com/onlisp.html" . "On Lisp by Paul Graham")
("http://www.defmacro.org/ramblings/lisp.html" . "The Nature of Lisp")
("https://common-lisp.net/" . "Common-Lisp.net")
("http://www.cliki.net/index" . "The Common Lisp Wiki")
("http://www.lispworks.com/documentation/HyperSpec/Front/index.htm" . "Common Lisp HyperSpec")
("http://articulate-lisp.com/" . "Articulate Common Lisp")
("http://lisp-lang.org/" . "Common Lisp")
("https://lispcookbook.github.io/cl-cookbook/" . "Common Lisp Cookbook")
("https://www.cs.cmu.edu/Groups/AI/util/html/cltl/cltl2.html" . "Common Lisp the Language, 2nd edition by Guy L. Steel")
("http://www.gigamonkeys.com/book/" . "Practical Common Lisp by Peter Seibel")
("https://letoverlambda.com/" . "Let Over Lambda by Doug Hoyte")
("http://landoflisp.com/" . "Land of Lisp by Conrad Barski")))
(:p "Obsoleted links")
(:hr)
(unordered-list
'(("https://wiki.gentoo.org/wiki/User:Nimiux" . "Gentoo")
("http://cia.vc/stats/author/nimiux" . "Cia.vc"))))
(:div :id "footer"
(:div :class "footer-element"
(image "http://lisperati.com/"
"img/lisplogo_warning_128.png"
"Made with lisp logo"
""))
(:div :class "footer-element"
(image "https://codeberg.org/"
"img/codeberg.org-logo.png"
"Codeberg logo"
"")
(image "humans.txt"
"img/humans.txt-logo.png"
"Humans.txt logo"
"")
(image "https://freeshell.de"
"img/freeshell.de-logo.png"
"Freeshell.de logo"
""))
(:div :class "footer-element"
(:a :href "#"
:onclick (parenscript:ps (alert "Welcome!"))
"© 2000-2022 Chema Alonso Josa")))))))
(defun robots-page ()
"robots.txt page"
(format nil "User-agent: *~%Disallow:"))
(defun repl ()
(with-html-output-to-string
(*standard-output* nil :prologue t :indent t)
(:html
(:head
(:meta :char-set "utf-8"))
(:body
(:h2 "Jank REPL")))))

25
specials.lisp Normal file
View File

@ -0,0 +1,25 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :lisperes)
;; HTTP server configuration
(defparameter *httpd-address* "127.0.0.1")
(defparameter *httpd-port* 4242)
(defparameter *app-root* (merge-pathnames #P"common-lisp/lisperes/" (user-homedir-pathname)))
(defparameter *document-root* (merge-pathnames #P"common-lisp/lisperes/htdocs/" (user-homedir-pathname)))
(defparameter *log-dir* (namestring (make-pathname :directory (namestring (user-homedir-pathname)) :name "log/lisperes")))
(defparameter *access-log* (make-pathname :directory *log-dir* :name "access" :type "log"))
(defparameter *message-log* (make-pathname :directory *log-dir* :name "messages" :type "log"))
(defparameter *error-template-directory* (merge-pathnames #P"errors/" *document-root*))
;; The port SBCL will be listening for shutdown. Not used ATM
;(defparameter *shutdown-port* 6200)
;; The port used for remote interaction with the server through slime or slynk
(defparameter *listening-port* 4005)
;; Fortunes
(defparameter *fortunes-filename* (make-pathname :directory (namestring (merge-pathnames #P"db/" *app-root*)) :name "fortunes" :type "lisp"))
(defvar *fortunes*)

8
test/package.lisp Normal file
View File

@ -0,0 +1,8 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :cl-user)
(defpackage #:lisperes/test
(:use :cl :prove))

21
test/tests.lisp Normal file
View File

@ -0,0 +1,21 @@
;;; -*- mode: Lisp; show-trailing-whitespace: t; indent-tabs-mode: t; -*-
;;; Copyright (c) 2012-2022. José María Alonso Josa. All rights reserved
(in-package :lisperes/test)
(defparameter *test-suite*
`((ok (not (find 4 '(1 2 3))))
(is 4 4)
(isnt 1 #\1)))
(defun run-tests (tests)
(not (some #'null (mapcar #'eval tests))))
(plan (length *test-suite*))
(defparameter *exit-code* (if (run-tests *test-suite*)
0
1))
(finalize)
(sb-ext:exit :code *exit-code*)

2
version.sexp Normal file
View File

@ -0,0 +1,2 @@
;; -*- lisp -*-
"1.3"