3 ms·
When building a new website, I default to handwriting the HTML, instead of going with a static site generator. More pages lead to more duplication. I wrote a sc
by jmstfv 7y ago
When building a new website, I default to handwriting the HTML, instead of going with a static site generator. More pages lead to more duplication. I wrote a script that recursively goes through the directory, and replaces all occurrences of a string:
find . -name '*.html' -print0 | xargs -0 sed -i "" "s/replaceme/withthis/g"
The same but with fd:
fd -e html --print0 | xargs -0 sed -i "" "s/replaceme/withthis/g"
I have a tiny Sinatra app that I use in testing some parts of my Rails app. I either start it in the background or in a separate terminal window (that I close after some time). I have a script that kills a process given its port number (4567):
kill -9 $(lsof -ti tcp:4567)