Mr. RossBot is back!
Alrighty, I updated the logic this weekend and have Mr. RossBot operating on the hairy elephant website (Mastodon). (It’s also posting on Threads, if you’re into that sort of thing.)
I also updated the image model to use Stability.ai’s swanky new SDXL model. I’m pretty impressed with the results.
New side project: ArtBot, a way to create images using Stable Diffusion
Thanks to Reddit, I recently stumbled upon a cool project called Stable Horde. It essentially lets you generate images using a distributed cluster of GPUs donated by community members.
I had been creating my own web interface to remotely interact with a Stable Diffusion instance running on my own machine. I decided to quickly repurpose the web app and connect to the Stable Horde API. The result?
ArtBot, a Stable Diffusion demonstration that allows you to generate images using the power of the Stable Horde. It is awesome!
Quickly bootstrapping a new Node.js project
A problem that often happens to me: I get the inspiration to whip up something in Node.js (for fun, for experimentation, for a side project, etc) but then I realize that I need to go through the process of actually setting things up before I can even start writing some code.
Usually, I have to dig through previous projects and copy over my eslint and prettier config files, read through some documentation and remember how to setup TypeScript again, install the correct dependencies for running tests. Before I know it, I’m bored and tired and no longer interested in doing whatever I was going to do.
I decided to experiment with some command line tools and created a Node.js script that can help me quickly bootstrap a new project with common configuration parameters that I use. It’s available on GitHub: Bootstrap Node Project.
The GIF above shows this tool in action. I’m able to get the scaffolding for a new project up and running within about 20 seconds! After running, the project structure looks like this (with associated npm start and test scripts, all ready to go). That is pretty awesome.
my-cool-project/ ├─ .husky/ ├─ node_modules/ ├─ src/ │ ├─ index.js (.ts) │ ├─ index.test.js (.ts) ├─ .eslintrc.json ├─ .gitignore ├─ .prettierrc ├─ package-lock.json ├─ package.json ├─ README.md ├─ tsconfig.json (optional)
Obviously, it’s highly opinionated and caters to configuration options that I personally like to use. But I figure it’s a great resource for anyone who wishes to roll their own utility to quickly bootstrap projects as well.
Fun with GPT-3
Earlier this evening, I was playing around with OpenAI’s GPT-3 language model for generating “human-like text.”
I gave it the following prompt:
Write a plot about a movie that involves rogue unicorns who want to
conquer Earth and the planet’s only hope is an Australian Cattle dog named Benson who sleeps a lot.
The response?
The unicorns, led by their king, Uni, have been planning their conquest of Earth for years. They have been observing the humans and have concluded that they are weak and vulnerable. The unicorns have developed a powerful magic that will allow them to take over the planet.
Benson, an Australian Cattle dog, is the only one who can stop them. Benson is a lazy dog who loves to sleep. He is content to spend his days lounging around and eating food. However, when the unicorns begin their attack, Benson is the only one who can stop them. He rallies the other dogs and leads them in a fight against the unicorns.
The unicorns are powerful, but they are no match for Benson and the other dogs. Benson is able to defeat Uni and the other unicorns, and the Earth is saved.
Summer blockbuster coming soon to a theater near you!
Creating an automated Twitter bot about gun violence
The school shooting in Uvalde last week was horrible. As a parent, I feel so powerless to protect my kids from something like that. Taking them to school the next day was extremely emotional.
It’s clear that we, as a country, are going to continue to do nothing about guns and gun violence. I channeled some of my emotion into building an automated bot for Twitter. I call it SABS – Stochastic Analysis for Ballistics Superfans (alternative title is “Second Amendment Bullshit”).
If you’re so technically inclined, you can download and run it yourself. Powered by Node and a fun little experiment into Twitter’s API.
It automatically replies to any congressional member who tweets.
Which of course includes unhinged Republicans.
Debugging problems as of late
I’ve been trying to fix a particularly tricky bug lately that only ever manifests itself in our production environments. So, I’m unable to reproduce it on my local machine. It’s been fun. Let me tell you…
I’ve been stuck somewhere between stage 4 and stage 6 for weeks now.
*AUTOGENERATED* DO NOT EDIT
I’ve been writing some particularly detailed comments in my code lately and stumbled upon an Reddit post asking about some of the best comments people have come across.
This particular method is absolutely genius.
Book Review: Deep Work by Cal Newport
The pandemic forced a change in the way many knowledge workers work. Many of us have shifted to working from home — some roles are permanent.
I’m fortunate to be in such a position, but it’s been both a blessing and difficult to adjust to.
Distractions are frequent. From regular Zoom meetings, Slack messages and various alert notifications, to email. I think a number of people (myself included) are over compensating in our communication styles.
For software engineers, this causes a lot of context switching. And that’s generally a bad thing.
Context switching can lower productivity, increase fatigue, and, ultimately, lead to developer burnout. Switching tasks requires energy and each switch depletes mental focus needed for high cognitive performance. Over an entire workday, too many context switches can leave developers feeling exhausted and drained.
The impact of context switching lingers even after switching tasks. Cognitive function declines when the mind remains fixated on previous tasks, a phenomenon known as attention residue.
I’ve recently felt myself feeling drained and less productive that usual. While browsing a thread on Hacker News, a comment on Hacker News suggested that someone should read Deep Work by Cal Newport for ideas on how to regain focus and minimize distractions. It was the first I’d heard of that book.
It was pretty enlightening and I was pretty hooked!
It has a number of self-help style steps (that are somewhat obvious, in hindsight) that you can take to improve your situation and increase productivity (e.g., carve out set times when no one can bother you, like early in the morning or late at night, keep consistent times, set reasonable expectations and have a plan, don’t wing it).
But it also had shared some interesting research on how our brains have been rewired to have shorter attention spans, thanks to all our fancy pants technology.
“Once your brain has become accustomed to on-demand distraction, Nass discovered, it’s hard to shake the addiction even when you want to concentrate. To put this more concretely: If every moment of potential boredom in your life—say, having to wait five minutes in line or sit alone in a restaurant until a friend arrives—is relieved with a quick glance at your smartphone, then your brain has likely been rewired to a point where, like the “mental wrecks” in Nass’s research, it’s not ready for deep work—even if you regularly schedule time to practice this concentration.”
Yeah… guilty.
Anyway, definitely want to put some of these ideas into practice. It was a quick read and had some concrete steps on how to improve attention and focus that I can start using immediately. Excited to try it!