• A Simple Callback in Java for Android

    It all started when I received a NetworkOnMainThreadException while testing an Android prototype that makes an HTTP request to my backend. It means simply that you can’t make the request in the main thread. So the quick and proper solution is to extend AsyncTask for it: public class FooJob extends...

  • New Setup Essentials

    When I switch to a new computer, I always struggle to find which applications to install immediately to expedite the transition. So here’s a checklist that I have created for myself, as I’m currently going through this process and don’t want to have the same issue next time. I will...

  • Swift: Invoking Caller's Method with Protocols

    One line problem/solution: using Protocols when delegating calls to the caller class from a Factory. I have a Button Factory (ButtonFactory.swift) which gives the user an instance of UIButton in a simple grid view (GridView.swift), which will invoke a method on the main class that calls the factory. A quick...

  • iOS9: Sudden kCFStreamErrorDomainSSL Errors

    Suddenly after upgrading my OS to El Capitan and downloading iOS 9 SDK for Xcode I began to experience the following errors when trying to reach Facebook Graph API: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) Error:Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server...

  • Simulating Network Status

    To test application features that require a network connection such as Game Center, Store Kit or simple HTTP requests you need to be able to simulate various real-life conditions as well. You would want to see how your application behaves if the user doesn’t have or has an unstable internet...

  • Serving Node.js on Apache

    Ghost runs with Node.js but I can’t dedicate my port 80 to it completely. I run Apache to serve a number of other HTTP requests as well, so the best solution is to run Node.js on a different port and forward HTTP 80 from Apache to it. A simple directive...

  • Amazon EC2 Micro – MySQL Crashes Sporadically

    All of a sudden I had started receiving DOWN alerts from Pingdom in the middle of the night almost every week. Each time I checked the source of the issue I’ve seen that MySQL server was crashing or stopping somehow causing the Pingdom alerts. I ignored it for the first...

  • SMTP Relaying Outgoing Mail in Postfix - using Webmin

    Configuring your Email Server for incoming/outgoing mails is not a big deal but it causes some serious issues on the other hand. Some popular email services will flag your mails as spam (only if you’re lucky - they might completely block them too) as they are not familiar with your...

  • Send Email – Authentication Error using Net::SMTP::SSL

    I have been creating a simple monitoring tool for my server at home using Perl and during that process I have come up with an error occured while I was trying to send email using Secure SMTP via Google Mail although all the account information was correct and the code...