Skip to content

Instantly share code, notes, and snippets.

View mamund's full-sized avatar

Mike Amundsen mamund

View GitHub Profile
@mamund
mamund / attach-template.js
Created February 6, 2014 01:21
possible cj extension to support uploads. if "file" property appears in the "template" object then client SHOULD use multipart/form-data for sending the request body.
// cj write template
{
"template" : {
"data" : [
{"name" : "qwe", "value" : ""},
{"name" : "rty", "file" : ""}
]
}
}
@mamund
mamund / uber.js
Created February 9, 2014 02:10
sample Uber in JSON and XML
{
"uber" :
{
"version" : " 1.0",
"data" :
[
{"rel" : "self", "url" : "http://example.org/"},
{"rel" : "profile", "url" : "http://example.org/profiles/people-and-places"},
"data" :
[
@mamund
mamund / metadata-cj.js
Created February 12, 2014 16:48
top-level metadata object for Cj
{
"collection" : {
"links" : [],
"metadata" : {
"data" :[
{"name" : "pagecount", "value" : "257", "prompt" : "Pages:"}
]
},
@mamund
mamund / template-v-item.js
Last active August 29, 2015 13:56
item and template don't need to coincide
{
"collection" : {
"version" : "1.0",
"href" : "http://example.org/template-v-items/",
"links" : [
{"rel" : "help", "href" : "http://example.org/template-v-item/publications.html"},
{"rel" : "profile", "href" : "http://example.org/template-v-item/profiles/publications.alps"}
],
@mamund
mamund / shared-prompts.js
Created February 27, 2014 22:03
shared prompts for Cj items
{
"collection" : {
"version" : "1.0",
"href" : "http://example.org/shared-prompts/",
"prompts" : [
{"name" : "givenName", "prompt" : "First Name"}.
{"name" : "familyName", "prompt" : "Last Name"},
{"name" : "avatar", "prompt" : "Mug Shot"},
{"name" : "blog", "prompt" : "Home Page"}
@mamund
mamund / webapibook_alps.xml
Last active August 29, 2015 13:57 — forked from glennblock/webapibook_alps.xml
Forked Web API Book ALPS document (from @gblock)
<alps version="1.0">
<doc>Issue tracking profile</doc>
<!-- data vocabulary -->
<descriptor id="id" type="semantic"/>
<descriptor id="title" type="semantic"/>
<descriptor id="description" type="semantic"/>
<descriptor id="status" type="semantic"/>
<descriptor id="action" type="semantic"/>
<descriptor id="search-text" type="semantic"/>
@mamund
mamund / uber-doc.xml
Last active August 29, 2015 13:57
parsing an UBER doc
<data id="user01" name="user"> <!-- URL=false + innerText=false + children=true + parent=false, so this is a container that belongs to the document -->
<data name="actions"> <!-- URL=false + innerText=false + children=true + parent=true, so this is a container that belongs to "user01" -->
<data rel="item" url="/user/1" action="read" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belongs to "user01/actions" -->
<data rel="/rels/replace" url="user/1" action="replace" template="#userUpdate" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions"-->
<data rel="/rels/delete" url="user/1" action="remove" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions" -->
<data rel="/rels/suspend" url="/suspendUser/{id}" action="append" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transi
@mamund
mamund / keybase.md
Created March 16, 2014 18:49
keybase.md

Keybase proof

I hereby claim:

  • I am mamund on github.
  • I am mamund (https://keybase.io/mamund) on keybase.
  • I have a public key whose fingerprint is AD5D 8564 388E 366E E0DC 960C 6815 6BEE 29E9 4D39

To claim this, I am signing this object:

@mamund
mamund / gist:9779214
Last active August 29, 2015 13:57
Using Cj as a diff format
{
"collection" : {
"version" : "1.0",
"href" : "http://example.org/cj-diff.js",
"links" : [
{"rel" : "help", "href" : "http://example.org/cj-diff.html"},
{"rel" : "profile", "href" : "http://exmaple.org/profiles/cj-dff.alps"}
],
@mamund
mamund / uber-links-and-images.xml
Last active August 29, 2015 13:57
UBER representation that mixes inline text with child elements.