PHP Type Comparison Table

Someone wrote up a great table to show comparison of php types and their results


Rest vs. RPC

Phil Sturgeon wrote up a great article in smashing magazine about knowing the difference between a RESTful web service and an RPC api… I’ve been mixing up names apparently.


Google Maps Shows Gas Prices

Playing around with google maps, i Just found out that some gas stations (Wawa especially) now have gas prices overlaid on them


Angular 2 Child Routing

Angular 2 is my new favorite toy.  But it was a bit challenging figuring out child routing…  This is where you have a secondary navigation within a component so that the component can have it’s own navigation within itself (changing  a part of the screen, not the whole app).

To accomplish this, you need to add a second router-outlet within your child component.

Say we have the following route: /contacts/:group where group is ‘friends’ or ‘enemies’ – we want to show a list of those friends. Now, we want a route /contacts/:group/:friend – where friend, is the id of the friend loaded into a component, we need to setup Child Routes like so:

{ path: 'contact/:group', component: ContactsListComponent, children: [
{path: '', component: EmptyContactComponent},
{path: ':id', component: ContactComponent}

Now, the next challenge, is accessing the parent :group from the child.. that can be done by injecting ActivatedRoute and accessing the parent params like so.


Angular 2 Routing Events – Use NavigationEnd instead of NavigationStart

When subscribing to router events, so that you can update data on URL change, the tutorials i found online showed something like this.. => event instanceof NavigationStart).subscribe(event => {
While this sometimes works, i found it causes a race condition where the code fires before the navigation has actually completed – causing weird bugs… To solve this, use the NavigationEnd event instead, this will ensure all the navigation is completed before relying on the data for your objects.

Toggle CSS Notation

Apparently, CSS has a toggle notation – who knew?  It allows child values to have different values than the parent…



NativeScript Has a Slack Group

I’ve been playing with NativeScript for a while now, and just recently found out there is an official Slack group!  If you want to join and chat with everyone, visit:

TypeScript: Class Property Typecasting Issues

TypeScript compiler freaks out if you define an Array<Object> for a generic object array and then try to call something.propety on said array objects.  You either need to either do Array<any> or define an interface and use that (which you really should do anyway) like Array<MyDefinedInterface>

TypeScript: Class Property Default Value

So, this is another stupid mistake, but maybe someone else can learn from it… When you typecast your class properties like

export class Something {
private foo: Array;

it’s not an array by default, it’s still null – I’m not sure why I thought it would be an array, I just overlooked my code and got errors…  you need to actually set it to [] to make it an array so it can be used as one.

Google Analytics Chrome Tools Debugger

I was playing with analytics for a client, and stumbled across this gem…  It may be old news to you, if you do a lot of analytics work, but it was a lifesaver for me.  You can completely debug and see all the analytics tracking info in chrome.


GitLab Master Plan

GitLab, the DIY Github, just got a ton of money in another round of financing.  With this, they released their master plan for a completely integrated platform/service.  It looks really intriguing and I look forward to following it.


JavaScript Pass By Reference Stupid Mistake

Ok, this one… this one I should have known better, but thankfully someone caught it in a code review and saved my butt.  I wrote an ng2 component, and set a public property to the value of a services public property – an array of objects for a list. The idea was that the template would auto-change when the array changed in an ngFor loop…  nothing strange yet.

The problem occurred when, in the service, I changed the array.  Not the value of the array, but the actual array – i did one of these “this.contacts = []” to zero out the array and rebuild it. Well, this is a huge mistake, because it breaks the original reference to the original array, i needed to splice the array like so “this.contacts.splice(0, this.contacts.length) – so the original array stays in tact, and all the references stay connected.

NativeScript Event Bubbling Still a Work In Progress

I came across an issue with NativeScript that I’m hoping is resolved in a future release.  Typically in Angular 2, you can do something like (click)=”foo($event)” which allows you to do an event.stopPropagation() or event.preventDefault() – well, this doesn’t happen with (tap) events in NS.  So, I have a DockLayout, with a child of an <Image (tap)=”doSomething()”> which is great, the problem is I also have a (tap) on the DockLayout so the whole row is selectable for another reason..  The effect is that when you click on an image, both events fire.