Skip to content

Instantly share code, notes, and snippets.

View tadamcz's full-sized avatar

Tom Adamczewski tadamcz

View GitHub Profile
tadamcz / jekyll_picture_tag_hook.rb
Last active October 20, 2022 20:25
Jekyll picture tag hook: automatic responsive images from pure markdown
# Jekyll plugin to replace Markdown image syntax with {% picture %} tag for crafting responsive images
# Adapted from
# Use as a gem:
Jekyll::Hooks.register [:pages, :documents], :pre_render do |post, payload|
file_ext ='.', '')
# This regex will match all of the following correctly:
tadamcz /
Last active January 19, 2022 11:29
Execute Rubocop on all files that appear in the diff. Faster than rubocop on all files.
git diff origin/master --name-only --diff-filter=ACMRTUXB | grep "\.rb$" | tr "\n" " " | xargs bundle exec rubocop -A --force-exclusion