Skip to content

Instantly share code, notes, and snippets.

View arthurattwell's full-sized avatar

Arthur Attwell arthurattwell

View GitHub Profile
@arthurattwell
arthurattwell / Installing-Jekyll-on-Windows.md
Last active October 20, 2022 16:46
Installing Jekyll on Windows

Installing Jekyll on Windows

Getting Jekyll installed on Windows can be more complicated than on, say, OSX and Ubuntu, but not by much. This outlines the steps I use.

I have similar guidance (plus extra steps for my publishing tools) for OSX written up here.

Why is this tricky?

Because each of the pieces that make Jekyll work is fussy, especially on Windows, which the developers of those pieces rarely use.

@arthurattwell
arthurattwell / electric-book-tools-setup-windows.md
Last active September 5, 2022 09:57
Setting up the Electric Book workflow on Windows

Setting up the EBW tools on Windows

These steps have worked for me on several machines. Every machine is a bit different, so your mileage may vary.

On OSX? I've written up guidance for installing the EBW tools on OSX here.

  1. The first steps are to get Ruby and Jekyll installed. I have a whole separate piece on that here. Go and read that, follow it closely, and come back here when you're done.

  2. Download and install PrinceXML. See princexml.com/doc/installing for instructions. Note that this is proprietary software (the only proprietary tool we use). You can try the trial version for free; it adds a watermark to your first page.

  3. Install PhantomJS. [Note: this step is only necessary for Electric Book template v.0.15 and earlier. Phantom is not required from v0.16.0] This is necessary for

@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>
@arthurattwell
arthurattwell / split.sh
Last active November 24, 2021 11:52
Split a markdown file into separate files on YAML frontmatter
#!/bin/bash
# That tells Linux to use a Bourne shell interpreter.
# Run this script from the current directory. (Required on OSX.)
cd -- "$(dirname "$0")"
# Don't echo these commands.
set +v
# Get the filename from the user.
@arthurattwell
arthurattwell / stylus_basecamp-dark.css
Last active June 16, 2021 22:49
Dark mode for Basecamp 3 with Stylus
/* Work in progress.
A Basecamp 3 dark theme for Stylus
(https://addons.mozilla.org/en-US/firefox/addon/styl-us/)
based on https://userstyles.org/styles/177262/basecamp-insomnia */
:root
{
--bg-md: #18242b;
--bg-md-2: #152025;
--bg-lt: #213038;
/* Extra styles for Gmail applied with Stylus
in combination with Gmail's dark theme
and the simpl.fyi Gmail v2 Firefox extension */
/* System fonts for Gmail */
.yW,
.hx .gD,
.xY,
.zA > .a4W,
.zA > .xW,
@arthurattwell
arthurattwell / html2docx.bat
Last active April 5, 2021 12:04
Batch file to convert HTML files to Word docx with Pandoc
:: This batch file converts HTML files in a folder to docx.
:: It requires Pandoc, and a list of files to convert
:: named file-list, in which each file is on a separate line,
:: and contains no spaces in the filename.
::
:: Don't show these commands to the user
@ECHO off
:: Set the title of the window
TITLE Convert html to docx
:: This thing that's necessary.
@arthurattwell
arthurattwell / graphicsmagick.sh
Last active April 2, 2021 17:32 — forked from witooh/graphicsmagick.sh
Install GraphicsMagick on Ubuntu 18.04
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:rwky/graphicsmagick -y
sudo apt update
sudo apt install graphicsmagick -y
@arthurattwell
arthurattwell / gmail.css
Last active February 11, 2021 06:50
Nicer Gmail styles with Stylus, Gmail's dark theme, and simpl.fyi [deprecated]
/* Extra styles for Gmail applied with Stylus
in combination with Gmail's dark theme
and the simpl.fyi Firefox extension */
/* Max width on email */
table.Bs.nH.iY.bAt {
max-width: 50em;
margin: auto;
}