Pizza courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine This blog post looks at testing rails apps with FactoryBot and MiniTest – the default test framework which ships with Rails. It does not use RSpec and RSpec is NOT required for use with FactoryBot. Note : I believe that MiniTest is the name of the standard rails testing framework. Oddly I've had issues confirming that so if I'm…
As part of the yet to be announced Flow Analytics startup, I have to learn quite a bit more about building hardware. All of my learnings will be blogged for anyone who wants to follow along. Tonight's learning is simple: LEDs have a plus and a minus side. The plus side is denoted by a LONGER lead. Additionally: Resistors are non-polar (it doesn't matter what side you connect them on); I knew this…
I generate a lot of models without ActiveRecord backing. The reason for this is I try and follow a fairly functional style of Ruby coding where I use class methods. The reason I use models for this: I don't know what to call them other than a model The models directly is auto loaded so I can refresh it with reload! in Rails console My normal process for this: rails g foo Delete the migration…
I really, really like NuShell. The realization that maybe I had to leave was, I'll admit, mildly crushing . And then I just had the realization that maybe I don't have to leave NuShell and slink back to the dirty, byte infested corners of Bash and Zsh. Here's what just happened: /Users/sjohnson/Sync/coding/flow_analytics/open_source〉rails new pool_api --api Rails is not currently installed on this…
Pizza courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine As I've said, I build a lot of side projects and I really, really like the model of having: ALL MY APPS RUNNING CONCURRENTLY I may be a scattered, distracted developer trying to do too damn much but that's my damn right. And I have 64 gigs of RAM so why shouldn't I be this way. What I want is to be able to switch from app to app…
Pizza courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine As I've written, I'm acutely interested in using software written in Rust as my daily drivers. What I've seen so far is that programs written in Rust, based on an admittedly tiny sample, seem to be higher quality than programs not written in Rust. In this blog post, I'm going to talk about what I had to do to make NuShell be…
Welp, it looks like I'm starting a new company after all. Here are the values that I drafted for it. Values These things we believe: Ethics . We will behave ethically in all situations. Writing Things Down . We will work from home and be a distributed culture. And in a distributed culture, things have to be written down. Good writing is a skill for everyone not something reserved for writing.…
I'm now deep into my week of using the Zed editor , a new code editor written in Rust. In this blog post, I'll document how to change the default keystrokes. Commands This happens from the Zed menu, the Preferences command. There are two commands you need: Open Default Key Bindings Open Key Bindings What you want to do is: Zed menu => Preferences => Open Default Key Bindings. This gives you a…
I've liked the concept of NuShell since I first heard about it. I then liked it more when I discovered that Yehuda Katz was involved since I strongly believe in picking software based on the pedigree of the engineers involved (no I don't – yet – have engineer trading cards but I'm thinking about it). Although I have NuShell running on my experimental system, I've held off on using it on my main…
NOTE : I'm not telling you to do this. This blog post advocates bulk permission changing and that's risky but HomeBrew was entirely broken and brew doctor did not work. And this solution did. Use at your own risk. I have two primary machines – a Mac Desktop and a dual monitor Mac Laptop. I use the laptop more mostly from habit but I'd really like to use the desktop for something that makes me feel…
Pizza courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine Note : This has now appeared on Hacker News – thank you for the upvotes; I'm very flattered. I got some good information on Lapce from - maybe - the author and I've updated that. Change Log Updated: 2022-07-10 added Neovide, a description of each editor, github start count and more. Oh and this Change Log. Updated: 2022-07-09…
So I needed to register a .IO domain today. Amazon had .io domains at $71 per and Google had them at $60 . A quick check with my guru of cheapness , Nick Janetakis, said: NameSilo.com And he convinced me. Here are some tips: Do not accept any of their options. Just the domain, Sir, just the domain. Use DDOS protection from CloudFlare instead of their option. CloudFlare is free. Once you are…
The view of the shelling of Kharkiv at 4 am Donate Now to Pizza for Ukraine The following blog post is an excerpt from a series of articles I'm working on about JumpStart Pro. I found myself referring to the steps below that I thought it might be generally useful for people. I'm going to walk you through the "post purchase" experience with Jump Start Pro (JSP). This will guide you through creating…
The fire and rescue crews got a pizza lunch in Kharkiv courtesy of Pizza for Ukraine! Donate Now to Pizza for Ukraine Polyphasic sleep is a bizarre, almost consciousness altered state where your approach to sleep varies widely from the human norm: Biphasic sleep (or diphasic, bifurcated, or bimodal sleep) is the practice of sleeping during two periods over the course of 24 hours, while polyphasic…
Read On - Yes there's a reason this picture is here … A loving tribute to [Oxide and Friends](https://feeds.transistor.fm/oxide-and-friends); Here there be dark corners of podcast specific in jokes ... It is delightfully fun to actually learn something new. And it is even more fun to translate something from a different knowledge domain, say hardware , into a domain you understand, say software .…
I am not, alas, a compiled languages guy. I do find Rust absolutely fascinating because by inverting the common assumptions, a whole class of software errors are being avoided. Given that we live in a constant shite show of software quality, any engineering practices that generate better code are highly desirable . Discovering testing and pair programming for me was I suspect as life changing as…
I've been reading High Tech case studies now since the 80s – just after I entered the business. Bryan Cantrill from Oxide Computer's podcast inspired me to get all my books out and order them on a rough historical basis. I thought listing them here might be interesting to someone. All of these I've read and there are a ton of lessons for entrepreneurs here. I put rough notes next to some of them…
Yesterday I deployed a new thing via HatchBox and I was using the very, very latest – Rails 7.0.3. My deploy was textbook perfect and then I viewed it in Chrome and got that awful, awful message: Web application could not be started Insert loud cursing here I know the drill – it is a lower level error than HatchBox can handle (although I can think of at least a few ways HatchBox could handle it) –…
HatchBox continues to be my favorite tool for Rails deployment hands down. And this includes Dockarno – my own Bash based Docker deployment tool. When something you pay for replaces something you wrote yourself, that's a sign of its very, very strong goodness. I just used HatchBox to support SSL wildcard deployment for something I'm building and the process was a tad bit tricky so I thought I'd…
As is too often the case, I find that the initial aspect of getting a modern app (Bootstrap, Tailwind, React) initially setup to be the most frustrating aspect of Rails. Given that I like to spin up new apps pretty regularly, well, I spend a lot of time being frustrated with an old man's grumbling of: It didn't used to be this hard. No it wasn't this hard. And while I still don't really understand…
I had a bloody awful Sunday three days ago. I had started work on a new application that had Ruby 3.1 set in its Gemfile and I blithely installed Ruby 3.1 using RVM. And then my life began to suck slimy green toads with errors like this: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).…
Note : This is a work in progress. Rather than finish it in one go, I'm updating it live as a draft document as I learn new things about Twitter. Last update: 2022-06-15 I am, at heart, a long form blogger. Still – the cool kids, as they say – these days are all on twitter (and, yes, I know by saying it that way, I'm dating myself even further; so be it; it amuses me). I find myself, here in 2022,…
I've been dealing with a new application with a lot of objects and one of my concerns is idempotency. Idempotency is the idea that you can do the same thing over and over and only create a new object when Idempotence (UK: /ˌɪdɛmˈpoʊtəns/,[1] US: /ˈaɪdəm-/)[2] is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the…
So, last night, whilst pulling vampire hours on writing tests – always, always, always a bad idea – I encountered multiple variants on this bug: ❯ bundle exec rails test test/controllers/links_controller_test.rb:44 Running 7 tests in a single process (parallelization threshold is 50) Run options: --seed 21798 # Running: E Error: LinksControllerTest#test_should_get_edit:…
I'm working on a new project and, as I am front end challenged, I started by purchasing a copy of the BootRails framework as it seemed to have sensible defaults and an appearance that vastly outstrips my personal ability to manipulate Bootstrap. Previously I've worked with the JumpStart framework from Go Rails and while I love, love, love Chris Oliver, GoRails, HatchBox and everything Chris has…
I am not a front end engineer – but I'm on a project right now with heavy front end requirements. This blog post documents how I got Font Awesome running on by application including the brands extension. It is by no means a great way to do it and I know: I have more overhead than needed I did not take advantage of Rails 7 facilities in the best way This skips the gem so you lose another dependency…
I'm actively engaged in greenfield development once again and I'm learning / relearning things that I likely have known in the past. I don't know if this is a known issue, a bug or maybe a design choice. Either way, I found it useful to know this so I thought it was useful to document it. I spend a lot of time in rails console (thank you Jared for beating this into me a thousand, thousand years…
I find myself building a new application, Cartazzi, and since the "template app" I'm building from uses Rails Test not rspec, I'm back to the past using the native rails testing framework – something I probably last touched by in 2009. This blog post summarizes different Rails testing examples and is a work in progress as I come up with new examples. Thinks I Like About Rails Test It is fast Have…
The asset pipeline is the component of Rails that I, well, let me quote myself from a recent email: I've been tracking down that crazy image related issue for an age now and I think I just got it. Every single time it is always the damn asset pipeline (this is the one component in Rails that I have a literal deep and abiding hatred for; it is finicky code and instead of sticking with a solution…
In tonight's category of "Crazy Rails Errors that Even I haven't hit", I was deploying a new app via HatchBox and I hit this one: No such middleware to insert before: ActionDispatch::Static /home/deploy/Cartazzi/shared/bundle/ruby/3.1.0/gems/actionpack-7.0.2.2/lib/action_dispatch/middleware/stack.rb:174:in `assert_index' When I dug into the underlying failure there was this bit of code: def…
I've now been a solo entrepreneur longer than I've been anything. Being a solo entrepreneur is a very different experience and it isn't one that is taught – you generally learn only by doing. I've started this series of essays to talk about practical things I've learned over the years. The reason that I referred to it as keeping your sanity is that is what, all too often, solo entrepreneurship…
I recently migrated JobHound from its original hosting (DigitalOcean with a custom Docker based deployer) to a new environment (also DigitalOcean but now with deploys managed via HatchBox ). In the traditional spirit of all IT migrations where you both get something good and lose something good, I got: Better Performance Working SSL; I have no idea why it stopped on the old box but it did and…
I recently had the situation where an application that I deployed to Hatchbox failed with a Ruby version conflict: -----> Installing gems... /home/deploy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated Your Gemfile lists the gem capybara (>= 0) more than once. You should probably keep only one of…
So I was just stumbling through setting up a new project and getting it deployed when I hit this little gem: ❯ git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'github.com:fuzzygroup/cartazzi.git' I did the obligatory "scratch my chin and play with my beard" that you do when you are confused (and it is late and you are tired ). And then I…
So I just had this disconcerting moment of weirdness: ❯ rvm use 3.1.0 Using /Users/sjohnson/.rvm/gems/ruby-3.1.0 coding/rails/cartazzi via v18.2.0 via 💎 v3.1.0 on ☁️ (us-west-2) ❯ ruby -v ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin19] coding/rails/cartazzi via v18.2.0 via 💎 v3.1.0 on ☁️ (us-west-2) ❯ bundle exec rails c Your Ruby version is 2.6.3, but your Gemfile specified…
I've gotten quite a bit of feedback on my Bad Client story and the underlying theme has been "why the heck did you hang in so long?". There were a couple of reasons: I'm stubborn af. That was definitely a part of it. Learning Matters. Point 2, learning is what I want to focus on here. What I have always found, for myself, for computer related things is that my learning is dramatically better when…
It is now 2022 and Job Hound has existed for 4 years now having happily served over 1,000 users to help apply for over 5,000 different jobs. Job Hound has been one of those bits of code that you write and it just runs happily in the background just plain working without fail . Other than a few restarts to the Docker containers to reclaim storage, I literally haven't touched it since I wrote it…
The quality of your recorded audio for an at home podcaster is a black art. Audio is a fundamentally analog process and Once upon a time, in the antediluvian ages of podcasting (2005 / 2006), I was a podcaster. And then, a decade later, my friend Nick Janetakis, a producer of online courses also taught me a bunch of things about audio quality. Here's one thing to know: You will tell yourself that…
Every so often I run into a tool which just impresses me. This time it is Miller . And when I find such a tool, I write up a blog post to firm up my learnings. Here is the official description: Miller is a command-line tool for querying, shaping, and reformatting data files in various formats including CSV, TSV, JSON, and JSON Lines. The people that know me know that I've spent literal man years…
This is more than a mildly embarrassing post to have to write but it is an interesting example of how habits can bite you hard – so, so hard. I recently wanted to start on an application and actually be current on everything: Rails, Bootstrap, etc. I have long admitted to having issues with respect to "modern" web development (specifically JavaScript / the asset pipeline) and I'm mildly starting…
Perhaps it is me but I've found that homebrew seems to give more errors and take longer than it used it. I just got hit with this error: /usr/local/opt/postgresql/bin/postgres -v dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.69.dylib Referenced from: /usr/local/opt/postgresql/bin/postgres Reason: image not found Digging into the OSX postgres log here: tail -n 100…
In my last blog post, I dug into Elm and while I like a number of things conceptually about Elm, the process of implementing nothing more than a maybe 8 element HTML form left me hugely frustrated and annoyed. I also didn't like the way that Elm bundles code and display into one thing. I may be a traditionalist perhaps but the separation of views and code really does work well in practice. I get…
Elm is an interesting new front end language technology based on a functional language that generates JavaScript transparently and has a focus on great documentation and ease of learning. A good starting point is the Guide . In this blog post, I'm going to walk through the initial steps. Along the way I'll draw some comparisons to things like Rails or Laravel. My goal in all this is…
I have now been doing consulting professionally since 1988 (first client was the EPA) and despite that, bad clients, are always problematic. That's longer than my adult child has been alive, longer than I've ever been married, etc. I'd like to think I'm excellent at consulting but no one, no matter how experienced, can fail to make mistakes. This is a tale of when a consulting project goes wrong…
This is simple but I keep needing to look it up. First check your elixir version: elixir -v Second confirm that you actually installed Elixir using brew: brew list | grep elixir Third do the upgrade: brew upgrade elixir Note : You are probably going to find more than just elixir itself is upgraded. Theoretically you should be able to look at just the upgrade tree with: brew deps --tree…
I recently had the situation where a Bootstrap application: Worked perfectly on a desktop with a side by side layout Properly wrapped on desktop when the window was resized down to a mobile like form factor Failed to ever wrap on mobile showing just a smaller version of the desktop I puzzled over this quite a bit until I ran a google search for "bootstrap text too small on mobile" which led me to…
I had the situation earlier where commands like: @extends('layouts.master') @section('title', 'Order Submitter LegendBorne Products') @section('content') in my template weren't being processed and this led me to do the normal bit of Google fu, alas, to no avail. And then I looked at the name of my template: order_submitter_index.php Yes – that's right. I was missing the .blade. suffix so a quick…
So I started fiddling about with a new Rails project and after finding a likely starting point, I immediately ended up with this: Webpacker can't find application.js in I'm old school Rails and I find the whole asset compilation situation, honestly, perplexing. The solution turned out to be: bundle exec rails webpacker:install after the normal: git clone foo bundle install bundle exec rake…
This blog post tackles the odd topic of taking a Laravel application and converting it to a Shopify app. Overview Shopify is an ecommerce platform for building hosted shopping sites. With Shopify your whole ecommerce experience exists on a shopify url (whether the domain is .shopify.com or not; Shopify is serving everything and the underlying source of data is Shopify itself). Laravel is an MVC…