Skip to content

Instantly share code, notes, and snippets.

View jdickey's full-sized avatar
💭
Open to possibilities. Enquire within.

Jeff Dickey jdickey

💭
Open to possibilities. Enquire within.
View GitHub Profile

SOLVED! (for an initial value of 'solved', anyway)

Thanks to @squirly's most helpful suggestions, I now have my work-in-progress Docker image up, running tests and serving HTTP requests. Thanks, Tyler! 👏

Ploughing down the list of previously-unknown unknowns is a highly reliable means of instilling a respectful wariness of the extent of that list for the properly-attentive n00b, in any endeavour. This is little different; questions remain, such as:

When Bundler bundles my app in the container, it gives me a warning that I should not run bundler as root which, to a guy who did a couple decades of Unix back in the day, seems blindingly obvious. I see the USER option on the run command (and for Dockerfiles); at least from a Dockerfile perspective, it seems a bit chicken-and-egg-like, yes? When I build the image, I should just RUN useradd (and passwd?) with appropriate environment variables for the usern

@jdickey
jdickey / 00-ActionController::InvalidAuthenticityToken headscratcher.md
Created November 12, 2015 05:04
Never-before-seen "ActionController::InvalidAuthenticityToken in UsersController#create"

This is relevant to an existing app after its most recent commit as of 11 November.

This most recent commit was to add bog-standard "current user" functionality to a Rails ApplicationController, in a manner identical (from the controller standpoint) to what has been done in numerous previous apps, successfully.

After making this change and seeing that all tests, including feature/integration tests, pass, an ActionController::InvalidAuthenticityToken in UsersController#create error was observed when running the app in the browser. (Tested in Chrome, FIrefox, Safari, and Vivaldi under OS X 10.11.)

"OK, you broke something", you reasonably say. Right, then; how come, when I revert to any previous commit that has the controller and form, I now get the exact same error running in the browser, when those never manifested before?

@jdickey
jdickey / HTML forms are fxxxing UGLY.html
Created October 22, 2015 04:36
Why nobody in his/her/its right mind willingly hand-crafts HTML anymore. And this is a *mild* example.
<!DOCTYPE html>
<html>
<head>
<title>
New POC
</title>
<meta http-equiv='Content-Type', content='text/html; charset=utf-8'>
<meta name='viewport', content='width=device-width; initial-scale=1.0'>
<link rel="stylesheet" media="all" href="/assets/greeter.self.css?body=1" />
@jdickey
jdickey / GnuPG Signature Transition 2015-09-29.md.asc
Created September 29, 2015 15:17
GNU Privacy Guard Signature Transition WEF 2015-09-29
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Tuesday 29 September 2015 23:11 SGT (GMT+8)
This is to serve notice that my GPG (GNU Privacy Guard) keys have changed with effect from today, Tuesday 29 September 2015, following my (revised) standard protocol for key expiration. My new keys will remain valid until 31 December 2015. I recommend that other users of GNU Privacy Guard enact such policies and keep revocation certificates for their current keys in offline storage, such as on a thumb drive that is labelled and physically secured separately from your system.
My old keys will continue to work for use in sending me secured messages until they expire tomorrow, Wednesday 30 September 2015 (and for verifying previously-signed messages thereafter); however, you should be using the new key. To anyone who has signed my old key, I’d greatly appreciate your signing the new one (after satisfying yourself of its provenance and legitimacy, of course).
This message is signed by
# Defines functions explicitly included in all view-helper modules in the
# application. Remember that these are globally visible within the application.
module ApplicationHelper
end
# Base class for all controllers in the application, Including additional code
# shared between all controllers that is not part of `ActionController::Base`.
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
@jdickey
jdickey / Adapted test_helper.rb
Last active September 27, 2015 12:56
Adapted test/test_helper.rb
# test/test_helper.rb
#
# Sets up the supporting environment for testing our Rails code using SimpleCov,
# Capybara, and others.
#
# ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### #
# SECTION 1 OF 6: Preamble. #
#
# We force the setting of the `RAILS_ENV` variable for the duration of our
@jdickey
jdickey / Sequel-adapted Rails 4.2.4 production.rb
Created September 26, 2015 08:32
Sequel-adapted Rails 4.2.4 config/environments/production.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
@jdickey
jdickey / Sequel-adapted Rails 4.2.4 development.rb
Created September 26, 2015 08:21
Sequel-adapted Rails 4.2.4 config/environments/development.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
@jdickey
jdickey / Sequel-adapted Rails 4.2.4 application.rb
Created September 26, 2015 08:16
Sequel-adapted Rails 4.2.4 config/application.rb
require File.expand_path('../boot', __FILE__)
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"