Software

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.…

Keep reading

Swift: Invoking Caller's Method with Protocols

One line problem/solution: using [Protocols](swift protocol optional) 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 & simple solution to this would be like: - ButtonFactory.swift protocol ButtonDelegate { func buttonPressed(button:UIButton) } class ButtonFactory { var delegate:ButtonDelegate! func create(...) -> UIButton { let button = CustomButton() button.addTarget(self, action:…

Keep reading

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 cannot be made." ... _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamPropertySSLClientCertificateState=0, _kCFStreamErrorDomainKey=3, kCFStreamPropertySSLPeerCertificates=<CFArray 0x7c66c1f0 [0xf72098]>{type = immutable, count = 2, values = ( 0 : <cert(0x7ae10150) s: *.facebook.com i: DigiCert High Assurance CA-3> 1…

Keep reading

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 connection, or connection suddenly drops during an operation. Xcode iOS Simulator doesn't provide you such features by default but you can download Hardware IO Tools for Xcode simply by choosing: Xcode → Open Developer Tool → More Developer Tools And then login…

Keep reading

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 modification will be sufficient. Open your sites configuration file and insert the following proxy directives: DocumentRoot /home/www/ ServerName koray.me ServerAlias koray.me ... ProxyRequests off Order deny,allow Allow from all ProxyPass http://localhost:3000/ ProxyPassReverse http:…

Keep reading