Skip to content

Instantly share code, notes, and snippets.


Eric Goodwin ericgoodwin

View GitHub Profile
ericgoodwin / api_only_rails_example.rb
Created Dec 4, 2020 — forked from JoshCheek/api_only_rails_example.rb
How to configure API only Rails (esp how to deal with param parsing).
View api_only_rails_example.rb
# I submitted a bug report
# b/c Rails was not honouring my `rescue_from` block which was causing my API to
# be inconsistent. I was told this is expected behaviour. I think it's probably
# fine for an HTML app where you control the form inputs. But for an API app,
# the API is public facing and very important, so Rails shouldn't have its own
# special errors that bypass my app's configuration and make my API inconsistent.
# Decided it shouldn't be too difficult to handle this myself. So, here is my
# solution. It contains most of the important lessons I've learned about how to
# get a Rails API app setup. It removes Rails' params parsing and adds its own.
ericgoodwin / plug.conn.ex
Created Apr 14, 2020 — forked from jamonholmgren/plug.conn.ex
Typical Elixir Phoenix Plug.Conn struct contents, in an easy-to-read format. By Jamon Holmgren.
View plug.conn.ex
adapter: {Plug.Adapters.Cowboy.Conn, :...},
assigns: %{
my_assigns: "here"
before_send: [
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>,
#Function<1.127904613/1 in Plug.Session.before_send/2>,
#Function<1.43511252/1 in>,
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>
ericgoodwin / rabbitmq.rb
Created Aug 2, 2019
RabbitMQ Version 3.7.16 Homebrew Install
View rabbitmq.rb
class Rabbitmq < Formula
desc "Messaging broker"
homepage ""
url ""
sha256 "a34011f8ff1682a1601d4b8e0167ad39b91fd8f0fb35b484c41efde9f104ed08"
bottle :unneeded
depends_on "erlang"
ericgoodwin /
Created May 23, 2019 — forked from nepsilon/
Importing and Exporting CSV files with PostgreSQL — First published in issue #19

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.


Keybase proof

I hereby claim:

  • I am ericgoodwin on github.
  • I am goodwin ( on keybase.
  • I have a public key ASCU1RIneT2ncBlQIHVeGCYOUY647ekmq1WqJ5v99whbXQo

To claim this, I am signing this object:

View gist:129e16d7cde20d4424030cfe8ab96033
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Railscasts Extended/Railscasts Extended.tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,


cribbed from

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.


# Namespace for classes and modules that handle serving documentation over HTTP
View config-initializers-elasticsearch.rb
# Use a prefix for the index names that Tire uses so that the test suite doesn't
# stomp on dev data and you can work on multiple apps with ES, but keep tidy
# unadorned names for production.
unless Rails.env.production?