Skip to content

Instantly share code, notes, and snippets.

View huphtur's full-sized avatar
👨‍🦲
He/Him/His

Marcel Appelman huphtur

👨‍🦲
He/Him/His
View GitHub Profile
@huphtur
huphtur / .eleventy.config.js
Created January 28, 2021 21:07 — forked from danielpost/.eleventy.config.js
Eleventy: Purge CSS for each html file
const { PurgeCSS } = require('purgecss');
/**
* Remove any CSS not used on the page and inline the remaining CSS in the
* <head>.
*
* @see {@link https://github.com/FullHuman/purgecss}
*/
eleventyConfig.addTransform('purge-and-inline-css', async (content, outputPath) => {
if (process.env.ELEVENTY_ENV !== 'production' || !outputPath.endsWith('.html')) {
@huphtur
huphtur / gist:55ab762a58e64576fdf4f74697162541
Created August 31, 2020 23:50
How to run Tailwind CSS locally on MacOS
- git clone https://github.com/tailwindlabs/tailwindcss.com
- cd tailwindcss.com
- yarn
- yarn export (this will take a while to run)
- cd out
- python -m SimpleHTTPServer(this fires up webserver at localhost:8000)
@huphtur
huphtur / thumbs.js
Created March 3, 2020 16:21
simple node script to create thumbs out of header images
const fg = require('fast-glob');
const sharp = require('sharp');
const headers = fg.sync(['src/posts/**/header.jpg']);
headers.forEach(header => {
thumb = header.replace("src/posts", "_site/news").replace("header", "thumb");
sharp(header)
.jpeg({
quality: 50,
@huphtur
huphtur / jekyll-header-with-social-meta.html
Last active December 31, 2015 20:17 — forked from ecarlisle/jekyll-header-with-social-meta.html
This is an optimized version of Jekyll's /_includes/head.html include. Liquid variables are created up top to keep the source DRY and clean. Included in this header are Open Graph and Twitter meta tags for social integration.
{% assign full_url = site.baseurl | prepend: site.url %}
{% capture page_title %}
{% if page.title %}
{{ page.title }}
{% else %}
{{ site.title }}
{% endif %}
{% endcapture %}
{% assign page_title = page_title | strip_newlines | split " " | join " " %}
@huphtur
huphtur / gist:e6d63814ab7885939cc6
Last active September 12, 2019 15:56
keybase.md
### Keybase proof
I hereby claim:
* I am huphtur on github.
* I am huphtur (https://keybase.io/huphtur) on keybase.
* I have a public key whose fingerprint is 7E6E 1929 F48B 44C0 0E62 0CFE 4359 820F 54C0 47F4
To claim this, I am signing this object:
@huphtur
huphtur / YouThumb
Last active March 1, 2024 16:01
Bookmarklet: display maximum resolution YouTube thumbnail
javascript: function gqv(v) {
var q = window.location.search.substring(1);
var vars = q.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == v) {
return pair[1];
}
}
return (false);