25 October 2016
Whenever I bootstrap an app, I follow the same steps for Heroku. Create a staging and production app. Assign them to a pipeline. Provision the same 5 free tier addons per app. Deploy each app. All told, that usually adds up to 20-30 minutes for each new project. I’ve moved this code into a dev-ops gem, HerokuOps. This first version is extremely opiniated, but flexibility, refactors and even more features will come soon.
gem "heroku_ops", group: :development
25 October 2016
Too much Repition
The situation: lots of projects, and you’ve got important code to share. Except in this case, your code are rake tasks for devops, and you can’t just throw it into a module within a gem and have it run properly. Sharing rake tasks via a gem is slightly more complex than sharing module or code classes with a gem, so read on to see how I made it happen.
23 October 2016
Find Cool Hacks for your Work
Once every few weeks, I find contemplating a new feature or project I’d like to pursue either for a client or myself. Often, this involves building out a simple proof of concept. This is the path my thought process will go down:
- Build a mental picture, start to finish of the large building blocks (The high level, architectural view)
- For each large feature, quickly run through the individual implementation details in my head and identify the process needed to build that larger feature out
- Connect the dots
Invariably, there will be some detail that escapes my current knowhow. These days I typically solve that between reading source code and hacking around in Pry. What follows is a list of a few cool tricks and observations I’ve run across while finding solutions to future development. There will be more to come as I expand on it.
22 October 2016
Always Have a Good Place to Start
Over the last few months I’ve had a couple ideas bouncing around in my head for experimental projects. After creating basic versions of them, I found myself repeating steps to set those applications up. So, I decided to DRY up my life and create a base Rails 5 application with all my usual configuration changes extracted out to a couple environment variables. Now, I can simply clone this application, change 3-5 lines in
.env and immediately get to feature development.
Without further ado, the repo: Rails 5 Base Application Repo
Feel free to clone, fork and use for yourself. As long as I continue to develop with Rails, this repo will be evolving to keep my personal workflow efficient.
21 October 2016
The following is a guest post by Daniel Rice of LD Studios:
Over the course of my experience as a developer, I’ve often found that when things get complex - they get really complex. Often times the key to a solution isn’t finding the one thing that solves a problem, but rather the combination of different functionalities that ends up being the solution that works the best. In the case of one of our pro-bono projects, I had a particularly difficult problem that I needed to solve - and the solution that I arrived at involved a combination of Postgres’ Common Table Expressions, Window Functions, SearchLight, and Rails Query Scopes. What on earth was I trying to accomplish that could possibly elicit this witches brew of open source technologies? Simple*: I needed to take user-supplied input, sanitize it, geocode it, then ensure that the result set did not contain duplicates. Each of the tools listed above contributed in some fashion to the working solution!