Anne Richardson
  • about
  • tech blog
  • portfolio
  • resources
  • resume

tech blog

  • How to Build a Sinatra App - Part 3 Deploying to Heroku

    December 10, 2024

    See How to Build a Sinatra App Part 1 and Part 2 if you need help building a Sinatra App from scratch. I already have...


  • How to Build a Sinatra App - Part 2 Rendering Views

    October 27, 2024

    If you don’t have your basic Sinatra app set up yet, see my previous post. Otherwise, let’s get ready to dig in and build this...


  • How to Build a Basic Sinatra App - Part 1 Basic Setup

    October 27, 2024

    I’ve been a Rails developer for a while now so I recently built an app in Sinatra for fun. To help me with this project,...


  • Exploring decorators with the Draper gem

    April 1, 2024

    Over the weekend, I implemented a decorator in a personal app using the draper gem. App Context I have an app that tracks logging of...


  • Calculating the difference in timestamps with PostgreSQL

    March 8, 2024

    I recently needed to do a little analytic research for our UX team. We wanted to know how long it usually took between the time...


  • Case Statements in PostgreSQL

    February 20, 2024

    If you’ve ever had a database table that uses enums (just an integer) or some kind of mysterious code to signify meaning, then you’ve probably...


  • CSS display grid put the magic 🪄 back into my layout

    January 3, 2023

    Back in 2018 I wrote this post about a refactor on my tarot-card-reading app that allowed me to scale the quantity of readings and quantity...


  • TIL CSS's only-child pseudo class can easily show/hide content without additional conditional logic

    October 20, 2022

    I’ve been messing around in Rails 7’s Hotwire features with this tutorial and today I learned something pretty neato about CSS. Instead of building out...


  • TIL multiple values in a ruby case statement 'when' block

    September 28, 2021

    Today I learned that you can include multiple options in a Ruby case statement. I have a helper method that I use to determine which...


  • My tech skills (and life skills) are a weird and beautiful patchwork and so are yours

    July 31, 2021

    I’ve been thinking and talking about tech-induced imposter syndrome lately. While my own experience with imposter syndrome has changed over time, I keep trying to...


  • Python for Data Science Resources

    January 22, 2021

    Courses & Tutorials Twilio’s Quest: https://www.twilio.com/quest highly recommended for beginners: https://www.udemy.com/course/the-modern-python3-bootcamp/ from the point of view of stuff you already know in SQL: https://mode.com/python-tutorial/ for data science: https://www.udemy.com/course/python-for-data-science-and-machine-learning-bootcamp/...


  • Using FactoryBot for hashes

    October 28, 2020

    Sometimes in your test suite you have some big ol’ hashes that you need to build frequently. Having big ol’ hashes being passed all around...


  • Mass-assign empty strings in FactoryBot

    October 2, 2020

    I recently had to write some RSpec specs for an importer job that pulled in claims data to a table that had 600 columns. That...


  • Accessing the link_to helper in a Rails controller and adding a link to a flash message

    September 14, 2020

    In my food planning app, after clicking a link to add all recipe ingredients to a shopping list, I display a flash message that looks...


  • Nested Layouts in Rails

    August 22, 2020

    Nested layouts in rails are pretty neato. You can get a lot of styles and consistency across your site without writing a whole lot of...


  • Putting Some Plain Old Vanilla Javascript in Rails 6

    August 22, 2020

    I’ve built a few projects in Rails 6 that don’t have a front end framework and aren’t using webpack. In these projects, I’ve wanted to...


  • Code Review Tips for Beginners

    July 1, 2020

    The first time I needed to do a code review, I felt nervous and I was sure that I had nothing to offer. Compared to...


  • Store images with Rails ActiveStorage and Dropbox

    May 31, 2020

    I recently implemented cloud image hosting using Rails ActiveStorage and Dropbox. These are the resources that helped me to do it: Pragmatic Studio’s Using ActiveStorage...


  • Render Images from a Dropbox Folder

    May 30, 2020

    I take this approach when I am spinning up a Rails app quickly and want to get a quick first draft out the door. It’s...


  • Create a Custom Rails Generator

    May 12, 2020

    For this example, I’m creating a generator that builds a file for Rails data migrations. It will behave very much like a Rails schema migration...


  • Migrate Data More Safely in Rails by Raising an Exception

    April 27, 2020

    A data migration can fail but still end up in an “up” state. This is a problem because you’ll probably try to roll back that...


  • How to Use Rails' alias_attribute

    April 16, 2020

    What it’s For… Renaming an attribute. Ever have an attribute on your Rails model that you wish you had named something else? And actually renaming...


  • Ruby seed output wrapper

    March 25, 2020

    The Rails-Provided Method Rails has a handy method that outputs a count and the time it took for a block to run. It’s a nice...


  • A good use of Rails Model Callbacks

    March 15, 2020

    What it’s For… Processing some input on the same model. Let’s say we have a User model with a full_name field. Since this is user-entered...


  • Refactor from a hardcoded button to a dropdown form in Rails 6

    February 29, 2020

    The Problem I have a food planning app where I make a list of recipes that we will prepare for the week. Each week has...


  • The Rails migration 'change' method is more magic than I thought

    January 29, 2020

    Here’s a big fat TIL. The Rails change method can add a column back, including it’s original data type, if you tell it to. I...


  • Write a script to run all CI checks locally

    December 30, 2019

    I love having my CI service keep me in line by running a bunch of checks when I push a commit to my GitHub repo....


  • Query by Multiple Fields at Once in Rails

    December 18, 2019

    The Problem I recently ran into a problem where I wanted to search by a couple of different fields in my postgres database at the...


  • Unzip 7z Files on a Mac with p7zip

    November 14, 2019

    This post is brought to you by 30 minutes of frustration. I hope it saves you some time. 7z is a is not a native...


  • Looking Back Down the Mountain: Growth from a set of Garageband files to Rails 6 & JS

    September 17, 2019

    I recently wrote a post about why reflecting on growth is important. So that’s what this post is about. Back in roughly 2013, I had...


  • Looking Back Down the Mountain: Why it's Important to Appreciate the Work it Took to Get You Here

    September 16, 2019

    Doing a career change into tech is hard work. There is an endless queue of things to learn and a perpetually moving target of knowing...


  • Script to search for files and folders from the command line

    August 25, 2019

    Have you ever renamed a resource in a Rails project but missed a filename or folder name somewhere? Yeah, guilty. Wouldn’t it be handy to...


  • Get out of a loop in pry

    August 5, 2019

    Ever been caught in a loop while binding.prying through a spec in RSpec? I have to admit I put myself in that situation far too...


  • Understanding the Observer Pattern

    July 2, 2019

    The Observer Pattern is a convenient way to update several objects when one object changes state. For example, let’s say we have a website that...


  • Easily add co-authors to your git commits with this script

    July 1, 2019

    I recently learned about git’s Co-authored-by feature which allows you to add collaborators to your commits. I do a lot of pairing at work and...


  • Fetch open source contributor branches easily with this Ruby script

    June 28, 2019

    I’ve recently gotten a bunch of pull requests to one of my projects on GitHub. I wanted to review the work and run tests on...


  • Autopopulating Rails Form Data with Vanilla Javascript

    April 7, 2019

    The context for this work is an exercise tracking app. There is an Exercise model that has information about an exercise (ex: push-ups), including default...


  • Convenience Methods in Rails are so... Convenient

    March 22, 2019

    Several months ago in a code review, someone suggested to me that I wrap a model constant in a convenience method. I thought, “hmmm okay....


  • How to Get Hex Codes from Any Part of Your Mac Screen

    January 30, 2019

    Need to get some HEX codes for an image you have locally on your computer? As it turns out, if you have OS X 10.10...


  • Move Code Up/Down a Line in VS Code

    January 28, 2019

    I’ve been using Atom for a while, but I figured I’d give Visual Studio Code a shot. For the past few weeks, I’ve used it...


  • Favorite Code Courses & Learning Resources

    January 27, 2019

    Originally Posted: 01-27-2019 | Updated: 08-02-2023 I moved this content into a proper page for easy reference. See Resources.


  • Grateful Garment StockAid Project Setup

    November 4, 2018

    What is StockAid? StockAid is an inventory management system built in Ruby on Rails for The Grateful Garment Project which provides clothing and toiletries for...


  • How to Toggle the Visibility of Whitespaces in Atom

    October 10, 2018

    I recently started working in html.slim, which is whitespace sensitive. In order to edit my slim files successfully, I wanted to be able to see...


  • How to Enable the Trimming of Whitespaces by Language in Atom

    October 9, 2018

    I have the whitespaces package installed in Atom, which I love because it trims unnecessary trailing whitespaces from the ends of each line. This is...


  • Set up a Shell Script on Mac for Postgres Backups

    October 1, 2018

    I was recently setting up a new computer and I needed to back up and restore several PostgreSQL databases in the process. It occurred to...


  • How to Globally Disable ri and rdoc During Gem Installs

    September 13, 2018

    Every time I install Rails, I kick myself for forgetting to add the --no-ri and --no-rdoc flags like this: gem install rails -v 5.2.0 --no-ri...


  • How RuboCop Led me to Implement the Null Object Pattern

    August 24, 2018

    Last week, in an effort to level-up my knowledge of Ruby style conventions, I connected Code Climate and installed the RuboCop gem in a few...


  • Refactor: Solving a Pesky Naming Problem

    August 11, 2018

    Back in February, I wrote a post about a refactor to this app that made use of a factory-style class for some nifty data construction....


  • How to Get Ruby Data into a Javascript File in Rails

    August 4, 2018

    The key here is to figure out where and when the Javascript is being called and then pass the Ruby data to it as an...


  • Legacy Refactor: Separation of Concerns in Sorry Girl Rails app

    August 2, 2018

    It’s handy to be applying for jobs because it gives me the excuse to go back to some of my Rails portfolio projects and refactor...


  • Personal Challenge: Action Cable Responses from both the DOM and the Console

    July 31, 2018

    Google’s Firebase is a database tool that (among many other things) pushes updated data to all instances of a browser. I think that is pretty...


  • How to Store API Keys and ENV Vars in a create-react-app Project

    May 22, 2018

    Conveniently, create-react-app has some built-in functionality to make storing and accessing your API keys and ENV variables easier. There’s no need to install any other...


  • My Favorite Refactor: A Look Back at Growth

    May 20, 2018

    When I first started learning programming, I made a command line app that does tarot readings. (You can play with that app here.) As a...


  • Implementing a Cities Autocomplete with the Google Places API in React

    May 15, 2018

    I recently built a City Data React app which consumes a separate Rails API. The user inputs a US city, and in return gets local...


  • Favorite/Unfavorite Toggle on Single Rails Model

    April 19, 2018

    If you’re looking to add a system of favoriting / unfavoriting to a single Rails 5 model, you’re in the right place. This post uses...


  • Filtering Rails Table Records with Javascript

    April 2, 2018

    I like Rails. I’ve felt pretty darned comfortable in the Rails ecosystem for a couple of years now. Branching out into javascript features, however, has...


  • Single Page CRUD App in Rails: Part 3 - Editing Records

    March 23, 2018

    Well here we are in the final stretch of making our Rails app AJAX CRUDdy! In this series, I explain how to interact with database...


  • Single Page CRUD App in Rails: Part 2 - Deleting Records

    March 16, 2018

    This is the second post in my Single Page CRUD App in Rails series. In this series, I explain how to make changes to database...


  • Single Page CRUD App in Rails: Part 1 - New Records

    March 9, 2018

    I’ve been wanting to make the UX of my Rails apps more streamlined, and in some cases, that means a little AJAX. So I built...


  • Using a Factory to Randomize Whether a Card is Drawn Right-side Up or Upside Down

    February 26, 2018

    UPDATE: Holy smokes! I’ve just refactored the code in this post to be even better :) See it in this new post. Building the Original...


  • Handy Localhost Bookmarks

    February 25, 2018

    A while back, I set up a bookmarks folder in my browser with all of the default localhost addresses I use. It’s come in pretty...


  • Keeping your Polymorphic "like"s Code DRY

    January 30, 2018

    I was recently setting up a social media app with BlogPosts, PhotoPosts, and Comments – and I needed to have users be able to “like”...


  • How to fix it when the Rails Server is already running, but not where you can find it

    November 30, 2017

    Have you ever accidentally closed a terminal tab while the rails server was still running and weren’t able to find it again? I’ve done this...


  • A Case for Using Procs

    September 24, 2017

    I’ve read about and practiced working with Ruby procs – all with contrived examples. That’s all well and good, but for me, the best learning...


  • Finding Prime Numbers in Ruby

    September 22, 2017

    Code quizzes commonly have a prime number challenge, which got me to thinking, shouldn’t there already be an is_prime method? Well, yes, there should be....


  • Output to Ruby hashes in one step with each_with_object

    September 16, 2017

    Today I discovered Ruby’s each_with_object method and I thought it was pretty nifty. Here is how it works. An example with an output array of...


  • Using Git is like Sending Packages in the Mail

    July 22, 2017

    So you’ve just gotten your feet wet with web development or programming and in the whirlwind of setting up your machine for class, you have a...


  • How to Access Your Sublime Snippets

    July 14, 2017

    Once I discovered the power of SublimeText’s snippet feature, there was no turning back. Any time I find myself typing a thing that could be automated,...


  • How to make ruby shortcuts (snippets) in Sublime Text

    July 13, 2017

    Typing Ruby erb tags is a past time pursued intentionally by… no one? Well, certainly not me! The characters <%= %> don’t exactly flow off of...


  • Using Variables in CSS

    July 12, 2017

    If you find yourself working in CSS and missing the ability to use SASS variables, oh boy do I have a treat for you. You...


This site was built using Jekyll based on the *folio theme and is hosted on Github ©2024