Posts by Simon Hampel

WordPress Auth Driver for Laravel

laravel-wordpress
The WordPress Auth Driver for Laravel Composer package allows you to authenticate users in your Laravel application against an existing user table from a WordPress installation. The package exposes two Laravel service providers: WordPressAuthServiceProvider extends the auth driver with a new “wordpress” user provider. WordPressHashServiceProvider provides a new service “wordpress-hash” which hashes values using the same library that WordPress uses. …

Read More »

How to run composer commands on DeployHQ

deploy
DeployHQ is a great service for automating the deployment of code from source code repositories onto SSH, SFTP or cloud servers. When deploying applications which use Composer for dependency management, you often want to run Composer commands after deployment to install or update those dependencies. Fortunately, Deploy makes it easy to run SSH commands before and/or after deployment. For example, …

Read More »

Linode PHP Library Composer Package

Linode
I use Linode to host my VPS’s that run my websites and various other services online. I also use their DNS manager to host DNS services for the hundreds of domain names I own or manage for my clients. Many of my domains are duplicates from different Top Level Domains (TLDs), for example, I own hampelgroup.com, hampelgroup.net, hampelgroup.com.au, hampelgroup.net.au, etc. …

Read More »

Exporting PNG files with Alpha transparency from Xara Photo & Graphic Designer 9

Xara Photo & Graphics Designer 9
I’ve been a long time user of Xara products for creating graphics for my websites and recently upgraded to Xara Photo & Graphic Designer v9 (PGD). For many of my sites, I create a single large sprite image and use CSS positioning to show the various navigation related images on the site. This speeds up browser loading, since the browser …

Read More »

Twitter PHP Library Composer Package

Twitter
My second Composer package is now available on Packagist. Bitbucket: Hampel Twitter Packagist: hampel/twitter This library is a PHP wrapper for the Twitter API and uses the Guzzle HTTP Client library rather than calling cURL directly. I do quite a lot of work integrating with online services via their APIs and so have used cURL quite extensively. I found myself …

Read More »

JSON PHP Library Composer Package

JSON
I’ve started working with Laravel 4 and am really enjoying the power of this PHP framework. Now that Laravel uses Composer packages, managing libraries and dependencies has become very simple – it solves so many of the problems I’ve struggled with in recent years when managing the components and libraries for the applications I build. I have built a few libraries …

Read More »

How to hide custom post types from the “link to existing content” list in WordPress

Wordpress
When developing a custom WordPress theme for a client we came across an annoying quirk in the WordPress editor user interface. I had added a custom post type to their theme to allow the client to create a database of service providers. However, once their database was populated, we discovered that the “link to existing content” list in the “Insert/edit …

Read More »

To _blank or not to _blank

html5
Browsing through old posts on my personal blog, I came across an entry about using target="_blank" in href tags in HTML to make links open in a new window when clicked. I had convinced myself that _blank was evil and swore never again would I force the user’s browser to open a new window when clicking a link. However, nearly …

Read More »

Error Code 19 from CD/DVD drive in Windows

lenovo-dvd
My sister-in-law was having some difficulty with her laptop where it was not recognising the DVD drive. She even purchased an external DVD drive on the assumption that the internal drive was broken, however, she also found that it did not worth either. She eventually gave up and asked me to have a look at it. My first approach (after making …

Read More »

Variable scope in WordPress template parts

Wordpress
I was building a custom WordPress theme for a client site when I came across a frustrating problem with variable scope. I was modularising the theme using template parts, which get loaded using the get_template_part function. This particular template was displaying a list of posts of a custom post_type from a call to the get_posts function and I wanted to be able …

Read More »

 »