Friday’s here, and here’s a new playlist to get you through the rest of the afternoon.
Author: dm-admin
Lunchtime Lounger
Recently I have been experimenting with Spotify things for a future project and figured it was about time I made a Spotify spin-off of Friday Lunchtime Playlist. Lunchtime lounger will be an evolving playlist, regularly updated with tracks I find on my web wanderings. Who knows, it may even double my listenership.
Friday Lunchtime Playlist
So I know, it’s Wednesday – definitely a while yet until Friday – but hey it’s early, don’t complain. Lots of popular indie tracks off of the Soundcloud chart this week, I confess it was ripped off there without much messing about. Enjoy.
Happy Hump Day
Well it maybe Wednesday, but it doesn’t mean you have to be miserable. It’s time for some uplifting pop music from Public (the band). Public (the band) are from Cincinnati, as it happens, the same city that gave rise to Woxy – the greatest radio station to ever broadcast (but sadly is no more). Check the band out on twitter, or facebook, or indeed soundcloud.
Simple IP Access Control
I just wrote this very simple IP access control script, and thought I would share it as it’s handy to put in front of sites you are working on but don’t really want others to see. It’s really not very sophisticated, that is intentional, it’s just designed to hide a work in progress site with something like a splash screen but allows people to grant themselves access to see the site in progress (if they know the required url to grant themselves access).
Friday Lunchtime Playlist
I though it was about time I resurrected the Friday Lunchtime Playlist. This week list is comprised of largely pop tracks, Leona Lewis is on there as is Tori Kelly. My favourite this week is probably Mainland by Cape Lion. From the Swedish capital Stockholm, Carl-Johan Sevedag and Martin Wiklund make some clever sounds.
PHP Enforce Errors
When debugging code I always want to force PHP to display all the errors, including any warnings so I can make sure my code isn’t doing anything unexpected. Its something I do so often that I should know the two lines of code off the top of my head. If I really thought about it I probably do but sadly Google + Copy / Paste is actually quicker than typing it out. So as much for my own benefit as anyone elses, here are the two lines of code I use over and over:
error_reporting(E_ALL); ini_set('display_errors', '1');
AngularJS nested controllers
When you are new to Angular it can seem very confusing. One thing that gets especially perplexing is scope, where variables in your project can be accessed. This post looks at nested controllers and how that affects scope and we also look at whether they are passed by reference or by value between controllers.
We’ll use a very simplistic example:
Here we have defined the name variable in the parent and displayed it in both parent and nested controllers. What you will notice is any variable in the parent is automatically available to the child. However, be careful, if you are passing anything that isn’t an object then it is passed by value so if you try and change its value within the nested controller that change doesn’t propagate to the parent.
Now lets look at a different example, encapsulating that name variable into an object:
You will now notice that when you edit the name, both the nested controller and the parent controller are updated. This is because objects are always passed by reference, so in summary anything you want to persist between controllers should be encapsulated within an object first.