Skip to content

Instantly share code, notes, and snippets.

View liangzan's full-sized avatar

Wong Liang Zan liangzan

View GitHub Profile
<?php
/**
* Sample to use Courex XML Technical Guide
*
* How to use:
* Search for "//input" and fill in the data accordingly
*
* @author Tao Yueling <[email protected]>
* @copyright 2014 Courex Pte Ltd
* @version 1.0.0
#!/usr/bin/env bash
# leaves 5 copies of the standalone app
total_files=$(find -name '*.jar' -type f -print0 | xargs -0 ls -t | wc -l)
file_num_to_remove=`expr $total_files - 5`
find -name '*.jar' -type f -print0 | xargs -0 ls -t | tail -n $file_num_to_remove | xargs rm
toResponse :: IO (Response BL.ByteString) -> BL.ByteString
toResponse i = view responseBody i
-- compiler error
Couldn't match type ‘IO (Response BL.ByteString)’
with ‘Response BL.ByteString’
arising from a functional dependency between:
constraint ‘mtl-2.2.1:Control.Monad.Reader.Class.MonadReader
(Response BL.ByteString) ((->) (IO (Response BL.ByteString)))’
arising from a use of ‘view’
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<res:DCTResponse
xmlns:res='http://www.dhl.com'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com DCT-Response.xsd'>
<GetQuoteResponse>
<Response>
<ServiceHeader>
<MessageTime>2016-04-05T05:01:20.512+01:00</MessageTime>
<MessageReference>1234567890123456789012345678901</MessageReference>
<SiteID>CourexPteL</SiteID>
<?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
<GetQuote>
<Request>
<ServiceHeader>
<MessageTime>2002-08-20T11:28:56.000-08:00</MessageTime>
<MessageReference>1234567890123456789012345678901</MessageReference>
<SiteID>CourexPteL</SiteID>
<Password>i1td5gCzM7</Password>
</ServiceHeader>