David Lohmeyer's Blog

How to make custom Guzzle requests in Drupal 8 modules

If you're sending a request to a custom URL in Drupal 8, you might be tempted to implement a solution using cURL or another library. However, Drupal core comes with Guzzle, a "PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services." As with most things in Drupal, it's not obvious how to use something immediately, so here's a demo to show you how to take care of sending a request to an arbitrary URL inside a custom Drupal module. You might use this example class to display a status code on some page.

How to check a user role inside a custom module in Drupal 8

If you need to check for a specific role such as 'administrator' in Drupal 8, the process is changed from past versions. The following is an example of how you'd check for an administrator role when rendering the user edit form. You might do this if you were unsetting form variables based on role:

Drupal 8 Site Building Gotcha: System Blocks

For those starting to build on Drupal 8, some things can be in the same place as Drupal 7 while others can be "hidden". While the idea is to move things to more logical places, sometimes it's confusing to site builders since they have to learn the system anew in some regards.

Side Projects Keep Things Fresh

I've been having fun maintaining my side web design and development "business". It keeps things interesting outside of work since I love making cool things and helping smaller businesses with their online presence. I started hosting client sites earlier this year while I previously used shared plans for side projects and I think it's one of the better decisions I've made. The control of having a VPS that just works without messing with clunky shared plans is liberating.

Sorry, Web Design isn't Dead

I fell for the link bait title. A recent article on UXMag points out why the author thinks web design is dead in 2015.

Check out DigitalOcean for hosting

I've been using Hostmonster for probably 10 years to host my simple personal site and other random projects that come up.  Shared hosting is a convenient thing and is a great solution for people that want a normal website.

Stop Confusing Future Web Developers

Stop for a second.  Have you heard of tools like Jade (an HTML preprocessor) or Stylus (a CSS preprocessor)?

Can we use Flexbox safely yet?

The flex box model, aka Flexbox, will make designing layouts in CSS and HTML a lot easier once it hits mainstream.  How close is it to being widely supported?  It's actually not too bad, with global support at 88.88% as of 3/2/15.  The main issue is with versions of Internet Explorer earlier than 10.  Modern Chrome and Firefox, as well as mobile browsers almost all support Flexbox.  Since this is a new tool that will likely be employed in CSS frameworks of the future, it's useful to know how and why it will happen.  Here are a few good links.

Building a custom arcade (MAME) machine

Last August I took the plunge and decided to build my own custom MAME arcade cabinet.  See my build thread here. I wanted to use this as a learning experience in woodworking.  Here are a few things I learned building off of the plan posted at Arcadecab.com

Website Update

My personal site has been updated.  It's been a few years and it was definitely time to freshen things up.

One thing is notably missing: my old Team Fortress 2 levels.  I'll try to get a compilation blog post of those up shortly.

Related Posts