Skip to content

Instantly share code, notes, and snippets.

Arthur Attwell arthurattwell

Block or report user

Report or block arthurattwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
arthurattwell /
Created Jan 7, 2019
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 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. This is necessary for building search indexes for websites. (And, in older repos to Electric Book template version 0.12, for creating PDFs th

arthurattwell /
Last active Dec 17, 2018 — forked from douglas/
Update all git repositories under a base directory
# store the repos dir
# Go into the repos folder
# Let the person running the script know what's going on.
echo "Pulling in latest changes for all repositories..."
arthurattwell /
Last active Aug 21, 2019
Split a markdown file into separate files on YAML frontmatter
# 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 / Cmder.xml
Last active Oct 17, 2018
Cmder settings and custom clink.lua
View Cmder.xml
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2018-10-17 10:40:04" build="180528">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{cmd::Cmder}"/>
<value name="StartFarFolders" type="hex" data="00"/>
arthurattwell / WordcountAll.vba
Last active Jun 28, 2018
Microsoft Office macro for getting the word count of all Word files in a folder
View WordcountAll.vba
Sub WordcountAll()
' Add the path to the folder you are counting below in quotes where you see C:\
' Adapted from
Dim objWordApplication As Word.Application
Dim nPageNumber As Long
Dim nWordNumber As Long
Dim objFile As Variant
Dim objFileSystem As Object
Dim objFolders As Object
arthurattwell / .htaccess
Created Jun 18, 2018
Send all traffic to non-www https
View .htaccess
# Send www to non-www (thanks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
arthurattwell /
Created Jun 4, 2018
Template readme for Electric Book live builds

Deploying this build to a live server

arthurattwell / epubcheck-all.bat
Created May 10, 2018
Batch file for validating all the epubs in a folder with EpubCheck
View epubcheck-all.bat
:: Don't show these commands to the user
@echo off
:: Keep variables local, and expand at execution time not parse time
setlocal enabledelayedexpansion
:: Set the title of the window
title Validating epubs
echo This will run EpubCheck on all the epubs in this folder.
arthurattwell / translation-characters.txt
Last active May 30, 2018
A list of non-ASCII characters/glyphs useful for testing font choices in translation projects
View translation-characters.txt
ḓ Ḓ ḽ ṋ ṱ Ṱ µ » ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ ƒ Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω ϑ ϒ ϖ Œ œ Š š Ÿ
arthurattwell / add-file.bat
Created Apr 13, 2018
Copy a file to multiple subfolders with the same name
View add-file.bat
@echo off
:: This batch file copies a file called 'file.txt'
:: from a subfolder called 'sourcefolder'
:: to all subfolders called 'text'.
:: Get current directory
set dir=%~dp0
:: Loop and copy file
for /d /r %dir% %%d in (.) do (
You can’t perform that action at this time.