Ukiah Smith Ukiah Smith

  • Blog
  • Resume
  • Contact
  • Twitter
  • GitHub
  • LinkedIn
  • RSS
The world is mirrored.

Improved Golang JSON unmarshaling with time and URL

Often times we need to unmarshal upstream data with unique constraints. Such as custom data types, or custom parsing of specific formats. Using the standard library could be impractical, and handling long structs manually can be tedious; however there is an alternative.

Two large objects closing in.

Which Compression Format to Use for Archiving

As my digital documents grows and expands I want to ensure that my documents and data will be available to me far into the future. One of the challenges of managing all my data is organizing and backing up the many many files I have. I want to save almost all of my files and documents, but A lot of them I suspect I will rarely access in the future. Or maybe I will never access them.

Golang Try() and Programming in the Large

The new try() proposal is counter to the core principles of the Go language, specifically software engineering in the large. The proposal’s stated goal is to reduce the tediousness around handling errors. I believe, that in actuality, it would reduce explicitness, increase complexity, and hinder large teams on large code bases. try() removes the shape of current error handling, the if != nil pattern of error checking and replaces it with a single builtin function, that can be nested.
Large tubes in a concrete bunker.

Bash: Check for Duplicates

I often find myself wanting to do a series of repetitive tasks for a small set of data. XKCD has a nice guide for when to write a script for repetitive tasks. Unfortunately I find myself with one off tasks that I would never use a script for again. Still I will write a script to automate my task. Part of me thinks I am saving time, but I’m probably not.
Tmux: custom project workspace

Tmux: custom project workspace

Tmux is a wonderful tool to increase my productivity by multiplexing windows and apps to a single terminal. I use it all the time when working on a project to organize my tools, and quickly switch between them. One things I do these days is create a shell script to launch, and customize, my tmux session for the specific project that I am working on. This give me quick access to a complex setup, allowing me to jump into a project and get moving quickly.
A gentle introduction to Golang Modules

A gentle introduction to Golang Modules

Go 1.11 introduced a new concept of Modules which brings first class support for managing dependency versions and enabling reproducible builds. Go previously had no notion of dependency versions, and it has been a long and arduous road to get where we are now. Modules do not just copy the style of other programming language’s dependency tools, rather it introduces a few slightly different concepts intended to enable programming in the large.
TDD Red Red Green

TDD: Red Red Green

Testing gets easier the more you do it. I guess it’s like most things in that regard. For me my comfort level has risen as I have forced myself to practice the small steps that make up Test Driven Development. That was the next step in my TDD journey. If you recall from my previous TDD blog post I was starting from nothing. No experience dong TDD or testing. My uncomfortableness was physical, a mini anxiety attack, a moment of doubt.
DockerCon 2018

DockerCon 2018

This post was originally published here. You would think the world is falling apart; or rather it seems that way, and I’m only really talking about the world of software. I’ll leave politics out of this. It’s not that the world of software is falling apart; or rather our applications are. What once were gleaming monoliths, monuments to our own achievement are now being hacked and splintered into microservices. Rather this is the natural cycle that our industry seems to follow every few decades.
Journey into TDD

Journey Into TDD: I have no idea what I'm doing

There is something small and tiny that I feel I am missing about Test Driven Development. I understand the basic principle of the matter; write a test that fails, then write the code to make it pass, rinse and repeat; red, green, then refactor. Knowing that basic truth of what TDD is has not translated into actually being able to use it as a practice in my day to day coding.

How to Read 12 Books in a Year

Yikes, I am behind in my reading goal. It is lat in the month of January and I am not far enough along in my reading to hit my goal. I am reading the first book to reach my goal that is my New Year’s resolution to read twelve books this year. It is a small step up from the seven books I read last year. The challenge though is that I am already behind.
hugo improved asset cache busting

Hugo: Improved static asset cache busting

Previously I was using a quick fix solution to bust cache on my static css files. Briefly, cache busting is a strategy of uniquely naming CSS and Javascript assets to improve page loads, and speed up propagation of changes when updates to the layout are made. More on cache busting. My previous technique worked as needed but suffered from a couple limitation. I was using random numbers appended to the CSS filename to get a unique filename.
orangetext15

Semantic Class Naming

How we name html class names is important. Naming in general is important. A class name is a little story we can tell ourselves. Later in the development process we can quickly and easily know what an element is for based on the name. We learn from a class name what something is, and what we can expect from it. Semantic class naming is a style in which we use class names that describe what an element is, or it’s intended purpose, rather than how it looks.
Gears turning

Hugo static asset cache busting

Hugo is a great static site generator. It is crazy fast and has tons of options, but one thing I had not been able to discover was how to use variable data in make, my build tool, and pass it to a Hugo template. I wanted a way to create unique CSS filenames, and use those filenames in my Hugo templates.

Go: Marshal and Unmarshal JSON with time and URL data

Go has a robust JSON library for consuming and outputting JSON. The standard json.Marshal() and json.Unmarshal() functions do a great job of aligning primitive types and converting them from Go into JSON, and vise versa. Beyond the basic types you will have to create custom marshaling methods on your types and write some logic to handle the conversion process. We will go over writing these custom methods for types that contain time and URL data.
The front of the Everyday Messenger

Peak Design Everyday Messenger Review

The most frustrating part of the Everyday Messenger is that it is damn near perfect; not quite, but almost. The unique locking latch, a thoughtful strap, and quality construction make this bag a great everyday carry. The Everyday Messenger is intended to be a photographers bag; with the main compartment set to house a camera and extra lenses. The bag is intended for carrying camera gear, but remove the padded dividers and it works for a laptop and “office” stuff.
Tracce di Stelle

Quick and easy web server for local development

Sometimes I want a quick way to build some web pages. A way that does not require installing a lot of servers locally, but is still better than opening the file directly in my web browser. When I start a new web project I break it up into small steps. These steps form a natural set of milestones, and helps me to reason about the project as a whole. Focusing on each step helps me make progress on the entire project.

Initializing channels in Go

With most variables in Go we can declared them in a couple of different ways. Using the var keyword, initialize them as we declare them with the := operator; or using the new or make keywords. Most variables can be declared with var, which only reserves storage for a named variable. If no assignment accompanies the statement, the variable is set to it’s zero value. Using var to declare a channel crates a nil channel.

fmt.Scanf Introduction

From the fmt package; the Scanf function is used to read input from stdin. When you run this snippet of code the main() function will wait for user input a string, a number, and a second string. Which it puts into variables, and then uses to print some information. Scanf woul be used when you want to write a command line program that requires user input during the running process.

Firefox to integrate Pocket

I was shocked when I saw news of Mozilla’s Firefox native integration with Pocket; the popular read-it-later bookmarking service. This is the first time I can remember when Mozilla has integrated a commercial third-party service. It feels a little odd. I understand why they might have done this. My guess is that Pocket is another revenue stream for Mozilla. I can appreciate the need for money; it keeps the employees happy, and the Firefox updates rolling out in a timely fashion.
Sähköä ilmassa sunset behind power lines

Building Go projects with gb

gb is a new build tool for Go created by Dave Cheney. It address the problem of reproducible builds. Building the same functional binary anywhere at any time is a problem of dependency management. Of knowing exactly which library version to use, and having it at hand. gb is a radical tool compared to current dependency solutions, which work with the existing Go toolchain and idioms. gb takes a different approach, it replaces not only dependency management tools, but the Go build tools themselves.
The world is mirrored.

Improved Golang JSON unmarshaling with time and URL

Often times we need to unmarshal upstream data with unique constraints. Such as custom data types, or custom parsing of specific formats. Using the standard library could be impractical, and handling long structs manually can be tedious; however there is an alternative.

Large tubes in a concrete bunker.

Bash: Check for Duplicates

I often find myself wanting to do a series of repetitive tasks for a small set of data. XKCD has a nice guide for when to write a script for repetitive tasks. Unfortunately I find myself with one off tasks that I would never use a script for again. Still I will write a script to automate my task. Part of me thinks I am saving time, but I’m probably not.
TDD Red Red Green

TDD: Red Red Green

Testing gets easier the more you do it. I guess it’s like most things in that regard. For me my comfort level has risen as I have forced myself to practice the small steps that make up Test Driven Development. That was the next step in my TDD journey. If you recall from my previous TDD blog post I was starting from nothing. No experience dong TDD or testing. My uncomfortableness was physical, a mini anxiety attack, a moment of doubt.

How to Read 12 Books in a Year

Yikes, I am behind in my reading goal. It is lat in the month of January and I am not far enough along in my reading to hit my goal. I am reading the first book to reach my goal that is my New Year’s resolution to read twelve books this year. It is a small step up from the seven books I read last year. The challenge though is that I am already behind.
Gears turning

Hugo static asset cache busting

Hugo is a great static site generator. It is crazy fast and has tons of options, but one thing I had not been able to discover was how to use variable data in make, my build tool, and pass it to a Hugo template. I wanted a way to create unique CSS filenames, and use those filenames in my Hugo templates.

Tracce di Stelle

Quick and easy web server for local development

Sometimes I want a quick way to build some web pages. A way that does not require installing a lot of servers locally, but is still better than opening the file directly in my web browser. When I start a new web project I break it up into small steps. These steps form a natural set of milestones, and helps me to reason about the project as a whole. Focusing on each step helps me make progress on the entire project.

Firefox to integrate Pocket

I was shocked when I saw news of Mozilla’s Firefox native integration with Pocket; the popular read-it-later bookmarking service. This is the first time I can remember when Mozilla has integrated a commercial third-party service. It feels a little odd. I understand why they might have done this. My guess is that Pocket is another revenue stream for Mozilla. I can appreciate the need for money; it keeps the employees happy, and the Firefox updates rolling out in a timely fashion.
Two large objects closing in.

Which Compression Format to Use for Archiving

As my digital documents grows and expands I want to ensure that my documents and data will be available to me far into the future. One of the challenges of managing all my data is organizing and backing up the many many files I have. I want to save almost all of my files and documents, but A lot of them I suspect I will rarely access in the future. Or maybe I will never access them.
Tmux: custom project workspace

Tmux: custom project workspace

Tmux is a wonderful tool to increase my productivity by multiplexing windows and apps to a single terminal. I use it all the time when working on a project to organize my tools, and quickly switch between them. One things I do these days is create a shell script to launch, and customize, my tmux session for the specific project that I am working on. This give me quick access to a complex setup, allowing me to jump into a project and get moving quickly.
DockerCon 2018

DockerCon 2018

This post was originally published here. You would think the world is falling apart; or rather it seems that way, and I’m only really talking about the world of software. I’ll leave politics out of this. It’s not that the world of software is falling apart; or rather our applications are. What once were gleaming monoliths, monuments to our own achievement are now being hacked and splintered into microservices. Rather this is the natural cycle that our industry seems to follow every few decades.
hugo improved asset cache busting

Hugo: Improved static asset cache busting

Previously I was using a quick fix solution to bust cache on my static css files. Briefly, cache busting is a strategy of uniquely naming CSS and Javascript assets to improve page loads, and speed up propagation of changes when updates to the layout are made. More on cache busting. My previous technique worked as needed but suffered from a couple limitation. I was using random numbers appended to the CSS filename to get a unique filename.

Go: Marshal and Unmarshal JSON with time and URL data

Go has a robust JSON library for consuming and outputting JSON. The standard json.Marshal() and json.Unmarshal() functions do a great job of aligning primitive types and converting them from Go into JSON, and vise versa. Beyond the basic types you will have to create custom marshaling methods on your types and write some logic to handle the conversion process. We will go over writing these custom methods for types that contain time and URL data.

Initializing channels in Go

With most variables in Go we can declared them in a couple of different ways. Using the var keyword, initialize them as we declare them with the := operator; or using the new or make keywords. Most variables can be declared with var, which only reserves storage for a named variable. If no assignment accompanies the statement, the variable is set to it’s zero value. Using var to declare a channel crates a nil channel.
Sähköä ilmassa sunset behind power lines

Building Go projects with gb

gb is a new build tool for Go created by Dave Cheney. It address the problem of reproducible builds. Building the same functional binary anywhere at any time is a problem of dependency management. Of knowing exactly which library version to use, and having it at hand. gb is a radical tool compared to current dependency solutions, which work with the existing Go toolchain and idioms. gb takes a different approach, it replaces not only dependency management tools, but the Go build tools themselves.

Golang Try() and Programming in the Large

The new try() proposal is counter to the core principles of the Go language, specifically software engineering in the large. The proposal’s stated goal is to reduce the tediousness around handling errors. I believe, that in actuality, it would reduce explicitness, increase complexity, and hinder large teams on large code bases. try() removes the shape of current error handling, the if != nil pattern of error checking and replaces it with a single builtin function, that can be nested.
A gentle introduction to Golang Modules

A gentle introduction to Golang Modules

Go 1.11 introduced a new concept of Modules which brings first class support for managing dependency versions and enabling reproducible builds. Go previously had no notion of dependency versions, and it has been a long and arduous road to get where we are now. Modules do not just copy the style of other programming language’s dependency tools, rather it introduces a few slightly different concepts intended to enable programming in the large.
Journey into TDD

Journey Into TDD: I have no idea what I'm doing

There is something small and tiny that I feel I am missing about Test Driven Development. I understand the basic principle of the matter; write a test that fails, then write the code to make it pass, rinse and repeat; red, green, then refactor. Knowing that basic truth of what TDD is has not translated into actually being able to use it as a practice in my day to day coding.
orangetext15

Semantic Class Naming

How we name html class names is important. Naming in general is important. A class name is a little story we can tell ourselves. Later in the development process we can quickly and easily know what an element is for based on the name. We learn from a class name what something is, and what we can expect from it. Semantic class naming is a style in which we use class names that describe what an element is, or it’s intended purpose, rather than how it looks.
The front of the Everyday Messenger

Peak Design Everyday Messenger Review

The most frustrating part of the Everyday Messenger is that it is damn near perfect; not quite, but almost. The unique locking latch, a thoughtful strap, and quality construction make this bag a great everyday carry. The Everyday Messenger is intended to be a photographers bag; with the main compartment set to house a camera and extra lenses. The bag is intended for carrying camera gear, but remove the padded dividers and it works for a laptop and “office” stuff.

fmt.Scanf Introduction

From the fmt package; the Scanf function is used to read input from stdin. When you run this snippet of code the main() function will wait for user input a string, a number, and a second string. Which it puts into variables, and then uses to print some information. Scanf woul be used when you want to write a command line program that requires user input during the running process.
Understanding Go Dependency Management

Understanding Go Dependency Management

Right now there is a discussion thread on the golang-dev mailing list about formalizing how Go manages dependencies. The Go Team is putting forward that Go use vendoring to manage dependencies, and asked the community to formalize a configuration format that tools can use to manage vendored code.

For sometime the Go team has been very passive in directing how Go manages dependencies. When Go was first released to the public the only mechanism or best practice was to use go get which is not much more than a simple tool to fetch code.

ukiahsmith.com
  • Terms of Service
  • Privacy Policy
© 2005-2022 Ukiah Smith