Skip to content

Instantly share code, notes, and snippets.

View paulshryock's full-sized avatar
👨‍💻

Paul Shryock paulshryock

👨‍💻
View GitHub Profile
@Andy-set-studio
Andy-set-studio / visually-hidden.css
Created November 18, 2019 10:28
Visually hidden utility class
/**
* VISUALLY HIDDEN
* Hides element visually and removes it from the flow,
* but importantly, allows assitive technology to access it
*/
.visually-hidden {
border: 0;
clip: rect(0 0 0 0);
height: auto;
margin: 0;
// please check https://docs.netlify.com/configure-builds/environment-variables/#declare-variables for most up to date info
// this was created before those docs existed
process.env = {
/**
*
* AUTOMATICALLY SET BY NETLIFY. IMMUTABLE!
* docs: https://www.netlify.com/docs/continuous-deployment/#environment-variables
*
*/
@illvart
illvart / meta-seo.njk
Last active March 10, 2020 22:10
My Eleventy project meta-seo.njk
{% if permalink == "/" %}
{% set canonicalUrl = metadata.canonicalUrl %}
{% else %}
{% set canonicalUrl = metadata.canonicalUrl + page.url %}
{% endif %}
<link rel="canonical" href="{{ canonicalUrl }}">
{# Social meta #}
{% if section == "articles" %}
<meta property="og:type" content="blog">
{% else %}
@ryerh
ryerh / jekyll-and-liquid.md
Created April 16, 2018 15:35 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@ErikFontanel
ErikFontanel / filter-youtube-domains.sh
Last active November 28, 2023 18:55
Pi-hole Youtube ad blocking
#!/bin/sh
# This script will fetch the Googlevideo ad domains and append them to the Pi-hole block list.
# Run this script daily with a cron job (don't forget to chmod +x)
# More info here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/136
# File to store the YT ad domains
FILE=/etc/pihole/youtube.hosts
# Fetch the list of domains, remove the ip's and save them
curl 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com' \
@jwilson8767
jwilson8767 / es6-element-ready.js
Last active April 22, 2024 20:28
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@Marian0
Marian0 / gist:4d689c33164bc9daf0e1
Created October 22, 2015 12:07
Disable wordpress Frontend by htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/wp-admin
RewriteCond %{REQUEST_URI} !/wp-includes
RewriteCond %{REQUEST_URI} !/wp-login\.php$
RewriteCond %{REQUEST_URI} !/wp-content
RewriteCond %{REQUEST_URI} !/feed
@cferdinandi
cferdinandi / terminal-cheat-sheet.txt
Last active June 19, 2024 03:05
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@chrismccoy
chrismccoy / gitcheats.txt
Last active June 18, 2024 13:42
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# count total commits in a repo
git rev-list --all --count
# edit all commit messages
git rebase -i --root