Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View awayken's full-sized avatar

Miles Rausch awayken

View GitHub Profile
@awayken
awayken / monospace.css
Created April 19, 2020 00:36
System Font Stacks
/* Stolen from: https://alligator.io/css/system-font-stack/#monospace-system-font-stack */
code, kbd {
font-family:
/* macOS, iOS */
SFMono-Regular,
Menlo,
Monaco,
/* Windows */
@awayken
awayken / holo.ts
Last active August 4, 2019 13:55
Robot Dance Club Promos
export enum RobotType {
Agriculture,
Constructor,
Drone,
Karaoke,
Vehicle
}
export interface IRobot {
readonly id: string;
// Global maps
const preloaded = new Map();
const preloading = new Map();
function buildPreload(url = '') {
// If we have a URL
if (url.length) {
// Create a prefetch <link />
const el = document.createElement('link')
el.rel = 'prefetch'
@awayken
awayken / open-graph-inspector.js
Last active December 14, 2018 17:36
Show Open Graph Tags
(function() {
const tags = document.querySelectorAll('[property^="og:"]')
let taginfo = `<div style="overflow: auto; padding-bottom: .5em;">`;
if (tags.length) {
taginfo += `<div style="text-align: center; padding-bottom: .5em; margin-bottom: .5em; border-bottom: 1px solid #000">🎉 Found ${tags.length} Open Graph ${tags.length === 1 ? 'tag' : 'tags'}!</div>`
for (const item of tags) {
const property = item.getAttribute('property')
@awayken
awayken / post_3699_take1.cfm
Last active June 20, 2017 15:35
A Technique for Tracking Prints Using CSS: http://wp.me/pcVrg-XF
<cfscript>
param name='args.qrURL' default=prc.page.getCanonical();
</cfscript>
<cfoutput>
<div class="u--printonly detail--trackprint">
<p>#_('qrcode_explanation', 'Scan the following QR code to learn more.')#</p>
<img class="u--box" src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&amp;data=#HTMLEditFormat( args.qrURL )#" alt="">
<p>(#HTMLEditFormat( args.qrURL )#)</p>
<img src="?trackprint" alt="">
@awayken
awayken / cache_cfml.cfm
Last active December 20, 2015 00:09
CFML Caching Templates
<cfset local.cacheKey = hash( cgi.http_host, 'sha1' ) & '_CHANGEME'>
<cfset local.cacheTimespan = createtimespan( 0, 0, 10, 0 )>
<cfset local.cacheHTML = "">
<cfcache action="get" id="#local.cacheKey#" name="local.cacheHTML">
<cfif isNull( local.cacheHTML )>
<cfsavecontent variable="local.cacheHTML">
<!--- CFML here --->
</cfsavecontent>
<cfcache action="put" id="#local.cacheKey#" value="#local.cacheHTML#" timespan="#local.cacheTimespan#">
@awayken
awayken / .gitconfig
Created July 18, 2013 16:17
My incredible, tricked-out, super helpful, awesome git config.
[alias]
## Compound command alias
# View all alias
alias = !"git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\t=> \\2/' | sort"
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# Stage all missing files for delete
r = !"git ls-files -z --deleted | xargs -0 git rm"
# Show all files modified using `git assume` alias
assumed = !"git ls-files -v | grep ^h | cut -c 3-"
Genius is eternal patience.
The ancestor of every action is thought.
I always thought this was incomplete. They should add: The parent of every action is emotion. The sibling of every action is reaction.