Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am smizell on github.
  • I am smizell ( on keybase.
  • I have a public key ASA6Hq_DyR581YFdOxPy9eU9ZS1gSHvaEZ8kW8u0DXp9WAo

To claim this, I am signing this object:



User Example

Example of reusing model

Group Users

User [/users/{id}]

  • Model (application/json)

Recursive HAL

There are a few steps you can take to simplify HAL even more than it is by making links recursive resources. It requires these changes.

  1. Add a _href property to be used to specify the URI of the resource. This would replace using self links.
  2. Change templated to _templated
  3. Change hreflang to _hreflang
  4. Change title to _title
  5. Consider links to be full HAL objects
smizell / vnd.error.xml
Created Jul 31, 2014
ALPS doc for defining semantics and links for error messages, as taken from the vnd.error media type
View vnd.error.xml
<alps version="1.0">
<descriptor id="error" type="semantic">
<doc>Error Message</doc>
<descriptor id="message" type="semantic">
For expressing a human readable message related to the current error which may be displayed to the user of the api
View action-inputs.xml
<uber version="1.0">
<data rel="item" url="">
<data name="givenName">Mike</data>
<data name="familyName">Amundsen</data>
<data name="hatsize">Medium</data>
<data name="update" action="replace" url="">
<data name="familyName">
<data name="required">true</data>
<data name="givenName" />
smizell / gist:2511298
Created Apr 27, 2012
MySQL Backup Script (Bash)
View gist:2511298
#backup all mysql databases
# list MySQL databases and dump each
DATESTAMP=$(date +%Y%m%d)
# remove old backups
find ${DIR} -type f -mtime +5 -exec rm -rf {} \;
View gist:2502461
window.MobileAppCollection = Backbone.Collection.extend
url: ""
model: MobileApp
window.MobileApp = Backbone.Model.extend
urlRoot: ""
url: () ->
base = @urlRoot || (@collection && @collection.url)
smizell / get_query
Created Mar 27, 2012
Query String Templatetag
View get_query
import urllib
from django import template
from django.conf import settings
register = template.Library()
class GetQuery(template.Node):
def __init__(self, query_dict, key, value):
smizell / gist:611766
Created Oct 5, 2010
Chrome Frame Django Middleware
View gist:611766
from django.conf import settings
class ChromeFrameMiddleware(object):
Adds the Google Chrome Frame meta tag to your page
If you don't want it to check if Chrome Frame is installed,
put this in your file.