# TODO:
# * Add page attachment mechanism
-# * Add edit shortcut
# * Add save shortcut
# * Add a create method
# * Add a delete method
EDIT_SCRIPT = <<-eos
<script>
(() => {
- const keys = { "e": () => { window.location = window.location + "?edit=true" } };
+ const keys = {
+ "e": () => { window.location = window.location + "?edit=true"; },
+ "s": () => { window.location = "/sitemap.html"; }
+ };
document.onkeydown = (ev) => (!!keys[ev.key] ? (keys[ev.key])(ev) : true);
})();
</script>
eos
+def html_path(src)
+ src.sub(/\.([^.]*)$/, '.html').sub(/^#{PAGES_DIR}/, HTML_DIR)
+end
+
+def page_path(path)
+ (PAGES_DIR + path).sub(/^\/html\//,'').sub(/\.html$/, ".md")
+end
+
class Page
def initialize(src)
@markdown = (File.exist?(src) ? File.read(src) : "")
genpage(nil, f, true)
end
FileUtils.cp_r(Dir.glob("files/*"), HTML_DIR)
+ gensitemap()
end
def gensitemap()
def genpage(path, src, force=false)
html = ""
- htmlfile = src.sub(/\.([^.]*)$/, '.html').sub(/^#{PAGES_DIR}/, HTML_DIR)
+ htmlfile = html_path(src)
puts "#{src} -> #{htmlfile}"
if not FileUtils.uptodate?(htmlfile, [src, VIEW_TEMPLATE]) or force
FileUtils.mkdir_p(File.dirname(htmlfile))
end
def do_post(req, res, path)
- page_path = (PAGES_DIR + req.path).sub(/\.html$/, '.md')
+ page_path = page_path(path)
FileUtils.mkdir_p(File.dirname(page_path))
- markup = req.query["markup"].gsub(/<br\/?>/,"\n").gsub("\r\n","\n").gsub(/</,"<").gsub(/>/,">")
+ markup = req.query["markup"].gsub("\r\n","\n").gsub(/</,"<").gsub(/>/,">")
File.open(page_path, "wb") {|f| f.write(markup) }
res.status = 302
res["Location"] = req.path
def do_get(req, res, path)
if path.end_with?(".html")
- page_path = PAGES_DIR + path.sub(/^\/html\//,'').sub(/\.html$/, ".md")
+ page_path = page_path(path)
if (req.query["edit"] == "true") || (not File.exist?(page_path))
do_edit(req, res, path, page_path)
else
# Generate all pages from scratch
genallpages()
-$server = WEBrick::HTTPServer.new(
- :Port => SERVER_PORT,
- :SSLEnable => false,
- :DocumentRoot => HTML_DIR,
- :ServerAlias => 'localhost'
-)
-
-$server.mount_proc '/' do |req, res|
- rqtype = req.request_method
- path = (req.path.end_with?("/") ? req.path + "index.html" : req.path)
- if rqtype == "GET"
- do_get(req, res, path)
- elsif rqtype == "POST"
- do_post(req, res, path)
+if ARGV.length > 0 then
+ $server = WEBrick::HTTPServer.new(
+ :Port => SERVER_PORT,
+ :SSLEnable => false,
+ :DocumentRoot => HTML_DIR,
+ :ServerAlias => 'localhost'
+ )
+
+ $server.mount_proc '/' do |req, res|
+ rqtype = req.request_method
+ path = (req.path.end_with?("/") ? req.path + "index.html" : req.path)
+ if rqtype == "GET"
+ do_get(req, res, path)
+ elsif rqtype == "POST"
+ do_post(req, res, path)
+ end
end
-end
-trap 'INT' do
- $server.shutdown
- genallpages()
+ trap 'INT' do
+ $server.shutdown
+ # genallpages()
+ end
+ $server.start
end
-$server.start
-
};
(() => {
const keys = {
- "Enter": () => !document.execCommand("insertText", false, "\r\n"),
+ "Enter": () => !document.execCommand("insertText", false, "\n"),
"Tab": () => !document.execCommand("insertText", false, " "),
};
editor.onkeydown = (ev) => (!!keys[ev.key] ? (keys[ev.key])(ev) : true);
<title>
<%= @site_title + (@page_title.nil? ? "" : " - #{@page_title}") %>
</title>
- <link rel="shortcut icon" type="image/x-icon" href="./logo.png" />
+ <link rel="shortcut icon" type="image/x-icon" href="/logo.png" />
<style>
body {
font-family: Verdana, Geneva, sans-serif;
* Execution in a virtual machine
## Reference Material
-https://www.erlang.org/docs
+* https://www.erlang.org/docs
+* http://www.cse.chalmers.se/edu/year/2009/course/TDA381_Concurrent_Programming/ARCHIVE/VT2009/general/languages/armstrong-erlang_history.pdf
**Type System:** None<br/>
**Memory Management:** Manual<br/>
+## References
+* http://www.ultratechnology.com/forth.htm
+* http://www.patorjk.com/programming/articles/forththoughts.htm
--- /dev/null
+# Game Programming
+* https://github.com/a1studmuffin/SpaceshipGenerator
# Notes
-This section of the site is constructed as a wiki (using [awiki](https://git.mdlowis.com/?p=projs/awiki.git;a=summary)). As such, it is a chaotic mess of notes, musings, and useful links. Enter at your own risk...
+This section of the site is constructed as an informal wiki (using [awiki](https://git.mdlowis.com/?p=projs/awiki.git;a=summary)). As such, it is a chaotic mess of notes, musings, and useful links. Enter at your own risk...
-## Frequently Accessed
+## General Programming
* [Programming Languages](proglangs.html)
+* [C Programming Rules](c_style.html)
+* [Game Programming](game_prog.html)
## Writing
* [Article Ideas](article_ideas.html)
* [Recipes](recipes.html)
* [FPGA Development](misc/fpga_dev.html)
* [Open Source Programs](misc/open_source.html)
-
-## General Programming
-* [C Programming Rules](c_style.html)
+* [Zettelkasten](misc/zettelkasten.html)
--- /dev/null
+# Lua
+## References
+https://www.lua.org/doc/jucs05.pdf
* [Pick](https://github.com/mptre/pick) - Fuzzy picker, inspiration for the fuzzy picker in tide
* [Nushell](https://www.nushell.sh/book/en/table_of_contents.html) - interesting new command shell with piping of data and metadata
-* [ES Shell)(https://github.com/wryun/es-shell) - An extensible shell with higher order functions
+* [ES Shell](https://github.com/wryun/es-shell) - An extensible shell with higher order functions
--- /dev/null
+# Zettelkasten
+
+An interesting approach to note taking that has similarities to a wiki. Should investigate making awiki support some of the ideas here:
+
+* https://zettelkasten.de/tools/
+* https://writingcooperative.com/zettelkasten-its-like-gtd-for-writing-and-here-s-why-you-should-consider-it-7dddf02be394
+* https://neuron.zettel.page/
* [OCaml](ocaml.html)
* [Oberon 07](oberon07.html)
* [Forth](forth.html)
+* [Lua](lua.html)
+
+## Compiler Design
+* https://inf.ethz.ch/personal/wirth/CompilerConstruction/index.html
+* https://inf.ethz.ch/personal/wirth/ProjectOberon/index.html
## Runtime Design
* [ZINC Abstract Machine](zam.html)
+
+## Immutability
+* https://www.manning.com/books/grokking-simplicity
## Predicates
## Branches and Conditional Branches
+
+## References
+* https://caml.inria.fr/pub/papers/xleroy-zinc.pdf
--- /dev/null
+# Archived Projects
+No longer developed but still contain useful bits of code.
+
+* [acc](https://git.mdlowis.com/?p=archive/acc.git;a=summary) -
+ Aardvark chat client - terminal based [xmpp](https://en.wikipedia.org/wiki/XMPP) chat client
+* [afm](https://git.mdlowis.com/?p=archive/afm.git;a=summary) -
+ Aardvark file manager - A terminal based file manager
+* [atc](https://git.mdlowis.com/?p=archive/atc.git;a=summary) -
+ Algebraic type generator for C
+* [bci](https://git.mdlowis.com/?p=archive/bci.git;a=summary) -
+ A distributed [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) script written in the bash scripting language.
+* [bitbucket](https://git.mdlowis.com/?p=archive/bitbucket.git;a=summary) -
+ Random collection of scripts, code, and notes.
+* [bshuffle](https://git.mdlowis.com/?p=archive/bshuffle.git;a=summary) -
+ QT based application for shuffling a list of items into equal sized groups.
+* [build-system](https://git.mdlowis.com/?p=archive/build-system.git;a=summary) -
+ Build scripts based on RScons for a variety of different projects.
+* [carl](https://git.mdlowis.com/?p=archive/carl.git;a=summary) -
+ C advanced runtime library
+* [cork](https://git.mdlowis.com/?p=archive/cork.git;a=summary) -
+ Memory leak detector for C++
+* [dlang-scm](https://git.mdlowis.com/?p=archive/dlang-scm.git;a=summary) -
+ Experimental programming language implemented in scheme.
+* [dlang](https://git.mdlowis.com/?p=archive/dlang.git;a=summary) -
+ Experimental programming language
+* [gapbuf](https://git.mdlowis.com/?p=archive/gapbuf.git;a=summary) -
+ Simple [gap buffer](https://en.wikipedia.org/wiki/Gap_buffer) implemented in C
+* [gc_obj](https://git.mdlowis.com/?p=archive/gc_obj.git;a=summary) -
+ Reference counted smart pointer implementation.
+* [parse-utils](https://git.mdlowis.com/?p=archive/parse-utils.git;a=summary) -
+ C++ library for building recursive descent parsers.
+* [tide-hl](https://git.mdlowis.com/?p=archive/tide-hl.git;a=summary) -
+ Syntax highlighting engine for tide
+* [tide-ocaml](https://git.mdlowis.com/?p=archive/tide-ocaml.git;a=summary) -
+ Minimal text editor inspired by Acme written in OCaml
+* [vim_config](https://git.mdlowis.com/?p=archive/vim_config.git;a=summary) -
+ Custom vim configuration files
\ No newline at end of file
# Projects
+I have a large number of side projects and ideas that I am exploring. In order to keep these things organized, I split these projects up into three distinct categories as defined below:
-## Active Projects
-Projects being actively used and/or updated.
+* [Projects](projects/): Matured ideas that have moved past the proof of concept phase and may even be in active use.
+* [Prototypes](prototypes/): Ideas that are half-baked or still in the proof of concept phase. Not mature enough to really be used for anything useful but mainly used to explore an idea's viability.
+* [Archived](archived/): These projects are abandoned and unmaintained but still may contain useful ideas or snippets of code that may be reused.
-* [tide](https://git.mdlowis.com/?p=projs/tide.git;a=summary) -
- A minimal graphical text editor inspired by [Acme](http://doc.cat-v.org/plan_9/4th_edition/papers/acme/)
-* [awiki](https://git.mdlowis.com/?p=projs/awiki.git;a=summary) -
- A minimal personal wiki engine for authoring static websites.
-* [alib](https://git.mdlowis.com/?p=projs/abt.git;a=summary) -
- A collection of [header-only](https://en.wikipedia.org/wiki/Header-only) libraries for C
-* [atf](https://git.mdlowis.com/?p=projs/atf.git;a=summary) -
- A minimal unit testing framework for C distributed as a header-only library.
-
-## Dormant Projects
-Projects that are "finished" but no longer used or updated (for now). From time to time these projects may be revived or their ideas will feed into new projects.
-
-* [abt](https://git.mdlowis.com/?p=projs/abt.git;a=summary) -
- A simple [Scons](https://scons.org/)/[RScons](https://github.com/holtrop/rscons) inspired build system written in Bash.
-* [onward](https://git.mdlowis.com/?p=projs/onward.git;a=summary) -
- Forth-like language implemented in C99
-* [opts](https://git.mdlowis.com/?p=projs/opts.git;a=summary) -
- Minimal command-line option parser library for C
-* [libcds](https://git.mdlowis.com/?p=projs/libcds.git;a=summary) -
- A collection of common data structures and algorithms implemented in C99.
-
-## Prototypes and Half-Baked Ideas
-These might do something useful. They might also make your computer explode.
-
-* [acc](https://git.mdlowis.com/?p=proto/acc.git;a=summary) -
- A shell script wrapper around the system C compiler
-* [albase](https://git.mdlowis.com/?p=proto/albase.git;a=summary) -
- Experimental Linux distro with a focus on simplicity and efficiency.
-* [gir](https://git.mdlowis.com/?p=proto/gir.git;a=summary) -
- Experimental programming language
-* [iwe](https://git.mdlowis.com/?p=proto/iwe.git;a=summary) -
- Integrated work environment - custom forks of [suckless](https://suckless.org)
- tools for personal use
-* [journal](https://git.mdlowis.com/?p=proto/journal.git;a=summary) -
- Minimal single-page web app implementing a journal
-* [jstoys](https://git.mdlowis.com/?p=proto/jstoys.git;a=summary) -
- Collection of minimal web games/demos written from scratch
-* [kanban](https://git.mdlowis.com/?p=proto/kanban.git;a=summary) -
- Minimal single-page web app implementing a [Kanban board](https://en.wikipedia.org/wiki/Kanban_board)
-* [libbk](https://git.mdlowis.com/?p=proto/libbk.git;a=summary) -
- Library implementing a collection of memory management strategies
-* [lisp](https://git.mdlowis.com/?p=proto/lisp.git;a=summary) -
- Parser for a lisp language
-* [pick](https://git.mdlowis.com/?p=proto/pick.git;a=summary) -
- Terminal based fuzzy picker
-* [sclpl-rb](https://git.mdlowis.com/?p=proto/sclpl-rb.git;a=summary) -
- Compiler for an experimental language written in Ruby
-* [sclpl](https://git.mdlowis.com/?p=proto/sclpl.git;a=summary) -
- Compiler for an experimental language written in C
-
-
-## Archived Projects
-No longer developed but still contain useful bits of code.
-
-* [acc](https://git.mdlowis.com/?p=archive/acc.git;a=summary) -
- Aardvark chat client - terminal based [xmpp](https://en.wikipedia.org/wiki/XMPP) chat client
-* [afm](https://git.mdlowis.com/?p=archive/afm.git;a=summary) -
- Aardvark file manager - A terminal based file manager
-* [atc](https://git.mdlowis.com/?p=archive/atc.git;a=summary) -
- Algebraic type generator for C
-* [bci](https://git.mdlowis.com/?p=archive/bci.git;a=summary) -
- A distributed [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) script written in the bash scripting language.
-* [bitbucket](https://git.mdlowis.com/?p=archive/bitbucket.git;a=summary) -
- Random collection of scripts, code, and notes.
-* [bshuffle](https://git.mdlowis.com/?p=archive/bshuffle.git;a=summary) -
- QT based application for shuffling a list of items into equal sized groups.
-* [build-system](https://git.mdlowis.com/?p=archive/build-system.git;a=summary) -
- Build scripts based on RScons for a variety of different projects.
-* [carl](https://git.mdlowis.com/?p=archive/carl.git;a=summary) -
- C advanced runtime library
-* [cork](https://git.mdlowis.com/?p=archive/cork.git;a=summary) -
- Memory leak detector for C++
-* [dlang-scm](https://git.mdlowis.com/?p=archive/dlang-scm.git;a=summary) -
- Experimental programming language implemented in scheme.
-* [dlang](https://git.mdlowis.com/?p=archive/dlang.git;a=summary) -
- Experimental programming language
-* [gapbuf](https://git.mdlowis.com/?p=archive/gapbuf.git;a=summary) -
- Simple [gap buffer](https://en.wikipedia.org/wiki/Gap_buffer) implemented in C
-* [gc_obj](https://git.mdlowis.com/?p=archive/gc_obj.git;a=summary) -
- Reference counted smart pointer implementation.
-* [parse-utils](https://git.mdlowis.com/?p=archive/parse-utils.git;a=summary) -
- C++ library for building recursive descent parsers.
-* [tide-hl](https://git.mdlowis.com/?p=archive/tide-hl.git;a=summary) -
- Syntax highlighting engine for tide
-* [tide-ocaml](https://git.mdlowis.com/?p=archive/tide-ocaml.git;a=summary) -
- Minimal text editor inspired by Acme written in OCaml
-* [vim_config](https://git.mdlowis.com/?p=archive/vim_config.git;a=summary) -
- Custom vim configuration files
--- /dev/null
+# Projects
+
+
+## Active
+Projects being actively used and/or updated.
+
+* [tide](https://git.mdlowis.com/?p=projs/tide.git;a=summary) -
+ A minimal graphical text editor inspired by [Acme](http://doc.cat-v.org/plan_9/4th_edition/papers/acme/)
+* [awiki](https://git.mdlowis.com/?p=projs/awiki.git;a=summary) -
+ A minimal personal wiki engine for authoring static websites.
+* [alib](https://git.mdlowis.com/?p=projs/abt.git;a=summary) -
+ A collection of [header-only](https://en.wikipedia.org/wiki/Header-only) libraries for C
+* [atf](https://git.mdlowis.com/?p=projs/atf.git;a=summary) -
+ A minimal unit testing framework for C distributed as a header-only library.
+
+## Dormant
+Projects that are "finished" but no longer used or updated (for now). From time to time these projects may be revived or their ideas will feed into new projects.
+
+* [abt](https://git.mdlowis.com/?p=projs/abt.git;a=summary) -
+ A simple [Scons](https://scons.org/)/[RScons](https://github.com/holtrop/rscons) inspired build system written in Bash.
+* [onward](https://git.mdlowis.com/?p=projs/onward.git;a=summary) -
+ Forth-like language implemented in C99
+* [opts](https://git.mdlowis.com/?p=projs/opts.git;a=summary) -
+ Minimal command-line option parser library for C
+* [libcds](https://git.mdlowis.com/?p=projs/libcds.git;a=summary) -
+ A collection of common data structures and algorithms implemented in C99.
--- /dev/null
+# Prototypes and Half-Baked Ideas
+These might do something useful. They might also make your computer explode.
+
+* [acc](https://git.mdlowis.com/?p=proto/acc.git;a=summary) -
+ A shell script wrapper around the system C compiler
+* [albase](https://git.mdlowis.com/?p=proto/albase.git;a=summary) -
+ Experimental Linux distro with a focus on simplicity and efficiency.
+* [gir](https://git.mdlowis.com/?p=proto/gir.git;a=summary) -
+ Experimental programming language
+* [iwe](https://git.mdlowis.com/?p=proto/iwe.git;a=summary) -
+ Integrated work environment - custom forks of [suckless](https://suckless.org)
+ tools for personal use
+* [journal](https://git.mdlowis.com/?p=proto/journal.git;a=summary) -
+ Minimal single-page web app implementing a journal
+* [jstoys](https://git.mdlowis.com/?p=proto/jstoys.git;a=summary) -
+ Collection of minimal web games/demos written from scratch
+* [kanban](https://git.mdlowis.com/?p=proto/kanban.git;a=summary) -
+ Minimal single-page web app implementing a [Kanban board](https://en.wikipedia.org/wiki/Kanban_board)
+* [libbk](https://git.mdlowis.com/?p=proto/libbk.git;a=summary) -
+ Library implementing a collection of memory management strategies
+* [lisp](https://git.mdlowis.com/?p=proto/lisp.git;a=summary) -
+ Parser for a lisp language
+* [pick](https://git.mdlowis.com/?p=proto/pick.git;a=summary) -
+ Terminal based fuzzy picker
+* [sclpl-rb](https://git.mdlowis.com/?p=proto/sclpl-rb.git;a=summary) -
+ Compiler for an experimental language written in Ruby
+* [sclpl](https://git.mdlowis.com/?p=proto/sclpl.git;a=summary) -
+ Compiler for an experimental language written in C
+