Skip to content

Instantly share code, notes, and snippets.

View fadrizul's full-sized avatar

Fadrizul Hasani fadrizul

View GitHub Profile
@fadrizul
fadrizul / untitled
Created February 3, 2016 07:26
Test
new content
@fadrizul
fadrizul / untitled
Created February 3, 2016 07:03
Untitled
new content
@fadrizul
fadrizul / phabricator-to-hipchat.js
Last active August 29, 2015 14:15
Phabricator feed hooks to Hipchat notifications
/**
* Phabricator to HipChat feed message hooks
* Author: Fadrizul Hasani <fadrizul@gmail.com>
*/
var http = require('http');
var https = require('https');
var qs = require('querystring');
http.createServer(function (req, res) {
// Listen for incoming request from Phabricator
D/LocationIntentService( 3496): onHandleIntent
D/LocationIntentService( 3496): Connecting to location services
D/LocationIntentService( 3496): onConnected()
D/EventBus( 3496): post: DisplayErrorEvent [mId=1, mMessageId=2131427389, mMessageAction=HIDE, ]
D/LocationIntentService( 3496): Location: Location[fused 3.110897,101.638646 acc=32 et=+1d4h24m52s708ms alt=67.30000305175781]
D/LocationIntentService( 3496): FAILED, Location was stale. Current Time: 2014/02/03 16:27:42 +0800; Location time: 2014/02/03 15:17:35 +0800
D/EventBus( 3496): post: DisplayErrorEvent [mId=1, mMessageId=2131427391, mMessageAction=SHOW, ]
D/GCMRegistrationModel( 3496): Attempting GCM registration
I/GCM ( 1748): GCM config loaded
D/GCMRegistrationModel( 3496): GCM Registration Complete: APA91bHzofafS0DjGpZ0BacSHFLy64U4JHUDIQlh1ECTisa5hQzFJ7TbHClL6blYmxW_vTl8Y-MBixFvMRM82Q9LAhflBSvVoNouUCvRmTr7rDkQQP0W95LrFOEDQ2cglzpSlqizJnFBrcC59QbMFQo81V3QQGuDSxeI0-S-NGK2Ca9Ag3vaQAM
D/HttpClient( 3496): Request to: https://dodol.grabtaxi.com/drivers/mytoxi.ph@gmail.com/gcm/register
D/HttpClient( 3496): {"errorMessageCode":"emailNotFound","developerMessage":"We're sorry, we couldn't find the account registered using, mytoxi.ph@gmail.com"}
W/GcmInitializationModel( 3496): null
D/EventBus( 3496): post: DisplayErrorEvent [mId=31, mMessageId=2131427376, mMessageAction=PERSIST, mExtra=HTTPResponse [mCode=401, mData={"errorMessageCode":"emailNotFound","developerMessage":"We're sorry, we couldn't find the account registered using, mytoxi.ph@gmail.com"}]]
D/dalvikvm( 3496): GC_FOR_ALLOC freed <1K, 14% free 17077K/19780K, paused 42ms, total 42ms
I/ActivityManager( 617): START u0 {act=com.google.android.gms.common.account.CHOOSE_ACCOUNT cmp=com.google.android.gms/.common.account.AccountPickerActivity (has extras)} from pid 3496
D/EventBus( 3496): unregister: com.grabtaxi.driver.lib.common.errors.DisplayErrorHandler@427304f0
D/EventBus( 3496): unregister: ue@42411e00
I/ActivityManager( 617): Displayed com.google.android.gms/.common.account.AccountPickerActivity: +155ms (total +974ms)
D/AccountSelectionModel( 3496): Account selection succeeded
D/EventBus( 3496): post: DisplayErrorEvent [mId=11, mMessageId=2131427372, mMessageAction=HIDE, mExtra=false]
D/GCMRegistrationModel( 3496): doInBackground
D/GCMRegistrationModel( 3496): Attempting GCM registration
I/GCM ( 1748): GCM config loaded
D/LocationIntentService( 3496): Location: Location[fused 3.110753,101.639122 acc=58 et=+1d4h7m25s674ms alt=109.0]
D/LocationIntentService( 3496): FAILED, Location was stale. Current Time: 2014/02/03 15:07:05 +0800; Location time: 2014/02/03 15:00:08 +0800
D/EventBus( 3496): post: DisplayErrorEvent [mId=1, mMessageId=2131427391, mMessageAction=SHOW, ]
D/SntpClient( 3496): null
D/SntpClient( 3496): java.net.SocketTimeoutException
D/SntpClient( 3496): at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:551)
D/SntpClient( 3496): at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
D/SntpClient( 3496): at java.net.PlainDatagramSocketImpl.doRecv(PlainDatagramSocketImpl.java:161)
D/SntpClient( 3496): at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:169)
D/SntpClient( 3496): at java.net.DatagramSocket.receive(DatagramSocket.java:250)
<html>
<head>
<title>Welcome to GrabTaxi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#E5E5E5" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="text-align:center;">
<!-- Save for Web Slices (grabtaxi_softlaunch_edm(slice).psd) -->
<table align="center" id="Table_01" width="600" height="1442" border="0" cellpadding="0" cellspacing="0" style="font-family:Arial;">
<tr style="background:#FFF;">
<td width="200" height="80" colspan="3" rowspan="4">
D/EventBus( 1974): post: JobStateChangeNotification [mBookingId=5388907, mNewState=PICKING_UP]
D/DefaultResponseHandler( 1974): id: JobStateChangeResponseHandler onStart
D/HttpClient( 1974): Request to: https://dodol.grabtaxi.com/drivers/fadrizul@gmail.com/jobs/5388907
D/HttpClient( 1974): Setting header sessionToken=APA91bHzofafS0DjGpZ0BacSHFLy64U4JHUDIQlh1ECTisa5hQzFJ7TbHClL6blYmxW_vTl8Y-MBixFvMRM82Q9LAhflBSvVoNouUCvRmTr7rDkQQP0W95LrFOEDQ2cglzpSlqizJnFBrcC59QbMFQo81V3QQGuDSxeI0-S-NGK2Ca9Ag3vaQAM
D/HttpClient( 1974): Setting header AppName=GrabTaxiDriver
I/GoogleMapManager( 1974): Connection to LocationClient has successful.
D/DefaultResponseHandler( 1974): id: JobStateChangeResponseHandler onSuccess
D/DefaultResponseHandler( 1974): id: JobStateChangeResponseHandler onFinish
D/AJobsListFragment( 1974): onJobStateChange: JobStateChangeNotification [mBookingId=5388907, mNewState=PICKING_UP]
D/AJobsListFragment( 1974): onJobStateChange: JobStateChangeNotification [mBookingId=5388907, mNewState=PICKING_UP]
D/HttpClient(18377): Request to: https://dodol.grabtaxi.com/drivers/fadrizul@gmail.com/gcm/register
D/HttpClient(18377): {"errorMessageCode":"driverNotActivated","developerMessage":"Apologies, looks like your account isn't active, please contact our support centre for assistance"}
W/GcmInitializationModel(18377): null
D/EventBus(18377): post: DisplayErrorEvent [mId=31, mMessageId=2131427376, mShow=true, mExtra=HTTPResponse [mCode=403, mData={"errorMessageCode":"driverNotActivated","developerMessage":"Apologies, looks like your account isn't active, please contact our support centre for assistance"}]]
D/EventBus(18377): post: DisplayErrorEvent [mId=31, mMessageId=2131427376, mShow=true, mExtra=HTTPResponse [mCode=403, mData={"errorMessageCode":"driverNotActivated","developerMessage":"Apologies, looks like your account isn't active, please contact our support centre for assistance"}]]