Channel Merging for (Periodic) Func

Channel Merging for (Periodic) Func
Continuing on this hot streak of posts, I figured I’d write up something I’ve wanted to do a post on for quite a while. The idea here is to have a sort of “arterial channel” where we merge some arbitrary number of channels into one singular channel. There’s actually a couple “Just for Func” episodes on this topic that were extremely helpful: justforfunc #26: why are there nil channels in Go? and justforfunc #27: two ways of merging N channels.
Read more →

Channel Smuggling for Fun and Profit

Channel Smuggling for Fun and Profit
Neat snippet for y’all today. I’m calling this snippet “channel smuggling”; I googled this and all that came up was weird stuff. Anyway, the idea here is that suppose you want to pass a piece of data into a channel and have something do some work on it. However, what if you want to block until after all the work on that data is completed? Here’s an example on Go Playground, and here it is replicated below:
Read more →

Snippets: Go For-Select

Snippets: Go For-Select
Hi Folks, it’s been a while and I remembered some handy snippets I’d used for Go synchronization a while back and figured it would be a good blog post subject. It’s pretty straightforward so this should be a light read :)
Read more →

Snippets: tmux

Snippets: tmux
Today’s post is going to be short and sweet. You’re probably used to SSH’ing into remote instances and doing some debugging, running some commands, etc. Usually a plain terminal is fine for this. But sometimes you’re doing something that requires a long lived process and you don’t want the process to be killed if you happen to disconnect from the remote server. Or maybe you just want a sweet looking terminal. Anyway, this is where tmux (short for terminal-multiplexer) comes in.
Read more →

Snippets: All About Go Strings

Snippets: All About Go Strings
Greetings! Coming from a Python background, I don’t have the Go strings API memorized; I frequently find myself repeating the same search/copy/paste for common operations. There’s also a lot of formatting related patterns that I’ve had to repeatedly look up. In this post I’m going to document some of the more useful Go strings snippets I’ve come across, as well as some other useful concepts relating to strings in Go in general.
Read more →

Snippets: Docker and Dockerfile

Snippets: Docker and Dockerfile
In this post I’m going to write down some useful Docker snippets I frequently find myself copy/pasting. There won’t be too much substance to this post; this will mainly be a rather self serving record for my own use cases that I’ll try to update from time to time :)
Read more →