Zhongde Liu

This is my personal "Clipboard" of web development stuff I come across


Leave a comment

Standards/Guidelines for building an HTTP API/Webservices/REST

General Overview about HTTP API Design

Thoughts on RESTful API Design

A document describing the experience the author, Geert Jansen, gained from designing the RESTful API for Red Hat’s Enterprise Virtualization product.  Summarizes his thoughts about how a “good” REST Service should look.

https://restful-api-design.readthedocs.org/en/latest/

HTTP API Design Guide from Heroku

The Heroku team has published their HTTP API Design Guide. It is a short guide / best-practice collection, giving a nice overview which aspects you should consider when designing an API.

https://github.com/interagent/http-api-design

Data formats

Following two links describing how the response should be formatted: These are consistent, documented quasi-standards for use as response formats. Main topic is the linking and discoverability between resources.

JSON API :: A standard for building APIs in JSON.

Living document, written by Steve Klabnik and Yehuda Katz. Media-type: application/vnd.api+json

http://jsonapi.org/

JSON HAL – Hypertext Application Language

Mike Kelly wrote down a convention expressing hyperlinks in JSON (or XML) and named it HAL. Media-type: application/hal+json

http://stateless.co/hal_specification.html,  http://tools.ietf.org/html/draft-kelly-json-hal-06

Collection+JSON – Hypermedia Type

A format definition focused on collections. Media-Type: application/vnd.collection+json

http://amundsen.com/media-types/collection/

 


Leave a comment

Links: AngularJS Styleguides

Here are some (opinionated) styleguides for AngularJS applications, I recently found on github. They are (currently) work-in-progress / living documents: (ordered by stars)

  1. https://github.com/mgechev/angularjs-style-guide
  2. https://github.com/johnpapa/angularjs-styleguide
  3. https://github.com/toddmotto/angularjs-styleguide

These style guides may give you a reference for the structure of your next AngularJS project.


2 Comments

Create/start a simple local HTTP Server

In order to develop or test some static code, without copying them into your apache webroot or something else, you easily can start a simple static webserver within the directory you are currently in with following tools.
Because you sometimes you just need a http:// (likely localhost) Url instead of a file://… one.

  1. If you have Python (https://www.python.org/) installed you can start a static web server with following command, depending on the installed version.
    python -m SimpleHTTPServer [port]//python2
    python3 -m http.server [port]//python3
  2. If you have PHP > 5.4.0 (http://php.net/) installed you can start one with:
    php -S localhost:[port]
  3. Using Ruby (https://www.ruby-lang.org/) you setup a simple server with this command:
    ruby -run -e httpd . -p [port]
  4. For node.js (http://nodejs.org/) I use the  “simple, zero-configuration command-line http server” package (https://www.npmjs.org/package/http-server).
    After the default npm installation

    npm install http-server -g

    you just type

    http-server -p[port]

    into your console.

These are some nifty tools (or “oneliners“), when it comes to browse a static/client app/website/file with your browser in your local environment without copying the files somewhere else.


Leave a comment

Link: Awesome Website and Checkout process Relaunch, all responsive: Virgin America

Just stumbled upon on a great example for a successful relaunch. Regarding Visual appereance, Checkout process, general Usability and technical platform.

https://www.virginamerica.com/

The site makes fun to use, loads pretty fast and is compared to the old version a whole new type of website. (And it uses angularJs 😀 – like!)


1 Comment

HTML5 Video Encoding – Codecs

There is no single combination of containers and codecs that works in all HTML5 browsers.

For maximum compatibility you need more than one version:

Container: WebM
Video-Codec: VP8
Audio-Codec: Vorbis

Container: Ogg
Video: Theora
Audio: Vorbis

Container: MP4
Video: H.264 baseline-profile
Audio: AAC (low complexity)

For MP4 Mobile pay attention to possible  max-resolutions on the different devices:
480×320 (base), 640×480 (no older androids, blackberrys) or more e.g. 1280×720 (only ‘new’ devices)…

 

More Info and references:

http://fortuito.us/diveintohtml5/video.html

http://blog.zencoder.com/2010/09/30/how-to-encode-video-for-mobile-use/

 

Frameworks/Libs for HTML5 implementation:

http://mediaelementjs.com/

http://videojs.com/