Skip to content

Instantly share code, notes, and snippets.

View jemerick's full-sized avatar

Jason Emerick jemerick

View GitHub Profile
@jemerick
jemerick / gist:9536094
Created March 13, 2014 20:17 — forked from kevingessner/gist:9509148
Responsive email template
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}
@jemerick
jemerick / keybase.md
Created October 30, 2014 19:56
keybase.md

Keybase proof

I hereby claim:

  • I am jemerick on github.
  • I am jemerick (https://keybase.io/jemerick) on keybase.
  • I have a public key whose fingerprint is 8BD6 32E8 D73E 6158 C11E DD43 A212 8EFE F6B8 0398

To claim this, I am signing this object:

@jemerick
jemerick / 4state.xml
Created August 19, 2015 14:52
4-State Challenge Waypoints
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creator="GPS TrackMaker" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<!-- SHELTERS -->
<wpt lat="39.359891939" lon="-77.661743153">
<name>SH EDGAR</name>
<cmt>Ed Garvey Shelter</cmt>
<sym>Waypoint</sym>
</wpt>
<wpt lat="39.412662687" lon="-77.637042514">
<name>SH CRMPG</name>
package org.hamberry.util;
import net.rim.device.api.servicebook.ServiceBook;
import net.rim.device.api.servicebook.ServiceRecord;
import net.rim.device.api.system.DeviceInfo;
import net.rim.device.api.system.EventLogger;
public class NetworkConfig
{
private static Logger log = Logger.getInstance();
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
throw new ApplicationManagerException("GoogleMaps isn't installed");
}
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action","LOCN");
uepd.append("a", "@latlon:"+l.getLatitude()+","+l.getLongitude());
uepd.append("title", l.getName());
uepd.append("description", l.getDescription());
String[] args = { "http://gmm/x?"+uepd.toString() };
# Load custom template tags in all templates
# Custom template tags that you use all over your templates can be auto loaded. Just add the following in a module that is # loaded (i.e. your urlconf if you want the template tags to be loaded for the whole project)
from django import template
template.add_to_builtins('project.app.templatetags.custom_tag_module')
# relative paths
import os.path
TEMPLATE_DIRS = (
# In-memory Cassandra-ish thingy... useful for unit tests. Maybe useful for other
# stuff too? No support for SuperColumns, but that should be easy enough to add.
import bisect
import copy
from cassandra.ttypes import NotFoundException, Column, ColumnPath, ColumnOrSuperColumn
class SSTable(object):
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
"""
Some simple utilities to read the magic bytes from the beginning of a
file and determine whether the file meets certain criteria (e.g., contains
JPEG image data).
"""
import array
from operator import eq
IMAGE_MAGIC_DATA = (
"""
Simple timer class. Example usage:
t = Timer()
for url in ('http://www.google.com/', 'http://www.yahoo.com/'):
t.start('fetch url')
content = urllib.urlopen(url).read()
t.stop('fetch url')
t.start('reorder bytes')
bytes = list(content)