Requires
jq
pandoc
- Browser with dev tools (much easier than navigating source)
aria2c
for batch downloading- text editor with f&r
- Go to purchase page.
--- | |
title: Forestay | |
author: David Baynard | |
date: 05 Jun 2017 | |
fontfamily: libertine | |
csl: chemical-engineering-science.csl | |
link-citations: true | |
abstract: | | |
... |
resolver: lts-13.5 | |
name: 8.6.3-13.5-baynard-snapshot | |
compiler: ghc-8.6.3 | |
packages: | |
- git: https://github.com/jameysharp/corrode | |
commit: 34053342c2f1ca04f23ad94d67057f14e74d9fb9 | |
- git: https://github.com/mgattozzi/curryrs | |
commit: 6d3ecbc3d1786ccc16e2ff20c6d6da53734f6b03 |
--- | |
title: passhte | |
author: David Baynard | |
date: 22 May 2017 | |
fontfamily: libertine | |
csl: chemical-engineering-science.csl | |
link-citations: true | |
abstract: | | |
Paste over ssh | |
... |
Ever been faced with an old website that needs an upgrade best done incrementally? At http://www.parsonsmatt.org/2016/06/24/take_over_an_api_with_servant.html, Matt Parsons describes an approach to incrementally take over an old API using Servant and a reverse proxy, which is worth a read!
On occasions, though, your predecessor may not have written a considered, documented API. Sometimes all that exists is a sprawl of tangled php, html and javascript that just about works, until there’s a change in business logic and the code gets touched — at which point everything breaks. Unlike the example in Matt’s post, it has an index.php
route with all the pages at index.php?page=<PAGE>
, instead of using path pieces separated by solidus.
Matt’s approach works in this case too, and we don’t even need to change the haskell server he supplies! We simply change how we use the reverse proxy and add some url rewriting middleware.
This example copies Matt’s woofing and meowing server, for simplicity of comparison.
WARNING: You must copy the commands from the raw
version of this document. The markdown converter doesn’t like it…
Do you have a file with weird encoding errors? Perhaps instead of ’
you have á^€™
. The cause is a mix up between latin1 (usually — and especially if mysql is involved — the windows cp1252 encoding) and utf8.
Many solutions drop bytes. This has the advantage that you can see every change that is made, as it happens, should you wish.
It requires the file to be encoded in ISO 8859–1.