Skip to main content

Ben Cromwell

Laravel Facades pollute the mindset of junior developers

Laravel Facades came in for some criticism a couple of years ago. https://www.reddit.com/r/PHP/comments/1zpm0y/laravel_lets_talk_about_facades/ http://paul-m-jones.com/archives/5952 https://www.brandonsavage.net/lets-talk-about-facades/ I’ve got a greenfield project at work using Lumen (Laravel Lite), which is what’s brought it back to my attention. Lumen, by default, switches off the Facades feature. However, a bunch of the documentation asks for you to uncomment the line $app->withFacades() to switch them back on. Sadly, it doesn’t state the alternative. It’s as though the intention as that you’ll end up using them and you don’t have a choice.

UX and security, so often traded off against each other. Can’t we have both?

In this day and age of frequent large scale data breaches and compromising of passwords, security is rightly being talked about more. Unfortunately, this is often at the expense of user experience. Can’t we have both? The simple answer is no, but the longer answer is a more complicated yes and no. As with most things it boils down to context. Context that’s specific to the requirements of the individual.

Password managers and data breaches

If the LinkedIn hack has told us anything, it’s some stuff that we already knew. You can’t really on even massive, well known sites to store passwords correctly, or to have been doing so since they started out. ## Get your family and friends setup We as techies have a responsibility to our less technical family members to get them up to speed on password managers. We’re all agreed that password managers are the way to go, right?

What everyone should know about credit files

There’s a lot of stuff I think everyone should know about how credit files work but not enough people do know. N.B. I’m from the UK, I only know about the UK. This post deals only with how it works in the UK. ## Credit Scores Your credit score is meaningless number, produced by an algorithm specific to the credit reference agency. ## Credit Reference Agency? There are three companies (CallCredit, Equifax and Experian) that do the job of collating financial information on UK citizens and they allow lenders, tenant reference services and so on to use it in order to assess the financial risk of lending to a person.

Custom HTTP routes in Zend Framework 1 MVC

Scenario: you’re stuck with Zend 1 (which will support PHP7 - great news for those of us with legacy apps!) and you’re building an API. You’ve got routes like /api/categories, and /api/products but you want to provide some nice, nested resource routes, such as /api/categories/42/products to get all products in a given category. This would be an alternative to /api/products?categoryId=42. I poked around at ZF1’s router and came up with the following.

Saving time and effort with an SSH config file

I can’t believe I’ve only recently discovered the benefits of having a config file sitting in ~/.ssh A couple of my Digital Ocean boxes have non-standard SSH ports and it’s a bit of an arse to type it out every time. Example ~/.ssh/config: Host projects HostName bencromwell.co.uk Port 424242 User bc42 So simple and yet, if you don’t know it exists, you don’t know to look around for it. After running $ ssh-copy-id projects you will be saving keystrokes forever more.

How to upgrade your Grunt-supported Ember app to 1.9

Ember 1.9 came out a few days ago, continuing along the path towards HTMLBars. It took me longer than the expected 5 minutes to upgrade HungryBun due to a couple of small issues regarding support for Handlebars 2 in the build tools. I had some problems with npm when trying to update the ember-template-compiler to the latest version. npm ERR! peerinvalid The package handlebars does not satisfy its siblings’ peerDependencies requirements!

Ello: the social network with investors and no revenue model

You may have heard of Ello. It’s a new social network with no users and no revenue model. OK, so it does have a fair amount of users and it continues to grow rapidly by invite. The curious thing about it, though, is their claims that: they’ll never have adverts they’ll never sell user data They have investors. They wouldn’t have investors if they didn’t have a plan to make money down the line once they’ve grown their user base.

REST URL schemes in Ember

In Ember, the default is for the name of your model corresponds to a REST route of the same name. So what happens when you’re using hyphens in the URL? You can’t name your model to match, but the solution is quite simple, although it did take me a lot of searching before finding it. App.Store = DS.Store.extend({ revision: 1, adapter: DS.RESTAdapter.extend({ namespace: 'api', pathForType: function (type) { return Ember.String.dasherize(type); } }) }); More info on connecting to an HTTP server in Ember is here.

CVs

Style over substance may be a common phrase but frequently CVs possess neither. Layout Inconsistencies make CVs difficult to scan read. Sure, it’s not going to be a work of art (unless you’re a designer of some sort, in which case it should be: show off your talents) but it should be set out neatly and consistently. Fluff Don’t over-generalize. If you’re applying for “Widget Developer” and you list “Widget development” under the responsibilities in your employment history, that doesn’t tell anyone anything.