-
February 18th, 2008
Simulate Network Delays
When developing web applications it is helpful to be able to simulate a slow network. This can help you see how your UI indicators, ajax loaders, etc., will operate in various network situations, unlike your local network which is generally free of any sort of interference.
These little snippets of code will freeze the execution of your web application for three seconds:
// PHP sleep(3);
// .Net System.Threading.Thread.Sleep(3000);
-
Fluent: PHP Data Types as Fluent Objects
October 28th, 2007
Introducing Fluent, a set of PHP 5 classes that make writing code happier. Fluent enables you to deal with data types as objects in the fluent api style, like you can in most other modern programming languages.
// JavaScript "Hello There".toUpperCase().split(' ');// C# "Hello There".ToUpper().Split(new Char[] {' '});# Ruby "Hello There".upcase.split(' ')# Python "Hello There".upper().split()
// PHP explode(' ', strtoupper('Hello There')); // PHP using Fluent S('Hello There')->toupper()->explode(' ');