Skip to content

Instantly share code, notes, and snippets.

View dhendo's full-sized avatar

David Henderson dhendo

  • Fresh Relevance
  • Southampton, UK
View GitHub Profile
@dhendo
dhendo / test.md
Last active November 21, 2016 15:02
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
options.metaOnly value cache (hit | miss) data returned work function called
not set / null hit y n
not set / null miss y if required
var vm = require("vm");
var i = 0;
var iterations = 2000;
var interval;
var startMem = process.memoryUsage().rss;
var lastMem = startMem;
var iteration = function() {
var sb = {};

Keybase proof

I hereby claim:

  • I am dhendo on github.
  • I am dhendo (https://keybase.io/dhendo) on keybase.
  • I have a public key whose fingerprint is 3751 3E43 196D 087A EDD0 EB80 7331 1A9E 9F44 23B1

To claim this, I am signing this object:

@dhendo
dhendo / out.html
Created July 17, 2013 13:10
Run Chimera 6 times - 3x loading using a url, 3x by passing a snippet of html
<html><head></head><body><div id="theDiv"><!-- Horizontal Layout -->
<table style="border-collapse: collapse; " cellpadding="5">
<tr>
<td valign="middle" style="text-align: center; font-family: sans-serif; font-size: 12px;
border: 1px solid #ccc; max-width: 150px;">
<a href="http://demostore.triggeredmessaging.com/canon-digital-rebel-xt-8mp-digital-slr-camera-with-ef-s-18-55mm-f3-5-5-6-lens-black.html" style="text-decoration: none; color:#444;"><img src="http://s4f97beb731337.img.gostorego.com/802754/cdn/media/s4/f9/7b/eb/73/13/37/catalog/product/cache/1/image/370x/9df78eab33525d08d6e5fb8d27136e95/c/a/canon-digital-rebel-xt-8mp-digital-slr-camera-1.jpg"
style="max-width: 175px; max-height: 100px; margin-top: 10px;"/></a>
@dhendo
dhendo / gist:4277592
Created December 13, 2012 16:21
Mongo Model Serializer for django-rest-framework
import mongoengine
class MongoModelSerializer(serializers.ModelSerializer):
def get_default_fields(self):
cls = self.opts.model
opts = get_concrete_model(cls)
#pk_field = opts.pk
fields = []
fields += [getattr(opts, field) for field in opts._fields]
#fields += [field for field in opts.many_to_many if field.serialize]
@dhendo
dhendo / gist:2575427
Created May 2, 2012 09:13
Some tests on the semantics of python string handling...
# coding=utf-8
def main():
try:
raise Exception(u"Something went wrong ³£$%^")
except Exception as e2:
pass
items = (1, 33.2, None, u'³£$%^', u'𐎴', {'dict': True, 'subdict': {'items': 'yes'}}, (('Tuple', True),),['item1', {'secondItem': False}], Exception, e2)
@dhendo
dhendo / demoModule.js
Created March 23, 2012 08:47
webservice.js Test
this.title = "Welcome to your webservice!";
this.name = "demo api module";
this.version = "0.1.0";
this.endpoint = "http://localhost:8556";
exports.echo = function(options, callback){
callback(null, options.msg);
};
exports.echo.description = "this is the echo method, it echos back your msg";
exports.echo.schema = {
@dhendo
dhendo / gist:1676534
Created January 25, 2012 14:34
Responsive Nav Test
<html class="no-js" lang="en">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"type="text/javascript"></script>
@dhendo
dhendo / gist:1309400
Created October 24, 2011 16:10
ZMQ layout
-------------- --------------
| WEB | | WEB |
| | | | TOP
| PUSH | | PUSH |
-------------- --------------
| |
|--------- --------|
| |
|\/|
|/\|