Skip to content

Instantly share code, notes, and snippets.

View mamund's full-sized avatar

Mike Amundsen mamund

View GitHub Profile
@mamund
mamund / 01-list.js
Created August 25, 2014 15:16
supporting custom templates in Cj
{
"collection" : {
"version" : "1.0",
"href" : "http://api.example.com/list",
"links" : [
{"rel" : "payment", "href" : "http://api.example.com/payment", "prompt" : "Select Payment Method"}
],
"items" : [
@mamund
mamund / 01-embedd.js
Created August 25, 2014 15:44
cross-compatible "embed" for Cj. clients that support the "embedded" extension can ignore the links that are marked "render" : "embedded"
{
"collection": {
"href": "/characters.json",
"links" : [
{"rel" : "collection", "href" : "/characters/the_doctor/actors.json", "render" : "embedded"}
],
"embedded": [
{
@mamund
mamund / people-search.xml
Last active August 29, 2015 14:05
Google People Search ALPS document
<alps version="1.0">
<link rel="self" href="https://rawgit.com/mamund/9ed1614903f5bddec660/raw/b5e5d0f7250ca5af4169e369036289e52fd6f290/people-search.xml" />
<link rel="help" href="https://developers.google.com/+/api/latest/people/search" />
<doc type="text">
Search all public profiles. Try it now or see an example.
For large result sets, results are paginated. For the most up-to-date search results,
do not use a pageToken older than five minutes. Instead, restart pagination by
repeating the original request (omitting pageToken).
</doc>
@mamund
mamund / restfest2014-todo.xml
Created September 1, 2014 22:26
RESTFest 2014 ToDo API ALPS Document
<alps version="1.0">
<link rel="help" href="https://github.com/RESTFest/2014-Greenville/wiki/Hack%20Day" />
<!-- semantic descriptors (data elements) -->
<descriptor id="todoid" type="semantic" />
<descriptor id="todoTitle" type="semantic" />
<descriptor id="todoDateDue" type="semantic" />
<descriptor id="todoNotes" type="semantic" />
<descriptor id="categoryid" type="semantic" />
<descriptor id="categoryTitle" type="semantic" />
@mamund
mamund / comment-puzzler.js
Created September 4, 2014 20:37
OData puzzlers
// dealing with comments related to multiple entities
{
"comment" : {
"id" : "...",
"dateCreated" : "...",
"authorId" : "...",
"commentText" : "...",
"associations" : [
{"id" : "...", "type" : "problem"},
{"id" : "...", "type" : "incident"},
@mamund
mamund / 01-list.html
Last active August 29, 2015 14:07
InfoQ API Design Methodology Examples. To-Do List and Item representations for HTML, ALPS profile for To-Do Service
<html>
<head>
<!-- for test display only -->
<title>To Do List</title>
<style>
.name, .scheduledTime, .status, .item {display:block}
</style>
</head>
<body>
<!-- for test display only -->
@mamund
mamund / search-nesting.js
Created October 17, 2014 00:59
some UBER design examples.
{
"uber" :
{
"version" : "1.0",
"data" :
[
{"rel" : ["self"], "url" : "http://example.org/"},
{"rel" : ["profile"], "url" : "http://example.org/profiles/people-and-places"},
{
@mamund
mamund / onename.txt
Created November 28, 2014 16:27
onename verifier
Verifying that +mamund is my openname (Bitcoin username). https://onename.io/mamund
@mamund
mamund / cj-representor.js
Last active August 29, 2015 14:13
Sample transition modeling for "The Big ToDo" example -- NOTE code quality here is totally unreliable. these are partial, WIP snippets from a frazzled brain. --@mamund
/*******************************************************
* big-todo
* Representation Service for collection+json
* January 2015
* Mike Amundsen (@mamund)
* Soundtrack : Out to Lunch : Eric Dolphy
*******************************************************/
var transitions = require('./../transitions.js');
@mamund
mamund / validation.js
Created January 22, 2015 17:48
Validating inputs in Cj
{ "collection" :
{
"version" : "1.0",
"href" : "http://api.example.com/users",
"links" : [
],
"items" : [
],