• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Justin Joyce

Practical tips and tutorials about software development.

  • Standing Invitation
  • Featured Posts
  • Latest
  • About

Justin

Ruby and Rails nil?, empty?, blank?, and present?

Posted Aug 27, 2023 — Updated Jan 10, 2024

Ruby (and Rails) have many ways to test whether something is … present. But each method behaves slightly differently, and some are Ruby-native while some are added by Rails. Here’s the summary, in case you don’t feel like reading the full details below:   .nil? (Ruby) .empty? (Ruby) .blank? (Rails) .present? (Rails) true false NoMethodError […]

Filed Under: Ruby

JSON in Python

Posted Aug 13, 2023 — Updated Jan 10, 2024

Working with JSON in Python relies on Python’s builtin json module. After you import json, here are the json module methods: Notice that the methods ending in “s” deal directly with strings, whereas the others deal with files. To disambiguate them, I call them “load string” and “dump string” (in my own head, at least). […]

Filed Under: Python

Python sets

Posted Jul 30, 2023 — Updated Jan 10, 2024

Sets are one of Python’s built-in types, and they’re very useful for deduplicating and comparing collections of data. Sets have tons of useful built-in functionality, and this post covers a lot. Here are some jump links to make life easier: Creating a set There are a few options: Check if a set contains a member […]

Filed Under: Python

Countries of the world

Posted Jul 26, 2023 — Updated Jan 10, 2024

During the 2020 Olympics, I was curious about the competitors’ countries. Sure, I could google each one and load up its wikipedia page, but that’s a lot of information and the wikipedia sidebar isn’t the easiest thing to parse at a glance. So, I created my own small web app to summarize countries for me […]

Filed Under: Projects

Git tips and tricks

Posted Jul 18, 2023 — Updated Jan 10, 2024

Git is an essential development tool, and an endless stream of things to learn. This post is some of the tips, tricks, and configurations I use to make life easier day-to-day. Here’s what’s below: Disclaimer: I’m not a git expert. These are just things that have come in handy in my years as a heavy […]

Filed Under: Featured, Git, Tips

Git Stash

Posted Jul 17, 2023 — Updated Jan 10, 2024

Git stash is for stashing away changes you need but aren’t quite ready to commit. The command saves your local modifications away and reverts the working directory to match the HEAD commit. – Git Docs There are a few important stash-related commands. Git stash Say you’re on the main branch, and you started making edits […]

Filed Under: Git

Git Diff

Posted Jul 16, 2023 — Updated Jan 10, 2024

When you want to compare two branches, use git diff. I usually like to pair it with the –stat option for a quick visual summary. Git diff branch_name.. Let’s say I’m on a test branch, and I want to see how that branch differs from main. I can get a quick overview via git diff […]

Filed Under: Git

Developer workflow tips no one tells you about

Posted Jun 30, 2023 — Updated Mar 17, 2024

As developers, we’re expected to know a lot of random things. Sure, you can learn data structures and algorithms from a CS class, and you can learn frameworks from online tutorials or a bootcamp, but what about the other things? How to be more effective on the command line? How to increase productivity on your […]

Filed Under: Featured, Productivity, Tips, Tools

Flatten an array in Javascript

Posted Jun 24, 2023 — Updated Jan 10, 2024

Flattening an array means making it one-dimensional. The easiest way to flatten an array is via Array.prototype.flat. For many years, doing this in javascript required the use of concat, spread, or reduce. Not anymore. Flatten with Array.prototype.flat This method does exactly what you’d expect: By default, flat only flattens one level deep: But flat accepts […]

Filed Under: Arrays, Javascript

Python try except

Posted Jun 1, 2023 — Updated Feb 18, 2024

Try and except are the building blocks of exception handling in Python. You’ll also sometimes see finally and else. Here’s the summary: Try and Except A simple try-except block looks like this: You’ll usually see try and except by themselves; finally is used less often, and else even less. Here’s a (slightly) more realistic example: […]

Filed Under: Python

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Interim pages omitted …
  • Page 6
  • Go to Next Page »

Primary Sidebar

Recent Posts

  • Every Built-In Vim Color Scheme (with screenshots)
  • Reverse a string in Python
  • Meeting Cost Calculator
  • Vim find and replace
  • What makes an effective development team

Categories

  • Arrays (5)
  • Command Line (9)
  • Dates (3)
  • Featured (7)
  • Git (7)
  • Golang (5)
  • Javascript (8)
  • Productivity (8)
  • Projects (4)
  • Python (15)
  • Regex (2)
  • Ruby (3)
  • Shell (2)
  • Thoughts (2)
  • Tips (11)
  • Tools (3)
  • Tutorials (1)
  • Vim (4)

Archives

  • July 2024 (1)
  • February 2024 (1)
  • January 2024 (1)
  • December 2023 (1)
  • November 2023 (1)
  • October 2023 (4)
  • September 2023 (1)
  • August 2023 (2)
  • July 2023 (5)
  • June 2023 (3)
  • May 2023 (6)
  • April 2023 (5)
  • March 2023 (5)
  • February 2023 (10)
  • January 2023 (6)
  • December 2022 (7)

Copyright © 2025 · Contact me at justin [at] {this domain}

  • Privacy Policy