Skip to content

Instantly share code, notes, and snippets.

View kimadactyl's full-sized avatar

Dr Kim Foale kimadactyl

View GitHub Profile
@kimadactyl
kimadactyl / Dockerfile
Last active August 17, 2017 18:44
Troubleshooting
FROM ruby:2.4.0
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /gofg-db
WORKDIR /gofg-db
ADD Gemfile /gofg-db/Gemfile
ADD Gemfile.lock /gofg-db/Gemfile.lock
RUN bundle install
ADD . /gofg-db
ENTRYPOINT ["/gofg-db/docker-entry.sh"]
@kimadactyl
kimadactyl / 1-trim-lines.rb
Last active August 10, 2021 17:09
Scripts to migrate an existing HTML site to Jekyll when you can't access the source
# First grab the remote site
# wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://yourdomain.co.uk
# If you have images hosted on another site then do
# wget --mirror --convert-links --adjust-extension --page-requisites --span-hosts --domains mydomain.com,imagehostingcdn.com https://mydomain.com
# Then have a look how many lines to trim from beginning and end
htmls = Dir.glob('/**/*.html')
htmls.each do |file|
# Change numbers to how many lines you want to trim
@kimadactyl
kimadactyl / blogspot-to-hugo-converter.rb
Last active December 17, 2021 21:24
Migrate Blogspot to Hugo page bundles
# To grab site, do something like:
# wget --mirror --convert-links --adjust-extension --page-requisites --span-hosts --domains 1.bp.blogspot.com,2.bp.blogspot.com,3.bp.blogspot.com,4.bp.blogspot.com,myblog.blogspot.com, http://myblog.blogspot.com/ -P pass_01
require 'date'
require 'fileutils'
require 'kramdown'
require 'logger'
require 'nokogiri'
require 'rake'
require 'sanitize'