Ruby is an awesome, dynamically typed language that has very strong OO features and excellent syntatic sugar. You can write very expressive software in few lines that looks good. It should sound like music to your ears if you’re coming from some kind of ugly templated behemoth. After all, Ruby’s motto is “a programmer’s best friend” – and it is – but only if you don’t suck.
I made a JSON LD builder thing
Without going into too much detail, a lot of how my employer makes money is related to their SEO rankings. Placing schema.org dichotomies in your page allows search engines to crawl and recognize data that you are presenting. For example, this credit card review on our site can now be understood by Google, so our search engine listings display as…
This is a quick little Hash-builder DSL that I made for creating schema.org types. Our code had far too many inline’d hashes that were cluttered with null-checks and conditional waterfall spaghetti; if
skemata doesn’t find a value it will just display
null for that key.
Let’s make a schema.org object for a book. It doesn’t have to be complete.
Obvious note that you would probably use some kind of repository record not in blog-post land.
require 'skemata' Skemata.draw :Book, OpenStruct.create(bookEdition: 1, name: 'Foo Book', pages: 42) do bookEdition name pages end
Not done yet
I decided to roll this into a library because other JSON-LD related libraries in Ruby lack one thing: ability to be explicit if desired. I love Ruby, but I hate that a lot of software packages try to mimic Rails’ “magic” for everything. That being said, I want to build some other features too:
- Validations (this is a tough one, because there are so many easy traps to fall into)
- Entity style mapping for types
I don’t know where I’m going with this, really, but maybe it’ll be cool. Or it can just remain an ordinary Hash builder. I’m OK with that too! :)
I’m installing Debian on my FW 800 MDD PowerMac G4, and I’m going to talk about it here so you too can convince yourself that your Friday night, is in fact, probably better.
My buddy Ari is giving me his PowerMac G4 MDD 1.25. I’ve always collected old Apple machines but this is going to be quite an experience for me. When I was younger, my parents bought me an iBook G4 1.42 14” to do schoolwork on, but see – it was a “New World” Mac that was never capable of running Mac OS 9. The only reason for this I suspect is some kind of assertion in Apple’s OpenFirmware flavor. Fun fact (if you didn’t already read the Wikipedia page): Sun is responsible for OF and was kind of a big deal back in the day. Never as big as our new EFI standards, but I digress.
To keep in spirit with New Years Resolutions, I decided to redo this page by finding a nice template and moving some stuff around. I am generally not one to click on adverts or even jump ship to new products, but the folks at Netlify seem to be doing something right. Previously, I had used GitHub Pages to host this; it did a great job, except I wanted one thing (even though, I serve static content, so the point is completely and utterly moot) – I wanted SSL. Netlify gave me free SSL via Let’s Encrypt, and furthermore, they made it easy. The set-up from start to finish was mostly cosmetic, I had to edit my
CNAME records with my DNS provider and then just click a big giant “enable cert” button in my new admin panel.
I decided that I wanted to run my PS4 through a proxy so I can see if the version assertion could possibly be ‘fixed’ by some network manipulation. I found a bunch of things out but was unsuccessful!