• 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

Golang for loop

Posted May 12, 2023 — Updated Jan 10, 2024

Go has a few for loop options: Classic for loop This format is common in many languages: The one difference in Go is the lack of opening parentheses around the init statements, which are required in other languages like Javascript, Java, or C. For loop using range Golang doesn’t have a for in loop, but […]

Filed Under: Golang

Bash ampersand (&)

Posted May 10, 2023 — Updated Jan 10, 2024

The single ampersand & is used to run commands asynchronously in the background. From the bash docs: If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. This is known as executing the command in the background, and these are referred to as asynchronous commands. The […]

Filed Under: Command Line, Shell

Python double slash operator

Posted May 10, 2023 — Updated Feb 6, 2024

Python’s double slash (//) operator performs floor division. What exactly is floor division? Floor division is a normal division operation except that it returns the largest possible integer. This integer is either less than or equal to the normal division result. – Educative.io In code, it looks like this: Some languages perform floor division by […]

Filed Under: Python

Is Comcast throttling me? The technical details

Posted May 6, 2023 — Updated Dec 5, 2023

In case you aren’t one of the three people in the world who read the first post in this series, Is Comcast throttling me?, let me bring you up to speed: This post is about how I reached the conclusion in #5 from a technical standpoint, including code snippets. If you just want the results, […]

Filed Under: Projects

How to kill a process

Posted May 5, 2023 — Updated Jan 10, 2024

The easiest way: use pkill to kill a running process by name. Let’s say you have a background task running: Those sleep commands will run for 60 seconds and 600 seconds, respectively. Kill a process by name If we want to kill them sooner, we can just pkill them by name: pkill works similar to […]

Filed Under: Command Line

Golang Ellipsis

Posted May 2, 2023 — Updated Jan 10, 2024

Golang’s ellipsis-…-has a few different uses. Defining variadic function parameters What is variadic? It is a function “of unknown arity”. In plain English, that means “a function that can take an unknown number of arguments”. A commonly-used function with variadic function parameters is Go’s builtin log.Printf. This is its signature: The signature of Printf says […]

Filed Under: Golang

Is Comcast throttling me?

Posted Apr 30, 2023 — Updated Feb 16, 2024

Update: The conclusions in this post might be invalid. I’ve left the post unchanged but I added a footnote explaining why. I never thought I’d apologize to Comcast, but … sorry I said–in great detail–that your service is bad. It turns out maybe it isn’t? Ok here’s the original post: Since the pandemic, I’ve been […]

Filed Under: Projects

The Bash trap command

Posted Apr 29, 2023 — Updated Jan 10, 2024

Bash’s trap command is used to catch and react to signals sent to your shell. It’s similar to an event listener in the browser, or a pubsub topic subscriber. The typical use case is to run some kind of cleanup command when a process terminates, like this: The command above will run cleanup_job when it […]

Filed Under: Command Line, Shell

Dedupe a list in Vim

Posted Apr 20, 2023 — Updated Jan 10, 2024

Tldr: use :sort u Surprisingly often, I find myself needing to dedupe a list, usually when digging through logs. There are many ways to dedupe a list, but Vim might just be the fastest one. Take this list of UUIDs I pulled when investigating a recent issue: From a quick look, I can see that […]

Filed Under: Productivity, Tips, Vim

Ruby’s safe navigation operator (&.)

Posted Apr 16, 2023 — Updated Jan 10, 2024

Ruby’s safe navigation operator (&.) is a nil-safe way to chain operations. Let’s say we have a User class, and that class can have first_name and last_name attributes: Without safe navigation, we’d need a more-verbose if check to accomplish the same thing: If you’re familiar with Javascript, ruby’s safe navigation works just like javascript’s optional […]

Filed Under: Ruby

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • 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