Skip to content

Instantly share code, notes, and snippets.

View dirtystylus's full-sized avatar

Mark Llobrera dirtystylus

View GitHub Profile
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@digiltd
digiltd / readme.md
Last active February 4, 2016 01:22
Advanced Custom Fields - Repeater using image fields

ACF Repeater using image fields

This gist is to accompany my comment on Mark's article:

[Build modular content systems in WordPress] (http://www.creativebloq.com/web-design/build-modular-content-systems-wordpress-41514680) by Mark Llobrera

Which if you haven't read (or just stumbled upon this gist by chance) then I highly recomend you do.

It demonstrates some key concepts on how you can use ACF to build your clients mini page builders. By doing so you can avoid all the bloat that the big page builder type plugins use. You will also build up your own mini library of elements that you can reuse depending on the project.

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg