Skip to content

Instantly share code, notes, and snippets.

winhamwr / policystat_zendesk_uptime.html
Last active Mar 10, 2016
Zendesk home screen widget for displaying our uptime and satisfaction
View policystat_zendesk_uptime.html
Satisfied Customers / Application Uptime
<!-- This code lives at: Make all edits there, first -->
<style type="text/css" media="screen, projection">
@import url(;
.highlighted { color: #133672; }
.uptime-percentage {
font-weight: bold;
font-size: large;
winhamwr / example-usage.html
Last active Feb 4, 2016
WYMeditor plugin for inserting "special" characters (HTML entities)
View example-usage.html
<link rel="stylesheet" type="text/css" href="wymeditor/skins/default/skin.css" />
<!-- Note: You'll need to put everything in a "plugins/special_chars" directory
and add your own "plugins/special_chars/char.gif" icon that will be used for the button. -->
<textarea class="my-wymeditor"></textarea>
winhamwr / scale_wym.js
Created Jan 18, 2013
Scale WYMeditor when the window size changes
View scale_wym.js
function scaleEditor(wym) {
var min_width = 675;
var max_width = 850;
var min_height = 300;
var max_height = 600;
var width = $(window).width() - 50;
width = Math.max(width, min_width);
width = Math.min(width, max_width);
winhamwr / gist:3035439
Created Jul 2, 2012
zenbox integration
View gist:3035439
<!--[if gt IE 7]><!-->
<script type="text/javascript" src="//"></script>
<style type="text/css" media="screen, projection">
@import url(//;
<script type="text/javascript">
if (typeof(Zenbox) !== "undefined") {
dropboxID: "XXXXXXX",
url: "",
winhamwr / jquery.wymeditor.embed.js
Created Jun 19, 2012
WYMeditor embed plugin with video/source support
View jquery.wymeditor.embed.js
* WYMeditor : what you see is What You Mean web-based editor
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne,
* Dual licensed under the MIT (MIT-license.txt)
* and GPL (GPL-license.txt) licenses.
* For further information visit:
* File Name:
winhamwr /
Created Jun 4, 2012
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.

winhamwr /
Created May 17, 2012
Celery base task that adds some niceties for longish-running or singleton jobs.
Celery base task aimed at longish-running jobs that return a result.
``AwesomeResultTask`` adds thundering herd avoidance, result caching, progress
reporting, error fallback and JSON encoding of results.
from __future__ import division
import logging
import simplejson
View table_display.html
{% with table.rows as table_rows %}
{% autopaginate table_rows page_size %}
<table class="floating striped">
{% if max_matches %}
<strong class="num_results">Over {{ max_matches }}</strong> Results
{% else %}
winhamwr /
Created Apr 8, 2012
Linux timelapse video scripts
#! /bin/bash
set -e;
set -x;
rm -rf build;
mkdir build;
echo "Rotating images";
find *.jpeg -type f -print | xargs -I {} convert {} -rotate 90 build/{};
echo "Building combined mp4"
rm -f time-lapse.mp4;
ffmpeg -i %06d.jpeg -r 30 -s hd480 -vcodec libx264 -vpre hq time-lapse.mp4;
winhamwr / gist:2116251
Created Mar 19, 2012
WYMeditor customization example
View gist:2116251
$(document).ready(function() {
jQueryPath: "",
wymPath: "/site_media/lib/wymeditor/wymeditor/jquery.wymeditor.js",
toolsItems: "[ {'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}, {'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}, {'name': 'Superscript', 'title': 'Superscript', 'css': 'wym_tools_superscript'}, {'name': 'Subscript', 'title': 'Subscript', 'css': 'wym_tools_subscript'}, {'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}, {'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}, {'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}, {'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}, {'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}, {'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}, {'name': 'InsertImage'