RSSAmplifier

Blog

Wade Urry

Developer

iwader.co.ukRSS feed ↗40 posts

Latest posts

Running my first half marathon

Why am I here? Nearly three years ago we found out we were expecting our first child. I knew this would be a significant change to our lifestyle, which was predominantly wake up, sit at a desk, have breakfast, sit at a desk, lunch, desk, dinner, desk, sleep, repeat. At 125+kg I knew I wasn't able to provide for our new family as best I could. Determined to lose weight and change my lifestyle I…

Being a new manager

This post is a bit of a ramble I've been managing a team, officially, coming up to a year now. Overall it's been a positive and energising experience, but as with every journey there are an array of challenges and hurdles along the way. Transitioning from being a member of the team for 7 years to managing that same team has been an emotional and confidence testing challenge. Over those 7 years…

File streams with PHP

File streams allow you to interact with a data source without having to load the whole resource into memory. This avoids hitting memory limits when working with larger files. Let's look at a basic example of reading a file from disk // Open the file $resource = fopen ( '/path-to-my-file.txt' , 'r' ) ; // Read contents into a variable $contents = stream_get_contents ( $resource ) ; // Close the…

I don’t want tax cuts

If there’s money for tax cuts, then there was money available for public services. Our services are at breaking point. My county council declared that it is bankrupt for the 2023/2024 tax year. Many other councils have been doing this, more than ever before. Their first course of action was to make severe cuts to care homes and services for the elderly and disabled. The NHS is in a dire situation,…

Just give me an API key

I've been working on adding a now page to my site, which is largely automated pulling in data from Apple Health, Strava, and last.fm. Using the Strava api was incredibly frustrating as they force you to use OAuth. I appreciate we use OAuth to be able to authenticate multiple user's against a single application, limit access to data through scopes, and frequently rotate tokens to prevent replay…

My Review of 2023

2023 was by far the biggest change of my life so far. We had our first child, I lost a lot of weight, and made some big changes to my lifestyle. Weight Loss I started 2023 weighing at least 120kg, I don't know how heavy I actually was. I stopped weighing myself because I didn't want to see the number. After finding out we were expecting our first child this gave me a huge kick to get my butt into…

Laravel Queue Exiting with Status 137

We recently had a problem with our Laravel queue workers. We kept finding a particular queue job kept silently failing, not always, but often enough to cause us a significant headache. We weren't getting any of the usual logs or exceptions we'd expect with a potential timeout, memory issue, etc. We resorted to adding some debug logging in production, profiling our memory usage, etc. but nothing…

Christmas Stuffing Cake

My family have been making this stuffing cake for quite a few years now, and it's a firm favourite of mine throughout the Christmas period. We have it with our Christmas dinner, but it's also great cold either by itself or with onion chutney. Last year I made this for office bake day, and it went down a treat, so I thought I'd share the recipe here. There's no exact recipe for this, is more of a…

Query String Hell

We came across a bug at work related to query strings and how there’s basically no agreed way of handling complex structures, or anything beyond strings. I guess that's a given seeing as it's a query string . The x-www-form-urlencode spec doesn't really cover duplicate keys, but the spec does state that query strings should be parsed as a list. Even so, it appears every corner of the internet has…

How to Improve Performance When Querying Apple Health Samples in Shortcuts

My home page has a couple of sections which display my health and activity data. This is powered by a Shortcut that runs on my iPhone every day at 9am. I query data from Apple Health, and then trigger a deployment via GitHub actions. This was working well, until I started exercising a lot more during the summer months. The Shortcut was taking longer and longer to run, and before long started…

App Defaults

These are all the apps I use on a daily basis. Inspired by my colleague Robb and the Hemispheric Views podcast. 📨 Mail Client GMail 📮 Mail Server GMail Google Workspace 📝 Notes iCloud Notes Google Keep ✅ To-Do iCloud Reminders Google Keep 📷 iPhone Photo Shooting iOS Camera App 🟦 Photo Management iCloud Photos Google Photos (Backup) Amazon Photos (Backup) 📆 Calendar iCloud Calendar 📁 Cloud…

How to fix PHP/PCRE unrecognised compile-time option bit(s) warning

We started to see the following warnings after upgrading to PHP 8.0.13. Despite only being warnings they cause the regex to fail and your application will probably error. preg_match ( ) : Compilation failed: unrecognised compile-time option bit ( s ) at offset 0 preg_replace ( ) : Compilation failed: unrecognised compile-time option bit ( s ) at offset 0 PHP 8.1-rc5 and 8.0.13 includes a patch for…

Using Docker secrets with Laravel

Docker secrets are a convenient and secure way of managing sensitive information that your containers need access to. More can be read on them over on the docker documentation . You may be tempted to set your config as environment variables when building your container, as The Twelve-Factor App encourages, but this isn't secure when using docker containers because the variables are published along…

Laravel Unit & Dusk Tests on CircleCI

Recently put together a config for running unit and dusk tests for Laravel on CircleCI 2.0. Checkout the gist for nvm and composer scripts https://gist.github.com/iWader/6e2f81e6147676c3a7fd36a1c1e7ea3e version : 2 jobs : build : working_directory : /var/www environment : BASH_ENV : ~/.bashrc docker : - image : php : 7.1 - cli environment : APP_ENV=testing - image : circleci/mysql : 5.7…

Laravel Dusk pages with dynamic routes

Here's a quick demo to show how you can still use the Dusk pages with model specific routes. Let's say we have a CRM and you have a page that lets you view details of a single contact. The route might look something like http://my.crm/contacts/1 now you could manually navigate to that page, select some elements and then add some assertions. But that could quickly become tedious if you have a lot…

Testing an Eloquent model's events

I recently ran into an issue when attempting to test a trait that registered events on an Eloquent model. After I had done a little digging it turns out that events on the model are only fired when the event dispatcher is set. Of course the events dispatcher is part of a different package ( illuminate/events ) and isn't setup when working with individual illuminate components. To get around this…

Using HTTP/2 Server Push

Firstly, what is server push? HTTP/2 is a great advancement for the HTTP protocol, allowing multiple assets to be streamed over a single TCP connection. This reduces the need for "optimisation practices" such as domain sharding, image sprites, etc. There is one really cool feature of HTTP/2 however which can greatly speed up the render time of your website, and that is server push. Server push…

Signing your git commits with your Keybase key

Keybase provides a convenient way to verify identities by signing things. One great use for this is signing your git commits and releases. To do this there's several steps we need to take: import your Keybase key into your local GPG keyring, configure git to sign commits using the key and finally add our GPG key to GitHub Importing your Keybase keys to your GPG keyring The first thing we need to…

Using Vue 2.0 with Vue-Router's history mode

I recently started a new side project and decided to start using Vue 2.0 seeing as it had now reached RC stage. Some plugins however aren't quite at that point, and I found myself digging through a lot of source code to get things working. One of things I wanted to enable was the HTML5 pushstate, but the configuration options had changed and documentation had not yet been updated. Instead of the…

tymon/jwt-auth with Lumen 5.2

Recently I've been developing a Vue.js site using JSON Web Tokens (or JWT) for the authentication. Theres been a long standing library for Laravel, tymon/jwt-auth . It's never been greatly compatible with Lumen, never mind the shakeup with the auth system in 5.2. The author has however just released an alpha for version 1 which addresses the Lumen problem and thus far all seems good. There is no…

Renault Zoe ‐ 2,000 Miles and counting

Back in April 2015 I started looking for a new car, something to replace my ageing 2004 Purgeot 206, so it had to be small, cheap to run and most importantly cheap to insure. Most usual factors to me aren't important, I don't have any kids so practicality and space isn't a huge deal. I rarely do a huge shopping trip or travel long distances in the car, It's usually just me and my partner, in the…

Bootstrap 4 Pagination With Laravel

As of version 5.2.14 Laravel has supported pagination with Bootstrap 4 (Currently Alpha 2). Here's how to use it, or indeed any custom pagination class you may have set up. Firstly create a new service provider php artisan make:provider PaginationServiceProvider In the register method we'll pass a closure to Laravel's paginator class that creates and returns the presenter we wish to use. In this…

How Composer Version Constraints Work

When using composer you've probably seen the 3 main operators used within the version constraints, wildcard * , tilde ~ and caret ^ , each have their own uses and some which should be avoided if possible. Wildcard This is possibly the most commonly used constraint because it's universally known. It is however a common cause of composer being slow to resolve dependencies because it matches every…

Enabling Swap on Ubuntu

Digital Ocean's 512MB RAM instances are great for running a small website from, if you tighten up your configs you can actually get some pretty great performance from them, but sometimes that low amount of RAM can be an issue, particularly when you have a large amount of dependencies with npm and other such package managers. When your machine runs out of RAM, or OOMing (Out Of Memory-ing), it'll…

Laravel Eloquent Casts

Laravel's Eloquent is a very powerful ORM however quite often in Laravel 4 I found myself creating accessors which simply cast the value to a specific type, rather than, in most cases just being a string out of the database. class MyModel extends Eloquent { public function getYearsAttribute ( $value ) { return ( int ) $value ; } } This was fine when using strict comparisons, but it quickly becomes…

Enabling gzip compression on nginx

I've recently relaunched my site and as part of doing so spent quite a lot of time optimising the server and pages to make sure things load as quickly as possible, as Google has for some time been taking the page load speed into account when ranking results. Fortunately, the clever people at HTML5 Boilerplate have done much of the work for us. The nginx configuration can be found here . Firstly…

Free HTTPS/SSL certificates with Let's Encrypt

Back in October 2015 Let's Encrypt received cross-signatures from IdenTrust, which means their certificates are now trusted by all major browsers. They entered a closed beta period, and in December they extended their beta to the public, which means SSL certificates are completely free and automated, for everyone. Let's get started creating and installing a certificate. The process is so painless,…

2016 Resolutions and the year ahead

2015 has been another great year, having purchased my first new car, holiday to Zakynthos, several day trips to London, and I also became an uncle. 2016 is looking to be another bumper year already having plans for two holidays, one somewhere in Europe during the summer for sightseeing and traveling, and another package holiday later in the year just to relax. Reflecting back on my post from last…

Updating PATH environment variable (OSX and Unix systems)

The PATH environment variable is used to store locations where executable files are found so that when we run a command its actually mapped to the executable on your filesystem. (i.e: running vi will alias to /usr/bin/vi) You can find out the true path of an executable by using which (i.e: which vi will output /usr/bin/vi ) To extend our PATH variable we first need to edit our .bash_profile file…

2014, 2015 and beyond

2014 was a brilliant year, and it started off on good footing. January I decided to make my life healthier. Throughout the year I set about making healthier decisions about food, this stuck until about August, but I'm still under my original weight February I met the most amazing person, who nearly a year later still puts up with my nerdy-ness May I had lost 2 stone just from making healthier food…

Installing HHVM on OSX

Just a quick post on how to install HHVM on OSX Mavericks (Also works on Mountain Lion) brew tap homebrew/dupes brew tap homebrew/versions brew tap mcuadros/homebrew-hhvm brew install hhvm I use HHVM locally to speed up composer. A great way to do that is to create a bash alias for composer. To do this, add the following to your ~/.bash_profile file and run source ~/.bash_profile to reload your…

Postfix Implement SPF Record Checking

So I've been dealing with quite a bit of spam recently, the usual "You're due a tax rebate open XYZ.zip and fill out the form", etc. Following from my last blog post, Postfix Force SMTP Authentication , I noticed I never set up my mail server to check received mail against the senders SPF records, which I always take the time to set up on domains, so why had I not taken the time to make sure my…

Postfix Force SMTP Authentication

Recently I've been hit with some spam to my mailbox, the usual type "You've missed XYZ delivery please open the attached zip file", etc. so I set up some spam filters to reject the mail, however they didn't seem to take effect, after a week or so the amount of emails increased exponentially, up to around 50 emails a day. When I took a closer look at the mail and inspected the headers I noticed the…

Getting started with Grunt.js

What is Grunt? Grunt is a task-runner for your website's assets, but what does that mean? Simply put you can run a set of tasks on your website's assets, automagically, without the hassle of setting up a range of different pieces of software and programs. Grunt neatly pulls together a range of different 'plugins' to manage your assets with ease, ranging from simple css/js minifiers, less and…

If you don’t have a website, you don’t exist!

Recently I've been putting together a site in my spare time for my mothers new business. It's a small local business that's located in the town centre, though her shop isn't on the high street, but in a small section of shops not more than 2 minutes walk away, but due to the location there's very little visitors passing by, which is fine as she offers a service and doesn't rely on passing sales.…

How To Install Laravel 4... The Right Way

I see a lot of posts around of people struggling to get Laravel working, or installing it incorrectly using rewrites to mask the fact their Laravel installation is in fact in the document root, which is entirely wrong and insecure on many levels, although this is how many other frameworks such as Wordpress and CodeIgniter work, which I guess is why many people tend to have issues trying to do it…

Laravel and non-composer-ised libraries

Composer has changed the way PHP is used, distributed and shared. It provides a way to easily manage dependencies and keep them up-to-date through the main package provider, Packagist , where anyone can register their package free, for everyone to access, but this is still a relatively new concept for PHP, so what if the package you want to use isn't available through packagist? There are a few…

Education, Education, Education...

Education right now in the UK is being shaken up, quite drastically and these changes are coming from someone who has never taught in a school, Michael Gove, the Education Minister. As someone who's transitioning from education to work and experienced a bit of everything in between, I want to give my feedback and opinions on our education system. One of the Quiet Ones I was one of the quiet kids…

When upgrades go wrong

Today I collected some new goodies from @NovatechLtd Razer Taipan Mouse Razer Tiamat Analog Headset Asus Xonar D2X Soundcard Previously I had a Roccat Kova[+] costing around £65, it lasted nearly 2 years, which was excellent considering the amount of hours it had been used and it was still fully functioning, just the rubbery wax the mouse was covered in for grip was starting to peel off and make a…

The Elusive First Post

Hello World! Since being interested in technology and gaming, I've always wanted to write my own blog, but due to lack of ideas to write about and much of my time being eaten up with school and college, I never did. For the last couple of weeks I've been messing about with some new and old blogging software, as well as some CMS stuff, trying to pick out something that suits my needs. I tested out…