Skip to content

Instantly share code, notes, and snippets.

View phlummox's full-sized avatar

phlummox phlummox

View GitHub Profile
@phlummox
phlummox / translation-style.md
Last active April 16, 2024 16:20
"Problems of translation", by Douglas Hofstadter (from Gödel, Escher, Bach: an Eternal Golden Braid)

Different Styles of Translating Novels

... Suppose you are translating a novel from Russian to English, and come across a sentence whose literal translation is, "She had a bowl of borscht." Now perhaps many of your readers will have no idea what borscht is. You could attempt to replace it by the "corresponding" item in their culture – thus, your translation might run, "She had a bowl of Campbell's soup." Now if you think this is a silly exaggeration, take a look at the first sentence of Dostoevsky's novel Crime and Punishment in Russian and then in a few different English translations. I happened to look at three different

@phlummox
phlummox / python-report-tools.md
Last active July 30, 2023 01:03
python literate report-generation tools

python literate code/scientific report generation tools

Current status (as at March 2022) of Python-based tools for generating scientific reports from markdown+code.

  • Unmaintained. Only supports Python >= 3.4 and <= 3.6, all of which are past end of life; and it's incompatible with current versions of some of its dependencies (e.g. jupyter-client)
@phlummox
phlummox / Makefile
Last active July 26, 2023 13:58
"relative executor" program
CFLAGS = -pedantic -Wall -Wextra -std=c11 -O2
rel: rel.o
rel.o:
clean:
-rm *.o rel
@phlummox
phlummox / delegate.c
Created July 26, 2023 13:57 — forked from rusek/delegate.c
Interpreter path relative to script location in shebang
/*
Helper program for resolving the path to the interpreter executable
relative to the script location in shebangs.
Sample usage:
#!/usr/bin/delegate ../my-virtualenv/bin/python
import sys
def main():
@phlummox
phlummox / android-cl-cheatsheet.md
Last active July 19, 2023 10:29
Android development - command-line cheatsheet
@phlummox
phlummox / readability-bookmarklets.md
Last active July 9, 2023 08:04
(Mobile) readability bookmarklets

Looking for a bookmarklet which improves readability on mobile devices. Such bookmarklets are sometimes called "declutterers" or "simplifiers".

readable from tastefulwords.com is one of the best-known examples.

Here is a modified and customised version of it by @akaleeroy and others.

But I've found the Mozilla customization of it tends to work better: https://github.com/mozilla/readability.

Readable Bookmarklet

Bookmarklet Browser Enhancement Readability

Readable dark theme

rdbl.us

Readable is an application that helps you read more of the web. It reformats text — on any website — according to your exact specifications.

@phlummox
phlummox / gist:062f8e3faf5524c881714daf5def44f7
Created May 1, 2023 05:40
Debug output of "vagrant up" of box generic/alpine310, version 4.2.16
This file has been truncated, but you can view the full file.
Script started on 2023-05-01 12:07:01+08:00 [TERM="xterm-256color" TTY="/dev/pts/6" COLUMNS="116" LINES="31"]
INFO global: Vagrant version: 2.3.4
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/mnt/data/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/mnt/data/opt/vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
@phlummox
phlummox / emulator-install-using-avdmanager.md
Created February 7, 2023 12:01 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@phlummox
phlummox / new-python-project-with-tox-and-pytest.md
Created January 17, 2023 05:07 — forked from gene1wood/new-python-project-with-tox-and-pytest.md
Example of the directory structure, setup.py, tox.ini and pytest tests for a new python project

Directory structure

projectname/                 [1]
├── projectname              [2]
│   ├── __init__.py
├── README.md
├── setup.py
├── tests
│   └── test_projectname.py