Skip to content

Instantly share code, notes, and snippets.

View muhammadghazali's full-sized avatar

Muhammad Ghazali muhammadghazali

View GitHub Profile
@muhammadghazali
muhammadghazali / event-details.json
Last active December 16, 2015 08:58
ghanoz-json: Event Details resource representations design in JSON
{
"url": "http://example.com/event/511206849146c42125000001",
"data": {
"title": "Free event",
"shortDescription": "Free event for students",
"times": [
{
"milliseconds": 1613028781634,
"fullFormat": "Thu Feb 11 2021 14:33:01 GMT+0700 (WIT)",
"year": 2021,
@muhammadghazali
muhammadghazali / event-list.json
Last active December 16, 2015 08:58
ghanoz-json: Event List resource representations design in JSON
{
"url": "http://example.com/events",
"data": [
{
"title": "Free event",
"shortDescription": "Free event for students",
"times": [
{
"milliseconds": 1613028781634,
"fullFormat": "Thu Feb 11 2021 14:33:01 GMT+0700 (WIT)",
@muhammadghazali
muhammadghazali / event-details.xml
Last active December 16, 2015 08:59
ghanoz-json: Event Details resource representations design in XML
<response>
<url>http://localhost:3000/event1</url>
<data id="1">
<title>Diam nisl tation.</title>
<shortDescription>Amet dolore praesent consequat te.</shortDescription>
<times>
<time>
<milliseconds>1613028781634</milliseconds>
<fullFormat>Thu Feb 11 2021 14:33:01 GMT+0700 (WIT)</fullFormat>
<year>2021</year>
@muhammadghazali
muhammadghazali / event-list.xml
Last active December 16, 2015 08:59
ghanoz-json: Event List resource representations design in XML
<response>
<url>http://localhost:3000/events</url>
<data>
<data id="1">
<title>Diam nisl tation.</title>
<shortDescription>Amet dolore praesent consequat te.</shortDescription>
<times>
<time>
<milliseconds>1613028781634</milliseconds>
@muhammadghazali
muhammadghazali / get-event-details-acceptance-test.md
Created April 18, 2013 15:42
Get Event Details Acceptance Test

Scenario 1: Event Details request should return response in JSON

Given Event Details resource is accessible

And Event Details resource is accessible

When the client request the Event Details in JSON

Then the Web API should return Event Details in JSON

@muhammadghazali
muhammadghazali / get-event-list-acceptance-test.md
Created April 18, 2013 16:00
Get Event List Acceptance Test

Scenario 1: Event List request should return response in JSON

Given Event List resource is accessible

And Event List resource is accessible

When the client request the Event List in JSON

Then the Web API should return Event List in JSON

@muhammadghazali
muhammadghazali / acceptedContentType.js
Created April 22, 2013 16:18
An Express middleware to check the requested content type.
/**
* A middleware to check the requested content type.
* Note:
* Just be sure to place the middleware before:
* app.use(app.router);
*/
module.exports.acceptedContentType = function () {
return function (req, res, next) {
@muhammadghazali
muhammadghazali / get-event-details-json-api-doc.md
Last active December 16, 2015 12:49
ghanoz-json: Get Event Details API Documentations

API URL

http://ghanozjson.ap01.aws.af.cm/event/1

Request Header

Accept: application/json
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
@muhammadghazali
muhammadghazali / get-event-list-json-api-doc.md
Created April 23, 2013 03:18
ghanoz-json: Get Event List API Documentations

API URL

http://ghanozjson.ap01.aws.af.cm/events

Request Header

Accept: application/json
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
@muhammadghazali
muhammadghazali / express-app-source-code-directory-layout.md
Last active December 16, 2015 14:09
The best Node.JS app source code layout directory that fit to my needs: https://github.com/muhammadghazali/ghanoz-json
.
├── app
│   ├── app.js
│   ├── configs
│   ├── middlewares
│   ├── routes
│   └── utils
├── CHANGELOG.md
├── doc