Skip to content

Instantly share code, notes, and snippets.


Jeremy Keith adactio

View GitHub Profile
adactio /
Last active December 13, 2016 13:48
HTTPS domain settings on Apache 2.4.7:
<VirtualHost *:80>
DocumentRoot /path/to/yourdomain
Redirect /
<VirtualHost *:443>
adactio / linkTwitterProfiles.php
Created February 2, 2017 23:45
A regular expression for turning a word beginning with @ into a link to a Twitter profile.
View linkTwitterProfiles.php
$string = preg_replace(
'<a href="$1">@$1</a>',
View conditionalcats.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Can’t Hug Every Cat</title>
body {
font: 1em/1.5 Cambria, Georgia, serif;
margin: 0 5%;
adactio / mediaquerycolums.html
Created January 12, 2012 16:55
Multiple columns dependent on media queries that test for height as well as width.
View mediaquerycolums.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Media Query Multiple Columns</title>
<meta name="viewport" content="width=device-width, intial-scale=1">
@media all and (min-width: 40em) and (min-height: 36em) {
[role="main"] {
-webkit-column-count: 2;
adactio / twitter-user-stylesheet.css
Created December 14, 2011 23:56
CSS rules to hide "Trending Topics" and "Who To Follow" on new new Twitter.
View twitter-user-stylesheet.css
[data-component-term="trends"] *,
[data-component-term="user_recommendations"] * {
display: none !important;
adactio / boilerplate.html
Created August 17, 2017 17:38
My boilerplate for HTML
View boilerplate.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
adactio / webmention-form.html
Last active December 9, 2017 23:33
The form I put at the end of every blog post I make so that you can ping my webmention endpoint with your response.
View webmention-form.html
<form method="post" action="/webmention">
<p>Have you published a response to this?
<label for="webmention-source">Let me know the <abbr title="Uniform Resource Locator">URL</abbr></label>:
<input type="url" name="source" id="webmention-source">
<input type="hidden" name="target" value="">
<input type="submit" value="Ping!">
adactio / postforms.js
Created March 2, 2014 23:42
Show a progress bar when a form is submitted (and prevent more than one submission per document).
View postforms.js
Show a progress element for any form submission via POST.
Prevent the form element from being submitted twice.
(function (win, doc) {
'use strict';
if (!doc.querySelectorAll || !win.addEventListener) {
// doesn't cut the mustard.
adactio / beforeInstallPrompt.js
Created August 3, 2018 09:31
Show a dismissable option to add The Session to the home screen (only shown to logged in users).
View beforeInstallPrompt.js
(function (win, doc) {
win.addEventListener('beforeinstallprompt', function (e) {
var deferredPrompt = e;
var insertionPoint = doc.querySelector('main .contents');
<div class="feedback" role="dialog" aria-labelledby="homescreen">
<h2 id="homescreen">Install The Session</h2>
<p>Would you like to add The Session to your home screen?</p>
<button class="back">No, thanks</button>
adactio / lettering.html
Created January 26, 2012 11:35
A quick'n'dirty way of doing some lettering.js stuff without jQuery.
View lettering.html
<!DOCTYPE html>
<html lang="en">
.slogan span:nth-child(odd) {
color: red;