Refused to get unsafe header “Content-Disposition”

Hit into this error when tying to get the “Content-Disposition” header using XMLHttpRequest.

Finally found the solution is to include CORS access control headers in HTTP response….

Take note that it’s not Access-Control-Allow-Headers but Access-Control-Expose-Headers

Credit to this stackoverflow post.

 

Business Hour Format

I’m creating a form which allow user to key in multiple days of week with multiple operation hours.

I want the format to save as below, but I found it tedious to reformat for displaying using normal javascript. Look into lodash and found it very handy 🙂

Format to display:

Plunker here

Reference: schema.org

 

My New Gadget – Pine64

img_5615.jpg
Here is how I did to install the OS (using MacOS)

  1. Download image from Pine64.com or Pine64.org.
  2. Format your Micro SD card using Disk Utility.
    diskutil
  3. Launch terminal and list the available disk using diskutil command as below (we going to use disk2 base on the identifier):
  4. Unmount the disk.

     
  5. Unzip the downloaded image and burn the img file into disk.

     
  6. Upon burning successfull, you will see the message as below:
  7. Eject the disk if it still mounted.

    p/s: For Windows user, you may format using Disk Management tool under [Control Panel\System and Security\Administrative Tools\Computer Management], and burn img file using Win32DiskImager. And if you feel the writing speed is too slow in MacOS, you may try using rdisk instead of disk, as they both using different write mechanism.

Credit to : rayhightower.com && www.hostvirtual.com && serenity.ee

 

Paper

Tap on the app icon, the news feed does not refresh as usual…

After Google Reader, this is second time “giant” kill my favorite apps for “reasons”. I feel upset as ordinary user, wonder how about mates who created Paper.

 

Reset Epson L210 Counter / Ink Out Error

Received the used printer from brother.

As usual, “free + old” stuff normally doesn’t works well without some tweak …. phew….. here we go.

First, fixed “Service required” which mentioned printer counter exceed (can’t recall the exact message)

Download the Epson adjustment program here and follow instruction here.

Second, fixed “Ink out error”

Follow instruction here to reset ink level.

Credit to : 
askindoprinter.blogspot.my
www.downloaddrivers.in

 

 

 

Disable WebView Application Being Pull Up and Down

I’ve created a hybrid app using Cordova, and notice I’m able to pull the header down and footer up, which lead to weird behaviour when using the app (at least I feel so).

Normal View

normal view

Pull Up

pull up

pull down

pull down

Adding single line of configuration in config.xml solve the issue. (pheeew… spend couple of hours to research this)

Reference: http://cordova.apache.org/docs/en/6.x/config_ref/index.html
 

Test Driven Development

Just finished Test-Driven Java Development (but will take longer time to digest), and  notice there are few tools/framework worth to share.

Test Driven Development Framework

Unit Test Code Coverage Mocking
JUnit JaCoCo (Java Code Coverage)) Mockito
TestNG EasyMock
Hamcrest PowerMock
AssertJ

Behavior Driven Development Framework

Web Testing
RESTful API Testing
Selenide REST Assured
JBehave
Cucumber

Overall this is quite a good book if you practice TDD, as it include bunch of  hands on tutorial. Personally I think practicing TDD is good if we have solid requirement (or at least not changing every few days), else we will waste a lot of time just to maintain unit test for immature requirement 🙂