I really enjoyed the first episode of www.rooftopruby.com

On the theme of no magic, a colleague pointed out authentication-zero as an interesting alternative to devise for authentication. I’ve used and enjoyed clearance before, but am liking the simplicity of generated code.

Starting again

I’m starting a new rails project, and have been evaluating bullettrain.co to kick-start the project.

It looks really good, and has powerful generators and theming.

However, I’ve been bitten before by building an app using a 3rd party project (refinerycms anyone?) and limited by the dependencies, and lost in it’s magic.

As such, having built a lot with bullettrain in just one day, I’m jumping back to vanilla rails 7.0.4, with tailwindcss (another experiment for me).

PG Gem woes, not for the first time.

If you encounter errors installing pg gem on an Apple Silicon mac:

checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header

Then try the below commands firstly; to ensure the homebrew version of libpg is used:

echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
gem install pg -- --with-pg-config=`which pg_config`

and follow up with bundle install once successful.

This worked for me with the Postgres.app (postgres 14), and having previously installed libpq:

brew install libpq@14.6

I thought I’d posted about this before, but I’m currently looking at replacing my Linode instance with a VPS with these guys: ecowebhosting

It looks really compelling, and I don’t see any green mainstream alternative; any recommendations out there?

The Hunt for Red October

I watched Hunt for Red October last night on Netflix. I think I’d seen bits as a kid, but never watched the whole film.

Aside from some underwater shots with models, it was all very convincing and held up well. I had to lookup if any real subs were filmed on for external shots. No, but there was a 500ft fibreglass mockup made, which is pretty impressive, as it could be sunk below the surface.

An interesting account from one of the technical advisors is here: www.usni.org/magazines…

Product landing pages

If I read the cliche “By Developers, For Developers” on a product home page once more… 🤬

Who else is going to write software for devs?

“By Porcupines, For Developers” - very prickly to deal with. “By Dominos, For Developers” - a push over really. “By Web3 Bros, For Developers” - not with a barge pole.

I’m enjoying working on a thing in SwiftUI.

Screenshot of an iOS app in development. Locate your sailing area title above a text box, map with a reticule and save button.

Yesterday I stumbled across 80000hours.org and listened to one of the podcast episodes. Along with www.effectivealtruism.org, it really opens your mind for the possibilities your time and attention could make real.

podman-desktop.io looks very interesting.

Analytics to Storage, Amazon AWS does it all. It even a game engine at one point. But for all it’s prowess in commerce, AWS doesn’t seem to offer card payments or subscriptions as a service. I really do wonder why?

Running old software will always catch up with you eventually. It looks like some upgrades lie in my future: richsitblog.com/index.php… via mjtsai.com

The SailTies app looks really useful for longer sailing cruises. As a dinghy sailor, it’s not really for me, but I am looking for an alternative to Strava for recording races.

apps.apple.com/gb/app/sa…

Today I found out that the asdf plugin for python supports multiple versions of the language in concurrent use, for example 3.10 and 2.7 together.

in .tool-versions

python 3.10.5 2.7.18

🎙I love the Art of Product podcast, but this episode is particularly cool. overcast.fm/+SuyERj-H…

Python 3.10.4 (or before) has deprecated PyEval_CallMethod in favour of PyObject_CallMethod, which Boost 1.80.0 release does not seem to have picked up on.

sed -i '' 's/PyEval_CallMethod/PyObject_CallMethod/' boost_1_80_0/boost/python/call_method.hpp

Safer rails deployments

I’ve been using a small script to deploy the rails apps I maintain (both work and side projects) for a while now.

It’s helped cut the dud deployments due to two issues:

  • Leaving debugger statements on the code, where the debugging gems are not deployed to production.
  • Typos or cut text that leave invalid syntax, not caught during development as the codebase is loaded lazily.

I’ll expand the script at some point as I see other issues crippling my deployments.

#! /bin/sh
TARGET=${1:-production}
BRANCH=${2:-main}

test `ag byebug | grep "app\/.*\.rb" | wc -l` = 0
if (($? == 1)); then
  echo "Byebug command left in place:"
  echo `ag byebug | grep "app\/.*\.rb"`
  exit
fi

DEPLOY_CHECK=true bin/rails runner "puts %q{Loaded successfully.}" RAILS_ENV=production
if (($? == 1)); then
	echo "Syntax error, app could not execute."
	exit
fi

echo "deploying"
git pull origin $BRANCH && git push origin $BRANCH && bundle exec cap $TARGET deploy BRANCH=$BRANCH

Note, DEPLOY_CHECK is used to prevent eager loading in the development environment:

config/development.rb

Rails.application.configure do
    ...
    config.eager_load= ENV.fetch('DEPLOY_CHECK', false)
    ...
end

Another note, ag (https://github.com/ggreer/the_silver_searcher) is great.

Security changes in Psych gem

Upgrading the ruby instance for correctedtime.com uncovered this surprise; Psych (YAML library) won’t parse YAML specifying arbitrary ruby classes. As I use a YAML encoded column to store result data, the upgrade needed to specify allowed classes.

Specified in production.rb and it’s counterparts:

config.active_record.yaml_column_permitted_classes =  ['Symbol', 'Event::Row', 'Event::BoatRow']

It looks like the end of an era. Spinning up a free Heroku dyno to try a project will no longer be possible after 28th Nov. I wonder how many instances have been launched from a Github “deploy to heroku” button over the years?

It seems to me (having never used it), that Apple Stage Manager is the windowing UI they will be using in VR/AR when it drops.

Imagine this layout projected over your surroundings, rather than a desktop background.

Fantastic, Apple have announced WeatherKit, a replacement for the DarkSkies API they bought and scheduled for shutdown. CorrectedTime has been living on borrowed time in this respect.

WeatherKit

I’ve really enjoyed watching Sebastian’s videos on his experimental game development; so inspiring!

Wow. My first thought was “Is it climbable?”

Any reccomendations on tech for an iOS & Android app to automatically track location inside a geofenced area.

I’m thinking swiftUI & jetpack/compose; I only have swiftUI experience; at the mo. Other dev stacks need to support background location and orientation data.

I’ve just finished Quicksilver by Neal Stephenson for the second time. This time, I “read” the audiobook version. I love this series!: Quicksilver by Neal Stephenson 📚

Mastodon