Skip to content

Instantly share code, notes, and snippets.

View muhammadghazali's full-sized avatar

Muhammad Ghazali muhammadghazali

View GitHub Profile
@muhammadghazali
muhammadghazali / get-event-list-json-load-test-on-appfog.md
Last active December 16, 2015 14:20
Load testing againts ghanoz-json Web API using Apache Benchmark. ghanoz-json is hosted on AppFog

Test command

ab -k -c 1 -n 400 -H "Accept: application/json" http://ghanozjson.ap01.aws.af.cm/events

Test results

This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
ab -k -c 500 -n 1000 -H "Accept: application/json" http://ghanozjson.ap01.aws.af.cm/events
This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking ghanozjson.ap01.aws.af.cm (be patient)
apr_pollset_poll: The timeout specified has expired (70007)

The command

git push origin

The warning message

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
@muhammadghazali
muhammadghazali / variables-declaration.md
Created May 1, 2013 22:56
Ghanoz JavaScript Style Guide

Satu variabel

var oneVariable;

Beberapa variabel dalam konteks yang sama

var
@muhammadghazali
muhammadghazali / event-list-request-seq-diagram-json.md
Created May 7, 2013 11:04
Event List Request Sequence Diagram
Title: Event List request should return response in JSON
Client->Web API\nRouters: Request Event List\nwith max. 15 items on the list\n(Accept: application/json)
Note right of Web API\nRouters: Is requested\n format accepted?\nYes!
Web API\nRouters->Data Access: Get Event List
Note right of Data Access: Retrieve the actual\n data on DB
Data Access->Web API\nRouters: Return raw data
Note right of Web API\nRouters: Populate resource\n in JSON
Web API\nRouters->Client: Send response\n(Content-Type: application/json)
@muhammadghazali
muhammadghazali / indent-size-2.js
Created May 10, 2013 15:16
Indent size preference on my JavaScript source code. I preferred to choose indent size with 2 spaces.
/**
* A middleware to check the requested content type.
*/
module.exports.acceptedFormat = function () {
return function (req, res, next) {
res.format({
'application/json': function () {
next();

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@muhammadghazali
muhammadghazali / the-most-useful-wordpress.md
Created July 3, 2013 09:31
The most useful Wordpress extension/plugin for Sublime Text 2

ng-app directive

In step 0 I learn how the AngularJS use the ng-app directive to flag an element which Angular should consider to be the root element of our application. By doing this, it gives us a freedom to tell Angular if the entire html page or only a portion of it should be treated as the Angular application.

Example 1:

<!doctype html>
<html lang="en" ng-app>
<head>
@muhammadghazali
muhammadghazali / notes.md
Last active December 20, 2015 01:39
AngularJS notes