Internationalising date strings in Craft

When working with Craft CMS and translating strings, you might need to translate dates as well. After all, countries format these differently. For example, while the US often uses "month day year" we in Norway use "day month year". Other differences can be wether they use dashes, slashes or just completely different date formatting all together. In any case, dates need to be translated as well.

Continue reading “Internationalising date strings in Craft”

ACF lazy load Select options

Advanced Custom Fields is used a lot by WordPress developers, and it comes with a lot of handy fields. It's also very developer friendly, for example giving the ability to populate a select field through filters. But in some cases you may have a crazy amount of options/choices to populate it with. I recently had this happen on a project, there were about 10.000 options that were loaded from a JSON file.

Continue reading “ACF lazy load Select options”

Understanding the user of defaults

When I first started to develop WordPress sites, I came across an issue. I had never used WordPress like my customers did. Developers and users usually don’t see things the same way. Besides, most of them had their experiences from one of the default themes. I quickly understood that I needed to experience what they had experienced, and needed to understand their go-to solutions and their pains. At the time, twenty ten was the default one. It taught me a great deal, and helped me empathise with clients in a new way.

Continue reading “Understanding the user of defaults”

Tesla App for Mac

One of the great things about owning a Tesla is the fact that it in essence is a computer on wheels. With an API in place, this means that I can pull information from the car, just like the app does on your smartphone. It took me less than a day after taking delivery of my car before I had made my first scripts using the API, and now my OS X app project is starting to take shape.

Continue reading “Tesla App for Mac”

Adding a grid view to the WordPress admin users section

Grid view for Users section in WordPress admin panel

Recently the WP-admin has gotten more attention from core developers. The Media section recently got a grid design, and the plugins area also got a visual improvement. A thought that followed; why not do the same for the User section? This idea first came around for me while working on an internal project – as well as being inspired by Noel Tock’s presentation on Designing Web Applications.

Continue reading “Adding a grid view to the WordPress admin users section”

Seperate Varnish caching for HTTP and HTTPS

A high traffic site I host for a client needed to be available on both HTTP and HTTPS. This particular site, though, needed different caches depending on what scheme was used.

Note: Since Varnish doesn’t support HTTPS, it is in this case placed behind Nginx. Nginx then indicates any HTTPS requests passed onto by setting the X-Forwarded-Proto header.

With Varnish handling caching, this is what needed to be added to the configuration: