Skip to content

Instantly share code, notes, and snippets.

💭
Open to possibilities. Enquire within.

Jeff Dickey jdickey

View GitHub Profile
@jdickey
jdickey / Token, token, who's got the token?.md
Last active Apr 8, 2019
An Exercise in Tail-Chasing, Punctuated by A Lesson in Humility
View Token, token, who's got the token?.md

tl;dr: Once again, being in a hurry will always slow you down. After forty years in this craft, the next counterexample I see will be the very first.

(See the bottom for an update.)

The reason that our token wasn't preserved from the ResetPassword::New action to the ResetPassword::Create action appears to be tied to the inconsistency with which that token is accessed throughout its journey.

Here's a URL fragment showing how the reset-password link might appear in an email sent to a Member:

https://conversagence.com/reset_password/new?token=YWZrbnRIbHBOeWVybU14ZVR6djBSN0F4
@jdickey
jdickey / gpg-transition-statement.txt
Last active Dec 30, 2018
GNU Privacy Guard (GPG/PGP) Key/Signature Transition Statement, with effect from Sunday 30 December 2018
View gpg-transition-statement.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Sunday 30 December 2018 20:50 SGT (GMT+8)
This is to serve notice that my GPG (GNU Privacy Guard) key has changed with
effect from today, Sunday 30 December 2018, following my (revised) standard
protocol for key expiration. My new key will expire on 31 December 2019. 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
@jdickey
jdickey / Build List of Gems to Satisfy a Gemfile.rb
Last active Nov 19, 2018
Want to be able to pull down all the Gems for a project so you can use 'bundle install --local'? Here's how
View Build List of Gems to Satisfy a Gemfile.rb
# ENV['TZ'] needs to be set for Time#ctime to work properly. Adjust as needed.
ENV['TZ'] = 'Asia/Singapore'
def deps_for(name)
version = Gem.latest_version_for(name)
dep = Gem::Dependency.new name, version
deps = Array(Gem.latest_spec_for(name.to_s).dependencies)
deps = [dep] + deps.reject { |gem| gem.type == :development }
deps.flatten.sort
View Response to Quora question on Ruby multiple inheritance.md

Consider the following:

module Foo
  def a
    puts "Foo#a"
  end

  def b(*args, **opts)
    puts "Foo#b, args=#{args.inspect}\topts=#{opts.inspect}"
@jdickey
jdickey / 00-Capybara-Selenium-Docker-confusion-RESOLVED__readme.md
Last active Oct 12, 2018
FIXED: Capybara+Selenium+Docker(+DatabaseCleaner) led to abject confusion
View 00-Capybara-Selenium-Docker-confusion-RESOLVED__readme.md

We fixed the problem, in a highly unexpected way. Below is the text (excluding static-analysis report boilerplate) of the commit we've just pushed to our project repo. Thanks for the helpful comments from all, particularly /u/nyekks on Reddit.

Fix the Selenium prob that wasn't a Selenium prob

It's been a long road, getting from there to here...

We'd been chasing our tail for days, never mind how many, trying to figure out why our Selenium JavaScript tests were apparently breaking Docker. Eventually, we posted pleas for help on Reddit, StackOverFlow, and Gitter; all variations of (and referencing) this Gist.

Turns out the problem wasn't (wholly) with Selenium, Capybara, Docker, and/or the interaction between the three. @mitpaladin eventually discovered a randomisation seed (15474) that, when specified via a TESTOPTS environment variable passed to Rake in `script

@jdickey
jdickey / My standard issue and PR labels for GitHub projects.md
Created Aug 29, 2018
My standard issue and PR labels for GitHub projects
View My standard issue and PR labels for GitHub projects.md

After copying these from repo to repo for lo! these many projects, I decided to create a Single Source of Truth for project labels going forward.

These are an expansion of and, in a couple of cases, a slight modification of, the standard labels that GitHub creates for each new repo (and they themselves update from time to time). Particularly, I

  • draw a distinction between a feature (new functionality not previously extant in a project) and an enhancement to an existing feature; and
  • include a non-empty Description for each label. GitHub have recently changed their project defaults to do this, but older projects don't have that, even for "standard" labels;
  • add generic tooling and vendor labels, as well as labels for docker and hanami as examples of tool-specific labels used in multiple projects. If a new project will never use Hanami or Docker, then I may not add the label to that project, and I may then add other, appropriate, tool-specific labels instead (e.g., for react in a
@jdickey
jdickey / GnuPG Signature Transition 2018-07-01.txt
Created Jun 30, 2018
GnuPG Signature Transition 2018-07-01.txt
View GnuPG Signature Transition 2018-07-01.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Sunday 1 July 2018 00:50 SGT (GMT+8)
This is to serve notice that my GPG (GNU Privacy Guard) key has changed with effect from today, Sunday 1 July 2018, following my (revised) standard protocol for key expiration. My new key will remain valid until 1 January 2019. 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 their systems.
@jdickey
jdickey / .env.development
Created Feb 27, 2018
Sample .env.development and docker-compose.yml file for Hanami in development mode using Docker
View .env.development
# Define ENV variables for development environment
DATABASE_URL='postgres://postgres:@db:5432/yourapp_development'
SERVE_STATIC_ASSETS="true"
WEB_SESSIONS_SECRET="d31b874186058eb00e17d9cde98e3745408b10666112a401a05a0d7ab392d30c"
@jdickey
jdickey / semi-automatic-droplet-setup.sh
Last active Feb 20, 2018
Semi-automatic setup of Docker-running Droplet from within Droplet itself.
View semi-automatic-droplet-setup.sh
# Semi-automatic setup of Docker-running Droplet from within Droplet itself
#
# Last updated 2017-01-19 at 14:50 (SGT; GMT+8) by @jdickey
#
# ##### Section 1 of 10: Variables used within this script. #####
#
# **NOTE** that several of these **must** be changed, namely
# * DOCKER_PASSWD
# * DOCKER_USER
# * GITHUB_USER
You can’t perform that action at this time.