Skip to content

Instantly share code, notes, and snippets.

View themihai's full-sized avatar

Mihai themihai

View GitHub Profile
@ericgj
ericgj / 0-description.md
Last active April 5, 2020 22:50
Implementing a REST workflow using JSON Schema, an example

Implementing a REST workflow using JSON Schema, an example

The problem domain

You are designing a document-control system. Users create and edit documents for publication. Documents can be draft, in review, on hold, in process, or published. Users have specific roles which determine which documents they have access to, and what they are permitted to do to the documents, as the documents move through the workflow. Some users are writers, others are editors.

Expressed in plain language, the rules are:

  • Writers can view their own documents regardless of status.
  • Writers can create new documents.
  • Writers can save new documents as draft, or to in review if certain information is included.
@aaronshaf
aaronshaf / bookmarklet-expanded.js
Last active February 25, 2024 18:56
Copy text from Amazon's Cloud Reader. Helpful for students that need block quotes.
javascript: (function () {
new_window = window.open();
new_window.document.body.innerHTML = $("iframe")
.contents()
.find("iframe")
.contents()
.find("body")
.get(1).innerHTML;
new_window.document.body.querySelector("#content-overlays").remove();
})();