Effective Use of Code Samples
Using code samples when learning new programming languages, frameworks and libraries is a great way that speeds up the learning process. I usually start with running a simple code sample and then proceed with more sophisticated ones. Each code sample I run I try to change a bit, and verify my understanding by comparing the […]
Simple AngularJS Animations
Using the AngularJS framework we can easily create new animations. We just need to add the ng-animate attribute to the HTML element we want to animate and make sure the CSS that applies on our web page includes the required styling for the animation we want to get. The www.nganimate.org website overviews the possibilities. The […]
PHPCloud is Shutting Down
PHPCloud is about to shut down its service. Zend chooses to focus on developing their professional tools and on their professional services and let the big players (e.g. Amazon, Google and Microsoft) do their work. I guess the question to be asked is why did they even start this initiative. Staying focused on what you […]
Cross-site HTTP requests
Cross-site HTTP requests are HTTP requests at URL addresses other than the domain of the resource making the request. The CORS specification allows the server side (that returns the resource we try to retrieve using the XHR object) to serve the resource to requests coming from resources that were served from other domains. According to the CORS specification the server side […]
The Numeral.js JavaScript Library PRO
The Numeral.js JavaScript library assists us with getting the required formats for the numbers our program uses. The following code sample shows how simple it is to use this library in order to manipulate the format of the numeric values we use in our code. <!DOCTYPE html> <html> <head> <title>numeral.js demo</title> <script src=”http://cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js”> </script> </head> […]
The Pixastic.js JavaScript Library PRO
The Pixastic JavaScript library allows us to perform various operations on images we use in our code. The following code sample shows how simple it is to use this JavaScript library in our code. <!DOCTYPE html> <html> <head> <title>pixastic.js demo</title> <script src=”pixastic.core.js”></script> <script src=”glow.js”></script> <script type=”text/javascript”> function changepix(img) { var newpix = Pixastic.process(img, “glow”, {amount:0.2}); newpix.onmouseout […]
Debugging in Slim Framework PRO
The Slim framework allows us to enable a debugging mode. Once doing it, each time an exception is thrown the Slim framework will generate a detailed debugging message. The following code sample shows how to do it. <?php namespace Com\LifeMichael\Samples; require ‘Slim/Slim.php’; \Slim\Slim::registerAutoloader(); $application = new \Slim\Slim(array(‘debug’ => false)); $application->get( ‘/dbg’, function () { $temp […]
Logging Messages in Slim Framework PRO
The Slim Framework provides us with the Log object. Writing logging messages involves with calling various functions on that object. <?php namespace Com\LifeMichael\Samples; require ‘Slim/Slim.php’; \Slim\Slim::registerAutoloader(); $application = new \Slim\Slim(); $logger = $application->log; $logger->setEnabled(true); $logger->setLevel(\Slim\Log::DEBUG); $environment = \Slim\Environment::getInstance(); $application->get( ‘/simplelogs’, function () { GLOBAL $logger; $logger->info(“i m now starting the get handling function”); echo “<data>response</data>”; […]
Creating Filters in AngularJS PRO
The AngularJS allows us to create new filters and use them in our code for filtering data we hold in arrays. The following code sample shows how to create a simple filter. The sample includes three files. The following is the HTML file that includes a SCRIPT element for using the AngularJS library, a LINK […]
The Slim Framework PRO
Slim Framework is a tiny framework that assists us with the development of REStful web services in PHP. The growing popularity of web applications that include multiple clients implementations (hybrid and native applications for touch screen devices, hybrid and native applications for desktops and one page websites) require us to implement our server side as […]