Skip to content

Instantly share code, notes, and snippets.

View tadamcz's full-sized avatar

Tom Adamczewski tadamcz

View GitHub Profile
@mmistakes
mmistakes / markdown-img-picture-replacement.rb
Last active October 14, 2022 14:51
Jekyll plugin to replace Markdown images eg. `![description](image.jpg)` with `{% picture %}` tag
# Description: Jekyll plugin to replace Markdown image syntax with {% picture %} tag for crafting responsive images
# place in /_plugins/
Jekyll::Hooks.register :posts, :pre_render do |post, payload|
docExt = post.extname.tr('.', '')
# only process if we deal with a markdown file
if payload['site']['markdown_ext'].include? docExt
newContent = post.content.gsub(/\!\[(.+)\]\((.+)\)/, '{% picture default \2 alt="\1" %}')
post.content = newContent
end
@laughinghan
laughinghan / MathSON.md
Last active December 7, 2023 21:52
MathSON - JSON for Math Formulae

MathSON

Status: Draft 1 In Progress. This document is undergoing its first revision. Initial implementation has begun alongside editing Draft 1. Your feedback is hoped and dreamed of.

Mathematical Structured Object Notation is a JSON-based representation for most of the common subset of what LaTeX and Presentation MathML can

@evanwalsh
evanwalsh / import.rb
Last active April 3, 2024 19:12
I imported my Jekyll from Squarespace's Wordpress XML with this
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'safe_yaml'
require 'time'
module JekyllImport
# This importer takes a wordpress.xml file, which can be exported from your