At my job, we’re working on revamping the global ID system we use for GraphQL. Here are a few lessons I’ve learned through my participation in the project.
I recently re-skimmed Lesslie Newbigin’s The Gospel in a Pluralist Society. Although I was looking for a later chapter, “The Congregation as the Hermeneutic of the Gospel,” I was most struck by the chapter “The Logic of Mission.” What follows is a summary and personal interpretation.
About a year ago, we migrated an old rate limiter to Redis. In the end, it worked out great, but we learned some lessons along the way.
GraphQL-Ruby 1.12 ships with a new
GraphQL::Dataloader feature for batch-loading data.
2020 turned out to be a great year for books.
I thought I’d try to remember what I read last year.
Some notes on a refactor implemented with a Cop.
Did you know that calling
return in one Ruby method could affect the flow of another method? I discovered it today while hunting a GraphQL-Ruby bugfix. You can get more reliable behavior with
ensure, if it’s appropriate.
Yesterday I excitedly recommended to a friend that he try making some yogurt at home. Then I realized that my personal recipe is a bit of a hodge-podge, so I thought I’d try writing it out.
GraphQL-Ruby 1.9.0 introduces a new runtime called
GraphQL::Execution::Interpreter. It offers better performance and some new features.
I just finished reading E.F. Schumacher’s Small Is Beautiful: A Study of Economics As If People Mattered, so I thought I’d jot down a few impressions before I forgot them.
Ruby has a few different kinds of variables, and Ripper expresses them with a few different nodes.
GraphQL 1.8.0 was designed and built largely as a part of my work at GitHub. Besides designing the new Schema definition API, I migrated our codebase to use it. Here are some field notes from my migration.
1.8.0 will have a new class-based API for defining your schema. Let’s investigate the design choices in the new API.
This fall, several people presented their work on Ruby type checkers. So let’s take a look: what’s the big deal, and what have they been up to?
You can tell Ruby on Rails to respond to changes in certain files during development.
GraphQL 1.5.0 includes a new way to define a schema: from a GraphQL definition.
One way to keep an eye on your GraphQL schema is to check the definition into source control.
graphql-ruby 1.5.0 will be released. Query execution will be ~70% faster than 1.3.0!
It’s possible to get IO operations running in parallel with the
graphql-ruby is almost two years old! Today, I’m adding a new element to the project,
In general, raising exceptions for control flow makes code hard to understand. However, there are other cases when an exception is the right choice.
State machines are applied to a wide variety of programming problems. I found it useful to think of a GraphQL query as a state machine.
I read that
Hash#key? was slower than
Hash# and it made me sad because, shouldn’t
Hash#key? generally require less work?
css_modules provides an approach to styling UI components in a local-first way.
I just got back from RubyConf Colombia. The content was great, the community was great, and the venue was great!
Specialising Dynamic Techniques for Implementing the Ruby Programming Language (“Specializing Ruby”) is approachable and enjoyable (despite being a PhD thesis 😝).
When reviewing issues for
Elixir modules offer some valuable insight into designing Ruby classes.
This question is too hard. Instead, ask, “how many behaviors per test case?” and answer, “one.”
The Crystal programming language combines Ruby-like syntax with a really powerful compiler. As a result, it’s fun to write, fast to run, and hard to screw up!
The Christian practice of communion is a reminder of why Jesus is important and how his life affects us. To see the full depth of it, you have to consider pre-Christian religion.
A GraphQL system works differently from a “traditional” RESTful JSON API. Instead of authenticating during controller actions, you can authenticate users with “query context.”
I had leftover whey after making yogurt, so I made ginger ale.
This weekend I tried making yogurt. It worked!
Pat Shaughnessy’s “Using a Ruby Class to Write Functional Code” gives an example of bringing functional programming principles into object-oriented design. I like it.
Ruby on Rails models tend to grow and grow. When refactoring scopes, it turns out you can move them into their own classes.
While adding a big feature to PCO Check-Ins, I was struck with this way of describing my approach to adding complexity to the system.
To resolve a bug, a developer must know the behavior and the purpose of the program at hand. I’ve been reading Lesslie Newbingin and it made me think of this.
ActionController::Base once, in
ApplicationController, is a great Ruby on Rails practice. However, if
ApplicationController is your only abstract controller, it’s likely to become a maintenance challenge. To avoid this, you should extend
ApplicationController as needed and move as much code as possible into its subclasses.
You can use C code to prepare methods for mruby scripts.
mruby is an implementation of Ruby that’s designed to be lightweight & integrated with C. To get started, you can run a bit of Ruby code from inside C code.
Sadly, PCO is getting out of the batman.js game.
I was just pondering whether a person ought to have children or not. It’s funny when I try to be the judge.
Batman.js is a front-end MVC framework with an unrivaled implementation of key-value observing. I will explore computed properties in batman.js by contrasting them with Ember.js’s computed properties.
In batman.js, event handlers respond to user interactions like “click” and “submit”. You can use them to modify application state in response to those interactions.
Model::transaction provides a deep-copied, “shadow-realm” version of a record which is great for rendering into edit forms. Any changes made to it can be saved (which updates the original record too), or just forgotten.
Batman.js is a CoffeeScript front-end MVC framework. One of its core features is accessors, which can be used like properties or methods of a
Batman.Object. They can even take arguments!
Batman.js doesn’t support
hasManyThrough out of the box, but it can be implemented fairly easily with
Batman.Request sends data as HTTP form data. However, you can override this with
In batman.js, properties automatically track their sources. This is done by tracking all calls to
get when an accessor function is executed.
You can use batman.js with any backend!
Batman.Model has a
lifecycle object that fires events on the record when it’s being dirtied, cleaned, loaded, saved or destroyed.
Just a few things I’ve picked up about
Living a day at a time sounds a bit like lazy enumeration.
When working on HTML for
Batman.Views, it can be annoying to refresh and navigate back to wherever you were. Hacking into
Batman.HTMLStore enables you to reload HTML without refreshing
Need to add a header to an ActiveResource request? If you need to do it at dynamically at request-time, redefine
Debugging can be tedious, especially when
cntl-R is your only resort for trying new options. Instead, use batman.js’s
$context function to access the context of a specific node.
My involvement with a Google App Engine-based project is winding down, so I’ll share what I’ve learned.
I learned this the hard way, so I thought I’d share.
Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from our new home!
Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from Gila Bend, AZ!
Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from Austin, TX!
Google App Engine’s
dev_appserver prevents filesystem writes because GAE has no filesystem – but sometimes you want to write anyways!
On Google App Engine, I had to display the user-submitted image, if there was one, else display a default image.