Daniel Azuma

Blog Archive

Building a Discord Command in Ruby on Google Cloud Functions: Part 4
This is the last of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In previous parts, we created a Discord command that displays a short Scripture passage, and implemented it in a webhook. In this part, we show how to split a longer passage across multiple messages, by triggering a second Function that makes Discord API calls. It will illustrate how to use Google Cloud Pub/Sub to run background jobs in Cloud Functions, combining an event architecture with the Discord API to implement a more complex application. Read More ›

Building a Discord Command in Ruby on Google Cloud Functions: Part 3
This is the third of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In previous parts, we deployed a Discord app to Google Cloud Functions, and added a command to a server using the Discord API. In this part, we actually implement the command, calling an external API and displaying results in the channel. It will illustrate how to respond to commands, and how to handle secrets such as API keys in production. Read More ›

Building a Discord Command in Ruby on Google Cloud Functions: Part 2
This is the second of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In the previous part, we set up a Discord application and deployed its webhook to Google Cloud Functions. In this part, we investigate how to add a command to a Discord channel. It will illustrate how to authenticate and interact with the Discord API, how to use it to add a command to a Discord server, and demonstrate some nice tools for invoking these tasks from the command line. Read More ›

Building a Discord Command in Ruby on Google Cloud Functions: Part 1
This is the first of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In this part, we cover setting up a Discord bot, deploying a webhook to Cloud Functions, and validating webhook requests from Discord using the Ruby ed25519 library. At the end of this part, we'll have a working webhook that Discord recognizes, but that doesn't yet actually implement a command. Read More ›

Building a Discord Command in Ruby on Google Cloud Functions
This is the intro to a four-part series on writing a Discord "slash" command. I recently spent a weekend experimenting with the Discord API and writing a command in Ruby for my church's Discord server. These articles step through the process, including setting up Discord integration, deploying the implementation to Cloud Functions, handling secrets and auth, and setting up an event-driven architecture. Read More ›

Should I use instance_eval or class_eval?
This article explores the difference between Ruby's instance_eval and class_eval methods, and takes a peek into the depths of the Ruby execution context. Read More ›

Designing a Ruby Serverless Runtime
We take a look at some of the design decisions and trade-offs involved in bringing Ruby support to Google Cloud Functions. Read More ›

Is it time to replace Rake?
We Ruby developers use Rake and Rakefiles for many of our build, test, and deployment scripts. Yet Rake has always felt a bit clumsy, and that shouldn't be a surprise. It was actually not designed for most of what we use it for. Would a different tool work better? Read More ›

Deploying My Blog to Google Cloud Run
I recently moved this blog off of a Kubernetes cluster and onto Cloud Run, Google's new container-based serverless environment. This article explores why serverless might make sense for a Jekyll-based static website like my blog, and walks through how to containerize a static site and deploy it to Cloud Run. Read More ›

Talk notes › Yes, you should provide a client library for your API! (RubyConf 2018)
On Nov 13, 2018, I spoke on "Yes, you should provide a client library for your API!" at RubyConf in Los Angeles, CA. The talk discussed the benefits of providing client libraries for HTTP-based APIs, and some techniques for writing them. Read More ›

Talk notes › Docker and OTP: Friends or Foes? (ElixirConf 2018)
On Sept 7, 2018, I spoke on "Docker and OTP: Friends or Foes?" at ElixirConf in Bellevue, WA. The talk discussed ideas for making OTP applications work together with container-based deployments. Read More ›

Talk notes › Containerizing Rails: Techniques, Pitfalls, and Best Practices (RailsConf 2018)
On April 18, 2018, I spoke on "Containerizing Rails: Techniques, Pitfalls, and Best Practices" at RailsConf in Pittsburgh, PA. The talk discussed best practices for designing Docker containers for Rails applications. Read More ›

Talk notes › Dispelling the Dark Magic: Inside a Ruby Debugger (RubyConf 2017)
On November 16, 2017, I spoke on "Dispelling the Dark Magic: Inside a Ruby Debugger" at RubyConf in New Orleans, LA. The talk demonstrated how to implement a simple debugger for Ruby applications, and covered some of the techniques used in the implementation of the Stackdriver Debugger for Ruby. Read More ›

Family Ties part 10: My type of language
This is the tenth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post covers records, the type system, and dialyzer support in both languages. Read More ›

Family Ties part 9: Curse of the Preprocessor
This is the ninth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post continues our coverage of the Erlang preprocessor, discussing how preprocessor features can be reproduced using Elixir. Read More ›

Family Ties part 8: Rise of the Preprocessor
This is the eighth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post covers the Erlang preprocessor, probably the most significant Erlang feature that is not supported by Elixir. Read More ›

Family Ties part 7: Lost and Found
This is the seventh of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post studies some of the "missing features" found in Erlang but omitted from Elixir, and how they can be reproduced in Elixir. Read More ›

Family Ties part 6: Being On Guard
This is the sixth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post compares guard clauses in the two languages, and uncovers some features known by Erlang developers but often overlooked in Elixir. Read More ›

Family Ties part 5: Exceptionally Similar
This is the fifth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post covers exception handling in both languages and how they relate. Read More ›

Family Ties part 4: Scoping Out the Scene
This is the fourth of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post discusses the differences in variable scoping in the two languages, comparing Elixir's caret operator with Erlang's single assignment, and exploring a few surprises in the scoping rules. Read More ›

Family Ties part 3: It's All In a Name
This is the third of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post discusses the naming conventions of Erlang and Elixir and how that affects interoperability. Read More ›

Family Ties part 2: A Tale of Three ASTs
This is the second of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. This post compares the Erlang and Elixir abstract syntax trees. Read More ›

Family Ties part 1: Comparing Erlang and Elixir
This is the first of a series of articles on what I've learned about Erlang (and Elixir) from writing an Erlang-to-Elixir transpiler. Read More ›

New Maintainer for RGeo
Today I'm naming Tee Parham as the new official maintainer of the GeoRails stack (rgeo, activerecord-postgis-adapter, and six other related gems). Read More ›

Talk notes › Humanity on Rails (RailsConf 2013)
On April 29, 2013, I gave a talk entitled "Humanity on Rails" at RailsConf in Portland, OR. The talk was a brief introduction to the philosophy of technology, targeted toward the Ruby and Rails developer community. Read More ›

Talk notes › Getting Down To Earth: Geospatial Analysis With Rails (RailsConf 2012)
In this post is a collection of useful material related to my RailsConf 2012 talk, entitled "Getting Down To Earth: Geospatial Analysis With Rails". You can download the slides for the talk, and I've provided links to all the software mentioned (as well as some that wasn't mentioned but that I think is useful or at least interesting). Finally, I've curated links to a bunch of articles, reference material, and other information for those interested in digging deeper into geospatial features. Read More ›

Geo-Rails Part 9: The PostGIS spatial_ref_sys Table and You
Part 9 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 8: ZCTA Lookup, A Worked Example
Part 8 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 7: Geometry vs. Geography, or, How I Learned To Stop Worrying And Love Projections
Part 7 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 6: Scaling Spatial Applications
Part 6 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 5: Spatial Data Formats
Part 5 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 4: Coordinate Systems and Projections
Part 4 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 3: Spatial Data Types with RGeo
Part 3 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 2: Setting Up a Geospatial Rails App
Part 2 of my series on geospatial application development using Ruby and Rails. Read More ›

Geo-Rails Part 1: A Call to Revolution
Part 1 of my series on geospatial application development using Ruby and Rails. Read More ›