Skip to content

Instantly share code, notes, and snippets.

Jordan Merrick jordanmerrick

Block or report user

Report or block jordanmerrick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jordanmerrick
jordanmerrick / feed.json
Created May 20, 2017
JSON feed template for Jekyll.
View feed.json
---
layout: null
---
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ site.title | xml_escape }}",
"home_page_url": "{{ site.url }}",
"icon": "{{site.url }}/media/icons/apple-touch-icon.png",
"favicon": "{{ site.url }}/media/icons/favicon.ico",
"feed_url": "{{ site.url }}/feed.json",
@jordanmerrick
jordanmerrick / workflow.md
Created Oct 18, 2016
A gist created in Workflow
View workflow.md

This gist was created with Workflow.

@jordanmerrick
jordanmerrick / "Read Later" links for Squarespace blogs
Last active May 25, 2017
The following HTML code adds some links to easily send a Squarespace blog posts to the "Read Later" services Instapaper, Pocket and Readability. Add it to the "Post Blog Item Code Injection" and customise your CSS to suit.
View "Read Later" links for Squarespace blogs
@jordanmerrick
jordanmerrick / Clear TemporaryItems
Created Dec 19, 2013
Microsoft Office 2011 utilises the 'TemporaryItems' folder of Mac OS X, much like any other app. If there are any permissions issues within this folder, it can cause a number of problems with Office's Autosave function or prevent the function of emailing documents from within apps, such as Excel. While the path to the folder can be almost random…
View Clear TemporaryItems
set tFolder to path to temporary items
display dialog "Clear Temporary Items?" buttons {"Yes", "No"} default button 2
if the button returned of the result is "Yes" then
tell application "Finder"
delete tFolder
end tell
else
error number -128
@jordanmerrick
jordanmerrick / Load an alternative CSS file depending on the time of day
Last active Dec 17, 2015
Load an alternative/additional CSS file depending on the visitor's current time.
View Load an alternative CSS file depending on the time of day
<script>
var currentTime = new Date().getHours();
if (22 <= currentTime&&currentTime < 24 || 0 <= currentTime&&currentTime < 6) {
document.write("<link rel='stylesheet' href='{{ SITEURL }}/theme/css/night.css' type='text/css'>");
}
</script>
@jordanmerrick
jordanmerrick / Convert pelican tags to lowercase
Last active Dec 17, 2015
Finds any line starting with "tags:" (case insensitive) and converts any tags to lowercase
View Convert pelican tags to lowercase
## This is destructive as it modifies the files in the directory you're currently in (only if they're .md) but always have a backup.
## I've tested this and it works ok for me, converting the tags all to lowercase. This was run in OS X 10.8.3
## Either copy/paste the entire line or create a shell script with it.
perl -pi -w -e 's/(?i)^tags:.*\n$/lc/ge' *.md
View Pelican 3.2 uppercase tags and categories quick fix
# Add to <VirtualHost> in httpd.conf
RewriteMap lc int:tolower
# Add to .htaccess, can change the second line to anything if you don't want to limit it to just /tag/
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule ^tag/. ${lc:%{REQUEST_URI}} [R=301,L]
@jordanmerrick
jordanmerrick / statusboard_panel_gcal
Last active Aug 11, 2016
A custom table panel for Panic's Status Board that can tabulate a Google Calendar feed.
View statusboard_panel_gcal
<!-- 5by5 Live Show Panel for Status Board -->
<!-- Written by Jordan Merrick - https://www.jordanmerrick.com -->
<!-- JS based upon Google Calendar API -->
<!-- GOOGLE HAS SINCE DEPRECATED GOOGLE CALENDAR API v1 & v2, RENDERING THIS SCRIPT UNUSABLE -->
<!-- You are welcome to adapt it but it will no longer function -->
<title>5by5 Panel</title>
<script>
// Set the date range start for Google Calendar parsing since we only want the schedule for the next 30 days
@jordanmerrick
jordanmerrick / dropbox-pelican-auto-update
Created Apr 11, 2013
Automatically update Pelican via Dropbox by using the following shell script as a cron running every minute. Just make sure your user can run "make" without needing sudo (causes a TTY error otherwise and fails).
View dropbox-pelican-auto-update
#!/bin/bash
Respawn="/home/user/Dropbox/files/respawn"
if [ -f $Respawn ]
then
make html -C /var/www/yoursite;rm $Respawn
else
exit 0
fi
exit 0
@jordanmerrick
jordanmerrick / dropbox-cli-notify
Last active Dec 14, 2015
Notification if Dropbox CLI stops running in CentOS
View dropbox-cli-notify
## Dropbox email notification if the daemon has stopped running
## Change name@address.com to the address you want to email.
./dropbox.py status | grep -q 'running' && printf "Dropbox has stopped running on $HOSTNAME.\nLast checked $(date)\n" | mail -s "Dropbox Failure Notification on $HOSTNAME" name@address.com
You can’t perform that action at this time.