Skip to content

Instantly share code, notes, and snippets.

bosmacs / latex.template
Created Jun 28, 2011 — forked from michaelt/latex.template
Simple Pandoc latex.template with comments
View latex.template
%!TEX TS-program = xelatex
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
ryangray / buttondown.css
Created Feb 22, 2012
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
View buttondown.css
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
seeekr / apache-webp-rewrite.conf
Last active Mar 30, 2021
enabling apache to serve WebP image files if accepted by browser (and .webp files available)
View apache-webp-rewrite.conf
## !! This snippet has been updated, but not tested in practice. It should work, please check / leave comments in case it doesn't. !! ##
# originally from
<IfModule mod_rewrite.c>
# TODO: don't forget to put
# AddType image/webp .webp
# in your mods-available/mime.conf
# (though this is optional because we're setting
# the mime type manually in the RewriteRule)
firedfox / onDOMContentLoaded.js
Created Apr 24, 2012
phantomjs onDOMContentLoaded
View onDOMContentLoaded.js
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
if (msg.indexOf(PHANTOM_FUNCTION_PREFIX) === 0) {
eval('(' + msg + ')()');
} else {
View standard-privacy-policy.html
<div class="privacy-policy">
<h1>Privacy Policy</h1>
<section id="privacy-information-we-collect">
<h3>What information do we collect?</h3>
<p>We collect information from you when you register on our site, place an order, subscribe to our newsletter, respond to a survey or fill out a form.</p>
<p>When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address, mailing address, phone number, credit card information or social security number. You may, however, visit our site anonymously.
Google, as a third party vendor, uses cookies to serve ads on your site. Google's use of the DART cookie enables it to serve ads to your users based on their visit to your sites and other sites on the Internet. Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy.</p>
taterbase / upload.php
Created May 13, 2012
Simple file upload in php
View upload.php
<!DOCTYPE html>
<title>Upload your files</title>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
jbroadway /
Last active Jul 27, 2021
Slimdown - A simple regex-based Markdown parser.


A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
pitch-gist / gist:2999707
Created Jun 26, 2012
HTML: Simple Maintenance Page
View gist:2999707
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
searbe / parse_xlsx.php
Created Aug 7, 2012
Parse simple XLSX in PHP with SimpleXML and ZipArchive
View parse_xlsx.php
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!)
* but the usual tools were hitting the memory limit pretty quick. I found that
* manually parsing the XML worked pretty well. Note that this, most likely,
* won't work if cells contain anything more than text or a number (so formulas,
* graphs, etc ..., I don't know what'd happen).
nhunzaker / viewport.js
Created Oct 23, 2012
Viewports in Phantom.js
View viewport.js
// Viewport
// phantom.js viewport.js 400
var args = require("system").args;
var url = args[1];
var width = args[2];
var height = args[3];