Skip to content

Instantly share code, notes, and snippets.

View joeworkman's full-sized avatar
😁

Joe Workman joeworkman

😁
View GitHub Profile
@joeworkman
joeworkman / fastclick.js
Last active August 29, 2016 18:16
Off Canvas Mobile temp work around. Place this into the Javascript tab in your RapidWeaver project.
!function(){"use strict";function a(b,d){function e(a,b){return function(){return a.apply(b,arguments)}}var f;if(d=d||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=d.touchBoundary||10,this.layer=b,this.tapDelay=d.tapDelay||200,this.tapTimeout=d.tapTimeout||700,!a.notNeeded(b)){for(var g=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],h=this,i=0,j=g.length;j>i;i++)h[g[i]]=e(h[g[i]],h);c&&(b.addEventListener("mouseover",this.onMouse,!0),b.addEventListener("mousedown",this.onMouse,!0),b.addEventListener("mouseup",this.onMouse,!0)),b.addEventListener("click",this.onClick,!0),b.addEventListener("touchstart",this.onTouchStart,!1),b.addEventListener("touchmove",this.onTouchMove,!1),b.addEventListener("touchend",this.onTouchEnd,!1),b.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(b.removeEventListener=function(a,c,d){var e=No
Verifying that +joeworkman is my blockchain ID. https://onename.com/joeworkman
@joeworkman
joeworkman / replace-cmd-data.sh
Created November 30, 2015 16:01
You can schedule the following shell script as a cron job on your hosting company in order to replace the cmd-data directory on your server with a "golden" master copy that you have saved to a new location. You will obviously want to change the directory locations where the files live to fit your server.
#!/bin/bash
rm -r /websites/cms.joeworkman.net/cms-data/
cp -r /home/joeworkman/cms-data-template /websites/cms.joeworkman.net/cms-data/
@joeworkman
joeworkman / foundation-utility-classes.scss
Created August 28, 2015 21:55
Foundation for RapidWeaver utility classes
// ------------------------------------------
// Utility Classes
// ------------------------------------------
.fn-text-header{ color:$headerColor }
.fn-text-link{ a {color:$linkColor} }
.fn-text-link{ a:hover {color:$linkHoverColor} }
.fn-text-text{ color:$fontColor; p,div{color:$fontColor;}}
.fn-text-accent{ color:$textAccents }
.fn-text-code-text{ color:$codeText }
.fn-text-header-alt{ color:$headerColorAlt }

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@joeworkman
joeworkman / gist:b63207574233afb5a3ae
Created September 8, 2014 20:07
Cleanup Time Machine Backups older than 90 days
# You need the put in the full path to the directory that has your backups
# This directory will have a bunch of folders that are named with dates
sudo find "/Volumes/Full Path/To Backup/Directory" -type d -ctime +90 -maxdepth 1 -exec tmutil delete {} \;
@joeworkman
joeworkman / gist:9215120
Created February 25, 2014 18:48
WeaverCast 20 & 21 - htaccess snippets
# Simple redirect
Redirect 301 /mac/mynest/ http://joeworkman.net/mac/climate/
# 404 Error catch
ErrorDocument 404 /errors/404/index.html
ErrorDocument 403 /errors/404/index.html
ErrorDocument 500 /errors/500/index.html
# Compression
<IfModule mod_deflate.c>
@joeworkman
joeworkman / gist:7671869
Created November 27, 2013 07:23
Launch Center Pro - Post Clipboard to Facebook, Twitter and Riposte
launchpro-clipboard://x-callback-url/addText?value=[prompt-twitter:Post]&
x-success={{launchpro-facebook://x-callback-url/clipboard&
x-success={{launchpro-tweet://x-callback-url/clipboard&
x-success={{launchpro://?url=riposte%3A%2F%2FcreateNewPost%3Ftext%3D%5Bclipboard%5D%26accountID%3Djoeworkman}}
}}
}}
@joeworkman
joeworkman / gist:6416675
Created September 2, 2013 19:52
HTML5 Video with Flash Fallback
<video width="320" height="240" poster="poster.jpg" controls="controls" preload="none">
<!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 -->
<source type="video/mp4" src="myvideo.mp4" />
<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
<source type="video/webm" src="myvideo.webm" />
<!-- Ogg/Vorbis for older Firefox and Opera versions -->
<source type="video/ogg" src="myvideo.ogv" />
<!-- Optional: Add subtitles for each language -->
<track kind="subtitles" src="subtitles.srt" srclang="en" />
<!-- Optional: Add chapters -->
@joeworkman
joeworkman / GoDaddy DOCUMENT_ROOT Fix
Created May 4, 2013 16:20
GoDaddy has some `interesting` server setups. When developing PHP to be used across many hosts, DOCUMENT_ROOT is commonly used. Sadly GoDaddy makes things difficult. Here is the fix.
<?php
if (!empty($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'])) {
#GoDaddy Hackery
$_SERVER['DOCUMENT_ROOT'] = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];
}
?>