Category: golang
Golang Closures For Configuration
One common code smell is creating functions with a long list of parameters. Adding a new function usually starts out optimistically with a few inputs or known state that is needed. Over time you start adding more state and extending functionality of existing code and quickly it turns into something that is no longer maintainable or causes issues of other places in the codebase needed a larger list of dependencies and state to call these codepaths. Let’s look at one approach you can take with golang.
Golang Debug Bytes
Golang Printing Tabstopped Text into Aligned Columns
One of the strengths of Golang as a language is it has a pretty strong standard library of packages out of the box. Things like the httptest package and even the http package is strong enough that there are countless http servers open sourced built on top of it. One of the hidden convenient packages I’ve used is the tabwriter to help print out tabstopped text into aligned text.
Golang Testing time.Now
Testing time objects can be a pain. Some languages offer some helpful libraries that can help like VCR in Ruby. Other tools to help are mocking libraries to where you can mock and stub out the time calls to what you want. In golang there is another way to help and that is using dependency injection to help make testing easier.
Golang Documenting Package Examples
Go has been gaining a lot of popularity recently. With a lot of the success stories centered on the performance gains switching from other languages. For me a lot of the smaller features, that shows an attention to detail, which makes it enjoyable to code in.
Golang Timed Function Wrapper
Wrote this quick and probably dirty wrapper for timing functions in Go.
TimedReturn
returns an interface{}
in case a return value is needed
from whatever you are wrapping.
Golang Package Version Flag
So you’ve built your first service using Go and have it deployed out into your production environment. With cross compiling built into Go it’s easy and almost trivial to build a new binary of your code and deploy updates.
Golang Current File Path
I recently needed to get the current file absolute path from a go file. You first need to get the runtime package which is a part of Go
Category: refactoring
Golang Closures For Configuration
One common code smell is creating functions with a long list of parameters. Adding a new function usually starts out optimistically with a few inputs or known state that is needed. Over time you start adding more state and extending functionality of existing code and quickly it turns into something that is no longer maintainable or causes issues of other places in the codebase needed a larger list of dependencies and state to call these codepaths. Let’s look at one approach you can take with golang.
Category: aws
Serverless Events with Existing S3 Bucket
Serverless helps you with functions as a service across multiple providers. Using serverless with AWS allows you to tie these functions into your AWS infrastructure, or tie it into existing resources. Previously you couldn’t use existing S3 buckets for serverless lambda events. Today I learned that you can now use existing buckets.
AWS with STS for MFA Required Access
If you are using AWS for anything, and security is on top of your mind, you may have run into some friction using the AWS services programatically. May companies require MFA to be set up just to access the AWS console. Some go even further by adding the constraint of requiring a group, or all users, to use MFA for programatic access to their account. If you have ever been put into this situation and tried to use the AWS APIs you know how it can become a burden to now do the things you are used to doing from simple CLI calls.
Category: lambda
Serverless Events with Existing S3 Bucket
Serverless helps you with functions as a service across multiple providers. Using serverless with AWS allows you to tie these functions into your AWS infrastructure, or tie it into existing resources. Previously you couldn’t use existing S3 buckets for serverless lambda events. Today I learned that you can now use existing buckets.
Category: serverless
Serverless Events with Existing S3 Bucket
Serverless helps you with functions as a service across multiple providers. Using serverless with AWS allows you to tie these functions into your AWS infrastructure, or tie it into existing resources. Previously you couldn’t use existing S3 buckets for serverless lambda events. Today I learned that you can now use existing buckets.
Category: til
Serverless Events with Existing S3 Bucket
Serverless helps you with functions as a service across multiple providers. Using serverless with AWS allows you to tie these functions into your AWS infrastructure, or tie it into existing resources. Previously you couldn’t use existing S3 buckets for serverless lambda events. Today I learned that you can now use existing buckets.
Golang Debug Bytes
Bash Say Command In CI
Sometimes you just need to say
it from a bash script and some times your
CI provider won’t be OK with that. Today I learned of one such provider, CircleCI
who didn’t want to play nicely with using say
Momentjs Date Mutation
If you’ve ever had to work with a lot of date logic in javascript you’ve likely used or at least seen Momentjs. It can be convenient for moving dates to other timezones or date math. I ran into another today I learned moment trying to write some tests in Jest while using moment to handle dates in test setup and fixtures.
Ruby 2.6 Endless Range
For a today I learned moment I ran into the new endless range feature in ruby 2.6 by coming across some code that triggered this error message:
RangeError (cannot get the last element of endless range)
The code that was updated to the latest ruby 2.6 release had a dynamic range that was pulling fields from a database and doing something like this:
Golang Current File Path
I recently needed to get the current file absolute path from a go file. You first need to get the runtime package which is a part of Go
Category: ci-cd
Terraform CI/CD
Terraform helps in creating cross-cloud immutable infrastructure with code. As with most code there is an ideal of having your codebase automated with tests and deploys. How can this work with terraform? Does it work in a sensible way to give you confidence in your changes and how they ultimately get applied? Trying to answer these questions led to the following approach that I’ve used to attempt to try having a CI/CD solution for a terrorm codebase.
Category: devops
Terraform CI/CD
Terraform helps in creating cross-cloud immutable infrastructure with code. As with most code there is an ideal of having your codebase automated with tests and deploys. How can this work with terraform? Does it work in a sensible way to give you confidence in your changes and how they ultimately get applied? Trying to answer these questions led to the following approach that I’ve used to attempt to try having a CI/CD solution for a terrorm codebase.
Terraform Conditionals
Terraform is a very versatile tool to help automate your infrastructure and codify your infrastructure as code. With a large open source community and tons of providers across multiple cloud platforms it allows developers to create plans for spinning up infrastructure effortlessly. One thing I ran into that needed a little more effort was adding conditional steps to a configuration plan. Due to the complex nature of Terraform and how it attempts to plan out how it will execute your configuration it is a little more involved to get conditionals working.
Ansible Galaxy – Testing Roles with Test Kitchen
Ansible is a provisioning tool to easily help you get your infrastructure
under control. One of the key elements in Ansible is a role
. There are public
roles to get you started quickly with Ansible over at Ansible Galaxy. One
thing Ansible is sort of lacking is a strong testing approach for open source
roles.
Category: infrastructure as code
Terraform CI/CD
Terraform helps in creating cross-cloud immutable infrastructure with code. As with most code there is an ideal of having your codebase automated with tests and deploys. How can this work with terraform? Does it work in a sensible way to give you confidence in your changes and how they ultimately get applied? Trying to answer these questions led to the following approach that I’ve used to attempt to try having a CI/CD solution for a terrorm codebase.
Terraform Conditionals
Terraform is a very versatile tool to help automate your infrastructure and codify your infrastructure as code. With a large open source community and tons of providers across multiple cloud platforms it allows developers to create plans for spinning up infrastructure effortlessly. One thing I ran into that needed a little more effort was adding conditional steps to a configuration plan. Due to the complex nature of Terraform and how it attempts to plan out how it will execute your configuration it is a little more involved to get conditionals working.
Ansible Galaxy – Testing Roles with Test Kitchen
Ansible is a provisioning tool to easily help you get your infrastructure
under control. One of the key elements in Ansible is a role
. There are public
roles to get you started quickly with Ansible over at Ansible Galaxy. One
thing Ansible is sort of lacking is a strong testing approach for open source
roles.
Category: terraform
Terraform CI/CD
Terraform helps in creating cross-cloud immutable infrastructure with code. As with most code there is an ideal of having your codebase automated with tests and deploys. How can this work with terraform? Does it work in a sensible way to give you confidence in your changes and how they ultimately get applied? Trying to answer these questions led to the following approach that I’ve used to attempt to try having a CI/CD solution for a terrorm codebase.
Terraform Conditionals
Terraform is a very versatile tool to help automate your infrastructure and codify your infrastructure as code. With a large open source community and tons of providers across multiple cloud platforms it allows developers to create plans for spinning up infrastructure effortlessly. One thing I ran into that needed a little more effort was adding conditional steps to a configuration plan. Due to the complex nature of Terraform and how it attempts to plan out how it will execute your configuration it is a little more involved to get conditionals working.
Category: golang pkg
Golang Printing Tabstopped Text into Aligned Columns
One of the strengths of Golang as a language is it has a pretty strong standard library of packages out of the box. Things like the httptest package and even the http package is strong enough that there are countless http servers open sourced built on top of it. One of the hidden convenient packages I’ve used is the tabwriter to help print out tabstopped text into aligned text.
Category: golang tabwriter
Golang Printing Tabstopped Text into Aligned Columns
One of the strengths of Golang as a language is it has a pretty strong standard library of packages out of the box. Things like the httptest package and even the http package is strong enough that there are countless http servers open sourced built on top of it. One of the hidden convenient packages I’ve used is the tabwriter to help print out tabstopped text into aligned text.
Category: bash
Bash Say Command In CI
Sometimes you just need to say
it from a bash script and some times your
CI provider won’t be OK with that. Today I learned of one such provider, CircleCI
who didn’t want to play nicely with using say
Switching From Bash To Fish
I recently went through a painless transition from years of bash to fish shell in one evening. My bash setup has been stale for quite some time. I am mainly working in a bash terminal on a Mac and various Linux distributions. Bash, for me, has always been a bit of a mess to sort out the quirks of writing up scripts, loading in profile and configuration, and customizing the shell prompt. I had always put up with the quirks up until the other day when I decided to take the dive into Fish Shell.
Category: ci
Bash Say Command In CI
Sometimes you just need to say
it from a bash script and some times your
CI provider won’t be OK with that. Today I learned of one such provider, CircleCI
who didn’t want to play nicely with using say
Category: dependency injection
Golang Testing time.Now
Testing time objects can be a pain. Some languages offer some helpful libraries that can help like VCR in Ruby. Other tools to help are mocking libraries to where you can mock and stub out the time calls to what you want. In golang there is another way to help and that is using dependency injection to help make testing easier.
Category: golang testing
Golang Testing time.Now
Testing time objects can be a pain. Some languages offer some helpful libraries that can help like VCR in Ruby. Other tools to help are mocking libraries to where you can mock and stub out the time calls to what you want. In golang there is another way to help and that is using dependency injection to help make testing easier.
Category: testing
Golang Testing time.Now
Testing time objects can be a pain. Some languages offer some helpful libraries that can help like VCR in Ruby. Other tools to help are mocking libraries to where you can mock and stub out the time calls to what you want. In golang there is another way to help and that is using dependency injection to help make testing easier.
Momentjs Date Mutation
If you’ve ever had to work with a lot of date logic in javascript you’ve likely used or at least seen Momentjs. It can be convenient for moving dates to other timezones or date math. I ran into another today I learned moment trying to write some tests in Jest while using moment to handle dates in test setup and fixtures.
Ansible Galaxy – Testing Roles with Test Kitchen
Ansible is a provisioning tool to easily help you get your infrastructure
under control. One of the key elements in Ansible is a role
. There are public
roles to get you started quickly with Ansible over at Ansible Galaxy. One
thing Ansible is sort of lacking is a strong testing approach for open source
roles.
Category: js
Momentjs Date Mutation
If you’ve ever had to work with a lot of date logic in javascript you’ve likely used or at least seen Momentjs. It can be convenient for moving dates to other timezones or date math. I ran into another today I learned moment trying to write some tests in Jest while using moment to handle dates in test setup and fixtures.
Category: programming languages
Ruby 2.6 Endless Range
For a today I learned moment I ran into the new endless range feature in ruby 2.6 by coming across some code that triggered this error message:
RangeError (cannot get the last element of endless range)
The code that was updated to the latest ruby 2.6 release had a dynamic range that was pulling fields from a database and doing something like this:
Category: ruby
Ruby 2.6 Endless Range
For a today I learned moment I ran into the new endless range feature in ruby 2.6 by coming across some code that triggered this error message:
RangeError (cannot get the last element of endless range)
The code that was updated to the latest ruby 2.6 release had a dynamic range that was pulling fields from a database and doing something like this:
Category: developer tools
Switching From Bash To Fish
I recently went through a painless transition from years of bash to fish shell in one evening. My bash setup has been stale for quite some time. I am mainly working in a bash terminal on a Mac and various Linux distributions. Bash, for me, has always been a bit of a mess to sort out the quirks of writing up scripts, loading in profile and configuration, and customizing the shell prompt. I had always put up with the quirks up until the other day when I decided to take the dive into Fish Shell.
AWS with STS for MFA Required Access
If you are using AWS for anything, and security is on top of your mind, you may have run into some friction using the AWS services programatically. May companies require MFA to be set up just to access the AWS console. Some go even further by adding the constraint of requiring a group, or all users, to use MFA for programatic access to their account. If you have ever been put into this situation and tried to use the AWS APIs you know how it can become a burden to now do the things you are used to doing from simple CLI calls.
Category: fishshell
Switching From Bash To Fish
I recently went through a painless transition from years of bash to fish shell in one evening. My bash setup has been stale for quite some time. I am mainly working in a bash terminal on a Mac and various Linux distributions. Bash, for me, has always been a bit of a mess to sort out the quirks of writing up scripts, loading in profile and configuration, and customizing the shell prompt. I had always put up with the quirks up until the other day when I decided to take the dive into Fish Shell.
Category: aws cli tools
AWS with STS for MFA Required Access
If you are using AWS for anything, and security is on top of your mind, you may have run into some friction using the AWS services programatically. May companies require MFA to be set up just to access the AWS console. Some go even further by adding the constraint of requiring a group, or all users, to use MFA for programatic access to their account. If you have ever been put into this situation and tried to use the AWS APIs you know how it can become a burden to now do the things you are used to doing from simple CLI calls.
Category: security
AWS with STS for MFA Required Access
If you are using AWS for anything, and security is on top of your mind, you may have run into some friction using the AWS services programatically. May companies require MFA to be set up just to access the AWS console. Some go even further by adding the constraint of requiring a group, or all users, to use MFA for programatic access to their account. If you have ever been put into this situation and tried to use the AWS APIs you know how it can become a burden to now do the things you are used to doing from simple CLI calls.
Category: agile
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: agile retrospectives
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: agile teams
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: retrospectives
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: team culture
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: work culture
Appreciations In The Workplace
Appreciations are something we likely overlook on a day to day basis. Given enough time and thought to introspect on things in our lives like relationships, work, family, or hobbies we can quickly start to think of all the things we can, and should, give appreciation for. This can translate well into engineering teams that work closely together with each other.
Category: elixir
Category: gitlab
Category: ansible
Ansible Galaxy – Testing Roles with Test Kitchen
Ansible is a provisioning tool to easily help you get your infrastructure
under control. One of the key elements in Ansible is a role
. There are public
roles to get you started quickly with Ansible over at Ansible Galaxy. One
thing Ansible is sort of lacking is a strong testing approach for open source
roles.
Category: hugo
Go Hugo SEO
Hugo is a static site generator that has caught on for its simplicity and the fact it is built in Go. You can run it as a server or build the static site to host somewhere. If you are using Hugo to build a full site or just a blog you will most likely want to have some dynamic page setup for SEO or analytics. Luckily this is easy enough to do with Hugo.
Category: seo
Go Hugo SEO
Hugo is a static site generator that has caught on for its simplicity and the fact it is built in Go. You can run it as a server or build the static site to host somewhere. If you are using Hugo to build a full site or just a blog you will most likely want to have some dynamic page setup for SEO or analytics. Luckily this is easy enough to do with Hugo.
Category: vagrant
Custom Vagrant Cloud Versioned Box Host
With the recent addition of Atlas to the Hashicorp arsenal, Vagrant got an update to be integrated into Atlas for hosting your VM boxes and handling versioned updates. If you are still looking to have your boxes versioned and are hosting them yourself, or your company has them private, you can still achieve versioning your boxes with the latest Vagrant (1.7.2) and some manual work.
Category: documentation
Golang Documenting Package Examples
Go has been gaining a lot of popularity recently. With a lot of the success stories centered on the performance gains switching from other languages. For me a lot of the smaller features, that shows an attention to detail, which makes it enjoyable to code in.
Category: go
Golang Documenting Package Examples
Go has been gaining a lot of popularity recently. With a lot of the success stories centered on the performance gains switching from other languages. For me a lot of the smaller features, that shows an attention to detail, which makes it enjoyable to code in.
Golang Timed Function Wrapper
Wrote this quick and probably dirty wrapper for timing functions in Go.
TimedReturn
returns an interface{}
in case a return value is needed
from whatever you are wrapping.
Golang Package Version Flag
So you’ve built your first service using Go and have it deployed out into your production environment. With cross compiling built into Go it’s easy and almost trivial to build a new binary of your code and deploy updates.
Golang Current File Path
I recently needed to get the current file absolute path from a go file. You first need to get the runtime package which is a part of Go