Categories
Development

Adding Bulma support to WordPress

I’m starting to get back into some late-night WordPress development. I also have a newfound love for Bulma, which is the closest thing I’ve seen to nailing an implementation “CSS building blocks”. It makes it really easy to build the layout of the site with minimal additional markup, and gets out of the way as soon as you want to start customizing.

The same can not be said about WordPress. Out of the box, WordPress theme development sort of sucks. There’s a ton of magic, and you have to override everything in super random places. But here’s how you can make them play nice.

First, you need to add a custom nav walker to your site. Add a file in inc or wherever you keep miscellaneous bits of PHP code with the following Gist.

https://gist.github.com/clausmith/10c8c9d3635edd891c0597e786e6af8b

Then, in functions.php, add this at the bottom:

/**
 * Custom nav walker with bulma support.
 */
require get_template_directory() . '/inc/nav-walker.php';

Lastly, replace the call to wp_nav_menu in your header.php or wherever you want your navbar to be with this:

wp_nav_menu(
	array(
		'theme_location' => 'menu-1',
		'menu_id'        => 'primary-menu',
		'menu_class'     => '',     // ignored
		'container'      => '',     // ignored
		'menu_class'     => '',     // ignored
		'items_wrap'     => '%3$s', // NOT ignored
		'walker'         => new Bulma_Nav_Menu()
	)
);

That should give you a nice, clean, Bulma-friendly navbar. Now back to hacking out all of this WordPress markup. While code might be poetry, WordPress is not.

Categories
Uncategorized

Install psycopg2 on macOS with Homebrew and pyenv

I’m not exactly sure what causes this, but some combination of Homebrew, pyenv, and macOS causes pip install psycopg2 to fail consistently. The error is usually something like:

ld: library not found for -lssl

It seems like most people can fix this by install Xcode and running xcode-select --install, but not I!

There’s a magic environment variable you can set that fixes it, but I always forget how to find it with Google so I’m posting it here for posterity.

export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"

Source: https://github.com/psycopg/psycopg2/issues/997

Categories
Favourite Things

San Francisco

Restaurants

  • 4505 Burgers & BBQ
  • Brenda’s Meat & Three
  • Robin
  • Regazza
  • Central
  • Flour + Water
  • Son’s Addition
  • Sanraku
  • Nara
  • Firefly
  • Delfina

Coffee

  • Ritual
  • Sightglass

Cocktails

  • Pacific Cocktail House
  • The Redwood Room
Categories
Favourite Things

Books

Fiction

  • The Cemetery of Forgotten Books series by Carlos Ruiz Zafon
  • The Southern Reach trilogy
  • Snow Crash
  • Cryptonomicon
  • Five People You Meet in Heaven
  • Station Eleven
  • Child of God
  • Seveneves
  • The Strain Trilogy

Non-fiction

  • Rework
  • Range
  • The Power of Habit
  • Ego is the Enemy
  • Bad Blood
  • Without Their Permission
Categories
Development

Movie Set Urbanism

https://www.strongtowns.org/journal/2020/2/6/movie-set-urbanism

I recently read this article talking about the rise of pseudo-main streets, or what the author calls “movie set urbanism”. These are typically suburban complexes that have been very intentionally designed to look like old-fashioned, authentic main streets like you might see in a movie or a small town. But once you step beyond the storefronts, you realize you’re actually just in the middle of a big parking lot – kind of like a movie set. It is quite literally a façade.

As outlined in the article, the problem is that these are not actually main streets. Most of the development is dedicated to parking, because these developments are constructed in areas where very few residents are within walking distance the way an actual main street would. What that means is most of the customers of these main streets have to get in their car and drive here anyway. Therefore, these malls share none of the convenience with an actual main street and are not sustainable.

In principle, I completely agree with everything in the article. But there’s one caveat: winter.

The original author has a Masters in Urban and Regional Planning from the University of Minnesota, so he should be able to empathize. It’s currently -23º C outside here in Ottawa, and in all likelihood it’s going to be below freezing for another couple of months.

Here’s my open question for anybody reading: in your opinion, what does sustainable development look like in a world where walking even moderate distances is impractical for a significant portion of the year?

Categories
About

Welcome

I like walking, as anyone who has ever vacationed with me can attest to. I particularly enjoy walking in cities. It really is the best way to get to know a city, looking and listening to learn its ins and outs. Walking a city lets you practice pensive observation, which is a skill I think more of us could use in this day and age. You learn to feel each neighbourhood, and you’ll often discover places you’d never find if you went out looking for them. Places you have to stumble upon.

I’ve travelled quite a bit for work even just in the few years since I left school, but it’s given me the opportunity to walk a lot of cities. And that means a lot of time to observe, think, and reflect. I think it’s about time I start to write some of these reflections down. More than anything, I hope writing will give me the opportunity to remember, edit, and clarify things I’ve been gnawing on in the back of my mind as I walk.

I’ve also been a guarded person. I typically keep my shields up, even to those close to me. If you’re someone who knows me personally, this might resonate with you. But the reality is, I’m a social creature like any other and I do crave connection. In part, I hope sharing what’s going on in my mind might help create those connections. Maybe it will be a good way to start to let people in, just a little bit. Much of what I plan to write about I have no substantial education in. What I have thought and what I will try to get across comes not necessarily from a place of learned experience but from empathy and logic. Trying to see the world from someone else’s shoes and connect to dots, so to speak.

I realize that I’m being unnecessarily aloof – the fact of the matter is I’m starting this blog to put on paper things that I’ve spent a fair bit of time thinking about, in the hopes that it might help me connect better with the people I care about and the people around me. With that in mind, here’s what you’ll find on this site:

  • My thoughts on cities, urbanization, and development
  • Notes about my favourite spots in some of the cities I know best
  • Observations, commentary, and fleeting thoughts that pass through my head that I don’t want to forget

Mostly I’ll be writing for myself, more out of practicality than anything since I don’t currently have anyone else to write for. But maybe the next time you’re looking for the best way to spend a Saturday morning in San Francisco, or you want to read what I think about urban mobility, you’ll think of this site and find something that helps you get to know me a little bit better.