Zhongde Liu

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


Leave a comment

Herokus Design Styleguide

Heroku just recently made their ui styleguide/style kit public available. This is another great example of a good structured and visual appealing reference for the frontend elements. You provide code examples and actual design in this living document for typography, buttons, forms, grids, etc…

http://purple.herokuapp.com/

Such a reference can make a huge impact in terms of communication between different departments and stakeholders. Combine it with wireframes you get a really fast instrument to talk over and improve new design plans.

If not, don’t wonder if your end result is a design chaos, and your css/html is duplicated all over the place…


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.


Leave a comment

Stylesheet limits in Internet Explorer <= 9

One point on the web performance list is: “Concatinate and minify all your css into one file”. However in IE (version lower than 10), you have an internal limit regarding the stylesheet file.

These are the facts:

  • A sheet may contain up to 4095 rules
  • A sheet may @import up to 31 sheets
  • @import nesting supports up to 4 levels deep

The official statement on the MSDN blog here:  http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx

If you eventually  get over these marks (and with an optimized generated css file, it is more likely) , you have to split your stylesheets into multiple files (in Production).

For example, github.com currently uses two css files for its normal website, named github.css and github2.css.

 


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/


1 Comment

Reference: Google Code Styleguides

Reference Styleguide for different languages from Google

http://code.google.com/p/google-styleguide/

from the Page:

google-styleguide – Style guides for Google-originated open-source projects

“Style” covers a lot of ground, from “use camelCase for variable names” to “never use global variables” to “never use exceptions.” This project holds the style guidelines we use for Google code. If you are modifying a project that originated at Google, you may be pointed to this page to see the style guides that apply to that project.

 


1 Comment

Reference: Zen Coding Syntax

For HTML:
http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn

Example:
div#content.wrapper>h1+p*2

Result:
<div id="content" class="wrapper>
<h1></h1>
<p></p>
<p></p>
</div>

 

For CSS:
http://code.google.com/p/zen-coding/wiki/ZenCSSPropertiesEn

Cheatsheet (PDF):
http://code.google.com/p/zen-coding/downloads/detail?name=ZenCodingCheatSheet.pdf