Skip to content

Instantly share code, notes, and snippets.

View reefdog's full-sized avatar

Justin Reese reefdog

View GitHub Profile
@reefdog
reefdog / Text Substitutions.plist
Last active August 3, 2022 19:55
Useful text substitutions for macOS. Install by dragging into "System Preferences > Keyboard > Text" substitution area.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>★☆☆☆☆</string>
<key>shortcut</key>
<string>/1star</string>
</dict>
@reefdog
reefdog / rails http status codes
Created August 26, 2016 18:37 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@reefdog
reefdog / 160519.html
Last active May 19, 2016 15:32
Recode of Steve Yedlin's RAW letter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Viewing_RAW</title>
<style type="text/css">
@reefdog
reefdog / platformer.js
Last active January 5, 2017 17:45
Redirect static DocumentCloud asset links to the canonical HTML page
/*!
* Platformer
* Redirect static DocumentCloud asset links to the canonical HTML page.
*
* Say you're at `https://assets.documentcloud.org/documents/282753/lefler-thesis.pdf`
* and you want to view the original DocumentCloud page for that document. Click your
* Platformer bookmarklet. It transforms that URL to the URL for the original document
* on documentcloud.org.
*
* To use, create a bookmark with the following address (sans backticks):
@reefdog
reefdog / search-embed-example.html
Created February 18, 2016 21:32
Example of DocumentCloud search embed code
<div id="DC-search-projectid-24031-language-tests" class="DC-search-container"></div>
<script src="//assets.documentcloud.org/embed/loader.js"></script>
<script>
dc.embed.load('http://www.documentcloud.org/search/embed/', {
q: "projectid: 24031-language-tests ",
container: "#DC-search-projectid-24031-language-tests",
title: "",
order: "created_at",
per_page: 12,
@reefdog
reefdog / note-embed-example.html
Created February 18, 2016 21:31
Example of DocumentCloud note embed code
<div id="DC-note-53674" class="DC-note-container"></div>
<script src="//assets.documentcloud.org/notes/loader.js"></script>
<script>
dc.embed.loadNote('//www.documentcloud.org/documents/282753-lefler-thesis/annotations/53674.js');
</script>
<noscript>
<a href="https://www.documentcloud.org/documents/282753-lefler-thesis/annotations/53674.html">View note</a>
</noscript>
@reefdog
reefdog / page-embed-example.html
Last active February 18, 2016 21:32
Example of DocumentCloud page embed code
<div class="DC-embed" data-version="1.1">
<div style="font-size:10pt;line-height:14pt;">
Page 1 of <a class="DC-embed-resource" href="https://www.documentcloud.org/documents/282753-lefler-thesis.html#document/p1" title="View entire Lefler Thesis on DocumentCloud in new window or tab" target="_blank">Lefler Thesis</a>
</div>
<img src="//assets.documentcloud.org/documents/282753/pages/lefler-thesis-p1-normal.gif?1455829953" srcset="//assets.documentcloud.org/documents/282753/pages/lefler-thesis-p1-normal.gif?1455829953 700w, //assets.documentcloud.org/documents/282753/pages/lefler-thesis-p1-large.gif?1455829953 1000w" alt="Page 1 of Lefler Thesis" style="max-width:100%;height:auto;margin:0.5em 0;border:1px solid #ccc;-webkit-box-sizing:border-box;box-sizing:border-box;clear:both">
<div style="font-size:8pt;line-height:12pt;text-align:center">
Contributed to
<a href="https://www.documentcloud.org/" title="Go to DocumentCloud in new window or tab" target="_blank" style="font-weight:700;font-fa
@reefdog
reefdog / document-embed-example.html
Last active February 18, 2016 21:31
Example of DocumentCloud document embed code
<div id="DV-viewer-282753-lefler-thesis" class="DV-container"></div>
<script src="//assets.documentcloud.org/viewer/loader.js"></script>
<script>
DV.load("https://www.documentcloud.org/documents/282753-lefler-thesis.js", {
sidebar: false,
text: false,
container: "#DV-viewer-282753-lefler-thesis"
});
</script>
<noscript>
@reefdog
reefdog / petrify.js
Last active December 6, 2017 23:03
Redirect a GitHub URL to the last-committed version of that thing.
/*!
* Petrify
* Redirect yourself to a permanent version of a GitHub blob or tree.
*
* Say you're looking at `https://github.com/documentcloud/documentcloud/blob/master/public/javascripts/embed/search_embed.js#L315-L317`
* and you want to link to it in an email or GitHub comment. You realize that,
* when people follow the link years or even days later, it's likely the file
* will have changed so much that those line references won't be the same, and
* people won't know what you were talking about.
*
@reefdog
reefdog / twincities-css-override.css
Created December 3, 2015 21:13
Override rules to make DC viewer work on http://blogs.twincities.com/
#container .DV-docViewer,
#container .DV-docViewer-Container,
#container .DV-footer,
#container .DV-collapsibleControls,
#container .DV-textPage,
#container .DV-textContents,
#container .DV-thumbnails,
#container .DV-annotationContent,
#container .DV-annotationExcerpt,
#container .DV-annotationExcerptImage,