Skip to content

Instantly share code, notes, and snippets.

View nicholasodonnell's full-sized avatar

Nicholas O'Donnell nicholasodonnell

View GitHub Profile
@nicholasodonnell
nicholasodonnell / dothtml-dottwig.py
Last active July 25, 2017 15:03
Renames all .html templates to use .twig extension. Used in legacy Craft CMS builds.
import os
import shutil
def rename(dir):
for subdir, dirs, files in os.walk(dir):
for file in files:
srcLocation = os.path.join(subdir, file)
destLocation = srcLocation.replace('.html', '.twig')
if not os.path.isfile(destLocation):
@nicholasodonnell
nicholasodonnell / fix-mysql-slow-import-docker.sh
Last active July 25, 2017 15:01
Fixes database taking forever to import problem on Dockerized MySQL (Mac)
#!/bin/bash
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
git reset --hard
mkdir -p ./com.docker.driver.amd64-linux/disk
touch ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
touch ./com.docker.driver.amd64-linux/disk/on-flush