Skip to content

Instantly share code, notes, and snippets.

View beechnut's full-sized avatar

Matt Cloyd beechnut

  • 18F (work) + personal projects
  • Philadelphia, PA
View GitHub Profile
E, [2014-02-21T19:55:06.988850 #758] ERROR -- : Operation not permitted (Errno::EPERM)
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/worker.rb:146:in `initgroups'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/worker.rb:146:in `user'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:621:in `init_worker_process'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:647:in `worker_loop'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:521:in `spawn_missing_workers'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:532:in `maintain_worker_count'
/home/deployer/apps/staging.regionalindicators.org/shared/bundle/ruby
@beechnut
beechnut / hypermedia-review.md
Last active January 2, 2016 23:59
A "blow-by-blow" of my hypermedia-in-Rails work on beechnut/mfapi

I started with simple, concrete hypermedia for Objectives. For the collection I created a collection method, into which I passed the Objectives to create a collection+json object. For a single record, I loop through its associations with reflect_on_all_associations, and create links to all its associated objects.

I then moved this logic to ApplicationController and abstracted it for use with Indicators.

Namespaces in this hackery were a little tricky: self_link could theoretically mean either:

{"rel": "self", "href": "/path/to/self"}
/*
* A function that converts a PostGIS query into a GeoJSON object.
* Copyright (C) 2012 Samuel Giles <sam@sam-giles.co.uk>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,