Robert Mosolgo

Blog Archive

2021

Lesslie Newbigin's Logic of Mission

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.

GraphQL Dataloader

GraphQL-Ruby 1.12 ships with a new GraphQL::Dataloader feature for batch-loading data.

2020

2019

Breaking out of a yield with return

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.

How I Make Yogurt

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.

A New Runtime in GraphQL-Ruby 1.9

GraphQL-Ruby 1.9.0 introduces a new runtime called GraphQL::Execution::Interpreter. It offers better performance and some new features.

2018

How Ripper parses variables

Ruby has a few different kinds of variables, and Ripper expresses them with a few different nodes.

Why a New Schema Definition API?

GraphQL-Ruby 1.8.0 will have a new class-based API for defining your schema. Let’s investigate the design choices in the new API.

2017

Ruby Type Checking Roundup

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?

Optimizing GraphQL-Ruby

Soon, graphql-ruby 1.5.0 will be released. Query execution will be ~70% faster than 1.3.0!

2016

GraphQL Query as a State Machine

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.

Hash#key? vs Hash#[]

I read that Hash#key? was slower than Hash#[] and it made me sad because, shouldn’t Hash#key? generally require less work?

Finding a Browser-Ready File for Sprockets

I like using Sprockets, but sometimes it’s hard to find a file to include in the asset pipeline. Here are some methods I use to find browser-ready JavaScript files.

How I Use Sprockets

When reviewing issues for react-rails, I see many questions about how to gather JavaScript dependencies with Sprockets. Here is how I use Sprockets to manage JavaScript dependencies.

Using GraphQL without Relay

Although Relay made GraphQL famous, GraphQL was in use at Facebook for years before Relay took the scene. You can use plain AJAX requests to interact with a GraphQL server, too.

2015

Communion as "Bread from Heaven"

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.

Authorization in GraphQL

A GraphQL system works differently from a “traditional” RESTful JSON API. Instead of authenticating during controller actions, you can authenticate users with “query context.”

Making Yogurt

This weekend I tried making yogurt. It worked!

Happy Refactoring by Keeping ApplicationController to a Minimum

Extending 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.

2014

"Hello World" with mruby

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.

Being the Judge

I was just pondering whether a person ought to have children or not. It’s funny when I try to be the judge.

Computed Properties: Batman.js and Ember.js

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.

Event Handlers in Batman.js

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 Transactions in Batman.js

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 Accessors as Methods

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.Model Lifecycle Callbacks

A Batman.Model has a lifecycle object that fires events on the record when it’s being dirtied, cleaned, loaded, saved or destroyed.

Reload HTML for Batman.Views

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

Debugging Keypaths in Batman.js Views

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.

2013

Roadtrip part 3

Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from our new home!

Roadtrip Part 2

Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from Gila Bend, AZ!

Roadtrip part 1

Valerie and I are on the way from Charlottesville, VA, to Carlsbad, CA. Here’s an update from Austin, TX!