Integrating FileMaker’s Data API and Ruby with the fmrest-ruby gem

We often work on projects that intersect two technologies near and dear to us: FileMaker and Ruby. This allows us to build robust web applications in Ruby on Rails, integrated with data sources from FileMaker solutions. When Claris introduced the FileMaker Data API we were naturally curious to try it out. At the time there was no off-the-shelf Ruby library for us to simply gem install, so we decided to roll up our sleeves and build one. Thus, fmrest-ruby was born.

This article will walk you through setting up and using fmrest-ruby in a Ruby on Rails project. Some level of familiarity with Ruby/Rails and FileMaker’s Data API is advised, although much of the content covered here is applicable to any Ruby project, Rails or not.

Continue reading “Integrating FileMaker’s Data API and Ruby with the fmrest-ruby gem”

Ruby’s Safe Navigation Operator &. and is it a Code Smell?

What is &.?

Ruby devs are probably all too familiar with seeing this error:

NoMethodError (undefined method `foo' for nil:NilClass)

Most of the time, it’s probably due to a typo, but every now and then we end up having to do something like:

defined?(bar) && bar.foo
# returns nil if bar is nil

If you’re on Rails, or are using ActiveSupport, you can use present? or try():

Continue reading “Ruby’s Safe Navigation Operator &. and is it a Code Smell?”

Writing a Markdown Compiler – Part 3

Have you ever wanted to make your own programming language? Maybe a template engine? A JSON parser? If you have ever built any of those, you might have noticed it’s not exactly easy to get started. We’d like to help with that.

Welcome to Part 3, the final in this series on Writing a Markdown Compiler!
Continue reading “Writing a Markdown Compiler – Part 3”

Writing a Markdown Compiler – Part 1

Have you ever wanted to make your own programming language? Maybe a template engine? A JSON parser? If you have ever built any of those, you might have noticed it’s not exactly easy to get started. There are a lot of concepts to digest before you get going. That’s why lots of devs just give up. We’d like to help with that.

Continue reading “Writing a Markdown Compiler – Part 1”

Avoid nil-checks. Code confidently. Be happy.

This post is about pretty code (with examples in Ruby), plus how to get nil out of the way and be more confident.

Does this code look familiar?

user && user.ask_for_email

Continue reading “Avoid nil-checks. Code confidently. Be happy.”

What is Dependency Injection

If you are a developer, chances are very good that you know what Object-Oriented (OO) code is. You might have also heard about OO Design Patterns, things like single responsibilities, decoupled code, and my subject here: Dependency Injection (DI).

Continue reading “What is Dependency Injection”

A Web Developer’s OS

What must an Operating System do to satisfy web developers’ needs? This is a tricky question, as each person is a whole different world, so it’s impossible to have a single answer to satisfy every person.

Continue reading “A Web Developer’s OS”

Ruby scripting in FileMaker

[Authored by Alex G]

There are many cases where FileMaker’s scripting isn’t always the best tool for the job and where a language like Ruby can bring a lot of power to your FileMaker development. The following is a description of a simple technique for using ruby scripts from within a FileMaker solution without the use of a plugin. I’ve found this technique useful for employing regular expressions for complex text parsing, making web requests to work with web APIs, and for parsing and generating XML and other serialized data structures. Ruby has a wealth of great libraries for doing anything you can imagine and is just plain fun to write.

Continue reading “Ruby scripting in FileMaker”

Never write a render_foo method again

[Authored by Ian]

I’ve probably written a hundred render_not_found methods in my life as a Rails dev. Usually they just render a static file under /public, and maybe, if I’m feeling nice, give an XML response. No more!

Continue reading “Never write a render_foo method again”

Setting the Commit Author to Pair Programmers’ Names in Git

[Authored by Sam]

In beezwax’s webdev division we generally work in pairs, but our commit logs didn’t used to show this. We wouldn’t bother to reconfigure the git author every time we sat down with a new pair so our git log only recorded one of the programmers’ names. Bryan Helmcamp has a nice script for setting your git commit author in pair programming situations. Here’s another one which works interactively.

Continue reading “Setting the Commit Author to Pair Programmers’ Names in Git”

Remote Pair Programming: Part II: Sharing the server

[Authored by Sam]

[01/04/15 – Editor’s note: This post was written in 2008. In 2015 we don’t use this “reverse ssh tunnel” method much anymore, but the technique is still interesting.]

In my last post I described how to use reverse ssh tunnels and screen -x to setup a remote pair programming environment.

Continue reading “Remote Pair Programming: Part II: Sharing the server”