Well it’s no wonder MSVC crashes with an extension named like that! “Ankh” that’s a heretical demonic name, The Lord will not bless users of such a product anymore than Jennifer Aniston will be caught dead at a Trekker convention.
# install composer and initialize the project composer global require laravel/installer laravel new myproject # install PHPStorm IDE helpers composer require barryvdh/laravel-ide-helper --dev # install laravelcollective HTML helpers composer require laravelcollective/html # configure your webserver and hosts file as needed (e.g. add a vhost entry and a fake domain name that points to it) # require UI components composer require laravel/ui --dev # install bootstrap php artisan ui bootstrap php artisan ui bootstrap --auth # if using authentication # generate the IDE helper classes for PHPStorm php artisan ide-helper:generate # install npm packages npm install # compile css and js assets (one-time) npm run dev]]>
DateTime and DateTimeZone classes, so in order to simplify that, I came up with the following:
$formatUTCDateTime = function($dts, $format = null, $tz = null) {
if($format === null)
$format = 'Y-m-d H:i:s T';
if($tz === null)
$tz = date_default_timezone_get();
$dtz = new DateTimeZone('UTC');
$dt = new DateTime($dts, $dtz);
$dt->setTimezone(new DateTimeZone($tz));
return $dt->format($format);
};
This method supports a default datetime format and will default the timezone to the currently configured timezone. This will be set dynamically according to the local time of the user (as set by date_default_timezone_set()) and will make the conversion process transparent.
const MY_CONSTANT = 1;
// get constant name by value
$class = new ReflectionClass('MyClassName');
$constants = array_flip($class->getConstants());
echo $constants[1];
// output is "MY_CONSTANT"
If you’re in an instance method and want to retrieve the constants of the current class, use get_class($this) here for the ReflectionClass constructor argument.
I’ve been experimenting with the CraftyJS JavaScript game framework lately, and I’m happy to announce my first complete game: Senet.
Senet is an ancient Egyptian game whose rules are the subject of some debate. A homebrew version for the Wii exists, but it’s somewhat incomplete and riddled with bugs. This version was born out of a desire to see the game finished and working 100% using the same set of rules.
And now, without further ado, I present: Senet 1.0.
References:
You can find the original YouTube posting here.
]]>I’ve finally committed to something I’ve wanted to do for a long time; write about what I love to do. And what I love to do is develop software.
To me, “coding”, “programming”, and “developing” are three entirely different approaches to what are fundamentally all the same task. The difference lies in the attitude of the individual towards specific aspects of a given software project with respect to it’s needs. Things like proper source control, a sound testing strategy, and the level of visibility into a system’s operation are all pieces of the larger puzzle that is a Software Development Life-Cycle.
To be fair, I have to admit that I’ve only ever tried writing about the things I’ve learned during my career before in terms of griping about it. It’s all too common to hear of developers who have lost their passion for their craft due to an adversarial relationship with their customers/project stakeholders. I was one of them for many years (still am sometimes), frustrated by the friction between IT and “the business” . A lot of them were hard lessons to learn, and if what I have to say makes anything any easier for someone else, then I’ve achieved my goal.
After being in the thick of it for so long, I feel that now is the time to perhaps “share the intellectual wealth”, as it were, but in a more positive, encouraging way. It is in this spirit that I set up this site as my contribution back to the community that helped me get where I am today.
]]>