Posts tagged with coding

  • My first Composer package - Permit

    Hurray! Contributed the first Laravel package. Yessssss!


    Read More
  • Android Quickform Engine

    Just rewrite this small library to generate forms automatically on Android (my latest side project) :)

    In future, probably, I will add more form elements and maybe more form data store to save to sqlite/memory instead of SharedPreferences.

    Below is the github project:

    Android Quickform

    Some quick notes:

    Android Quickform is a simple form generator for Android. This project is inspired by iOS QuickDialog form library.

    To create a form, check the demo project for example. A form is made up of different sections which consists of...

    Read More
  • Prevent UIWebView white flashing issue

    Recently have this problem in my project. Take me a while to resolve the issue. I was loading UIWebView and execute some Javascript to dynamically update the local HTML.

    Send command to webview

    NSMutableDictionary* jsonDit = ***; // create a dictionary here 
    // use SBJSON to convert dictionary to a JSON. use this to escape the string
    // this json will be executed by the page
    NSString *js = [[NSString alloc]initWithFormat:@"setHtml(%@);", [jsonDit JSONRepresentation]  ];
    [self.webview stringByEvaluatingJavaScriptFromString:js];


    Read More
  • Dealing with dynamic dropdowns with CasperJS

    In my experiment with CasperJS to extract the data from an aspx page, I faced some issues with dynamic drop-down. What happened is that there can be 2-3 dropdowns box that depend on each other e.g. User selects a category in dropdown1 , an AJAX request is triggered to create and populate sub-categories in dropdown2.

    My first reaction to this problem is to use Chrome Network Tool to capture the POST request when the form is submitted to find out all the parameters. Then, I attempt to simulate this by filling the form with all the...

    Read More
  • Fun scraping with casperjs and phantomjs

    Recently, I have been playing around with CasperJS and PhantomJS for web scraping. I always find screen scraping fun and fascinating. I mean there are just so many applications:

    1. We have bills/accounts all over the place in different websites. The scraping tools can be used to develop a program for personal use that can combine the results in a single place. It also can be used to trigger notifications e.g. bill payments reminder, manga notification, movies notification. The possibility is just endless :)

    2. We want to find and compare the...

    Read More