Skip to content

Instantly share code, notes, and snippets.

View Tronix117's full-sized avatar

Jeremy TRUFIER Tronix117

View GitHub Profile
@Tronix117
Tronix117 / backbone-sync-with-pagination.coffee
Last active August 29, 2015 14:01
Backbone pagination using Content-Range header
# Backbone Pagination with header
#
# Get remote number of resources, and add it in the `remoteCount` attribute of the collection
# this attribute can then be use to create proper pagination.
#
# Expected format is an header `Content-Range` with following format:
# `resource 40-49/234` (HTTP 1.1 format)
# * `resource` is the name of the resource (can be `resource`, not important)
# * `40-49` is the range of returned items (item 40 to item 49)
# * `234` is the total number of items (this is the important part)
const app = require('express')()
const db = {
users: [
{ id: 0, firstname: 'Jean', lastname: 'Bond' },
{ id: 1, firstname: 'Emilie', lastname: 'Lol' },
]
}
class HttpError extends Error {

TP - WIK-JS-302 - Introduction au Typescript (orienté WebService)

Objectifs

Sujet

Concevoir un ORM qui permet de communiquer avec le service externe https://jsonplaceholder.typicode.com

Cet ORM sera réalisé en TypeScript et typé au maximum.