PHP Null Coalesce Operator

In PHP7 the coalesce operator – ?? – will be introduced. It acts as a bit of syntactic sugar for the common case of needing to use a ternary in conjunction with isset(). The null coalesce operator returns its first operand if it exists and is not NULL; otherwise it returns its second operand. That …

What Will It Take to Run a 2-hour Marathon?

The current world record of 2:02:57, set by Kenyan Dennis Kimetto this year in Berlin, works out to 4:41.5 per mile; a sub-two would require less than 4:35 per mile. Will a human ever run that fast? Some fascinating number-crunching, and some great conclusions/predictions too. What Will It Take to Run a 2-hour Marathon? →

How to Use SVG Patterns

<svg> <defs> <pattern id="basicPattern" x="10" y="10" width="40" height="40" patternUnits="userSpaceOnUse"> <circle cx="20" cy="20" r="20” fill= "#64bee3" /> </pattern> </defs> <rect x="10" y="10" width="200" height="200" stroke= "#333333" stroke-width="2" fill="url(#basicPattern)" /> </svg> SVG patterns provide for very unique design opportunities. We are essentially defining a canvas within a target shape or text, which is then repeated (or tiled) …

Freelancer Productivity Quest: The Ultra-Schedule

Jessica Hische, freelancer, in search of the ultimate day-schedule: When I moved to San Francisco I was suddenly surrounded by people with “real jobs”, who didn’t have the flexibility I had (and who loved filling their weekends with fun non-work-related activities). I found myself, more and more, conforming to a normal office work schedule, running …

PHP Geotools

<?php $geotools = new \League\Geotools\Geotools(); $coordinate = new \League\Geotools\Coordinate\Coordinate(‘40.446195, -79.948862’); $converted = $geotools->convert($coordinate); // convert to decimal degrees without and with format string printf(“%s\n”, $converted->toDecimalMinutes()); // 40 26.7717N, -79 56.93172W printf(“%s\n”, $converted->toDM(‘%P%D°%N %p%d°%n’)); // 40°26.7717 -79°56.93172 // convert to degrees minutes seconds without and with format string printf(“%s\n”, $converted->toDegreesMinutesSeconds(‘%P%D:%M:%S, %p%d:%m:%s’)); // 40:26:46, -79:56:56 printf(“%s\n”, $converted->toDMS()); …

How quitting my corporate job for my startup dream f*cked my life up

Doing a startup was a long journey and I was putting myself under so much pressure by giving such a f*ck about what other people think. Day by day, I was getting lonelier and more depressive as I avoided social occasions. My startup progress was not as fast as my social circle imagined it to …

Change cPanel Document Root

Recently I needed to change the document root (viz. the public_html folder) of a specific account on a WHM/cPanel server. Here’s how (root access required): Edit /var/cpanel/userdata/USERNAME/DOMAIN.COM Change the line documentroot: /home/USERNAME/public_html to reflect your needs Rebuild the Apache config files by executing /scripts/rebuildhttpdconf Restart the Apache service using service httpd restart

Building a Device Lab

Collection of slidedecks to building your own device lab (only the first one in the series embedded, click through below to see all others): We cover how to build a device lab as a product for your coworkers to test their work on a spectrum of operating systems and versions. We also cover how to …