
Taking a look at MapLibre Tiles (MLT)
With the release of MapLibre GL JS v5.12.0, MapLibre Tiles (MLT) are now generally accessible to the normal user in a web browser!
This post gives a quick introduction to MapLibre Tiles and then peeks into their internal layout.
What Are MapLibre Tiles?
Until now, the standard vector tile format for MapLibre and Mapbox has been Mapbox Vector Tile (MVT). MapLibre introduced its own format at FOSS4G Europe this year.
The official English spec lives here.
Marshal.dump and load with ActiveRecord
If you aren’t familiar with Marshal.dump and Marshal.load, you probably should be. It’s used to serialize Ruby objects into binary data - mostly caching.
Now, if you’re trying to implement a Russian-doll caching system with objects, you probably have run into the issue of eager-loading associations using #includes not being cached.
my_data = Rails.cache.fetch('an_object') do
MyData.where(condition: 1).includes(:user).first
end
my_data.user
# On cache miss:
# => SELECT "my_datas".* FROM "my_datas" WHERE "condition" = 1 ORDER BY "id" ASC LIMIT 1
# => SELECT "users".* FROM "users" WHERE "id" = 1
# On cache hit:
# => SELECT "users".* FROM "users" WHERE "id" = 1
So, I wrote a quick module to make Marshal.dump and Marshal.load dump and load the association data, as well.
Moved!
Just writing to let you know that I’ve switched servers for this blog! I’ve been meaning to get this on to a faster server that I have control over for awhile, and I finally got around to doing it.
For those of you who are curious, this site is being served by WordPress Multisite, on a Sakura 2G VPS.
And because everyone likes talking about stacks:

Kidding.
That’s it! There is some moderate caching in most layers (WordPress Object Cache, APC, NGINX, etc), but nothing too drastic. It’s much faster now than it was on the previous server - we’ll see how this one holds up.
Making a (proper) WordPress Theme
One of the things that I’ve built regularly are custom WordPress themes for clients. Let me clarify – a custom theme for each client. One theme per client.
So, I decided to try my hand at making a “proper” WordPress theme – a theme for regular users. And I submitted it to the WordPress themes gallery. Successfully!
[caption id=“attachment_304” align=“aligncenter” width=“640”]
wp386 - my first public WordPress theme![/caption]
Facebook: Pop-in.
What do you do when you have a Facebook app tab (inside an iframe, mind you) that’s externally linkable? Pop-in.

Let’s break this down.
if (self === top) {
This conditional will be true when the browser is not inside an iframe.
window.location.href = 'https://www.facebook.com/test/app_1234';
If we are not inside an iframe, then redirect to the following URL.
S3 Uploader
There have been more than a few times where someone needs to send a big file to me. So, I made a quick and dirty tool to allow anyone to upload files directly to a S3 bucket.
No more shuffling links around, worrying about them expiring, and wondering whether the data stored is safe or not.

Fork away!
Amazon IAM Policies: Granting one user access to a S3 bucket
It may be easy to use the same master Access Key and Secret Access Key for all your apps using Amazon AWS, but it’s definitely not secure and recommended against.
That said, I had a little trouble writing the IAM policy granting a single user access to a single S3 bucket. I finally had time to sit down and figure it out today, and turns out - it’s pretty easy. Up to this point, I’m assuming that you’ve already created your user, but if you haven’t - the IAM management console is located here: https://console.aws.amazon.com/iam/home?#users.
Ruby/WordPress
Too long? tl;dr.
Situation: You’re migrating a big site to WordPress. You don’t want to make 1,000+ posts manually, do you?
Meet Ruby/WordPress. I’ve made a quick little Ruby gem that interfaces with your WordPress database, so you can manipulate it within Ruby. This opens up a whole world of possibilites - the most exciting being Nokogiri, of course.
Here’s a quick code sample that will create 100 new posts!
require 'wordpress'
# Configuration
wp = WordPress.new { host: '127.0.0.1',
port: 3306,
username: 'test',
password: 'test',
encoding: 'utf8',
database: 'wordpress',
wordpress_prefix: 'wp_' }
(1..100).each do |i|
post = wp.new_post { post_name: "post-#{i}",
post_status: 'publish',
post_title: "Post #{i}" }
post.post_content = "This is the content for post #{i}"
post.save!
end
Note that the configuration must point to a valid WordPress database (and make sure you don’t use one with valuable data… I don’t take responsibility for any lost data. You should be backing up anyways.)
LocationMatch and ProxyPass
Want to mix LocationMatch and ProxyPass? Not so fast.
<LocationMatch ^/(regex/here/.*)$>
ProxyPassMatch http://backend/$1
</LocationMatch>
Don’t forget to use ProxyPassReverse if you need it (it shouldn’t be inside the LocationMatch directive, though).
References: