Dillon Hafer

Dillon Hafer

  • Posts
  • Projects
  • About
  • Dillon Hafer


  • Posts
  • Projects
  • About

  • github
  • e-mail
  • rss
  • linkedin

Posts

  • Check if a form is valid #javascript

    Jan 13, 2023
  • Sort array of numbers #javascript

    Jan 1, 2023
  • ActiveStorage direct upload subfolders #rails

    Nov 12, 2022
  • Test values of an array #javascript

    Oct 22, 2022
  • How to add hidden fields to button_to #rails

    Oct 21, 2022
  • Fill in hidden fields with Capybara #rails

    Oct 20, 2022
  • Access Exclusive locks block select statements #sql

    Oct 19, 2022
  • Add custom flash keys #rails

    Oct 5, 2022
  • Enforce TLS... except for health checks #rails

    Oct 3, 2022
  • Clone a specific git branch #git

    Aug 31, 2022
  • CSS target pseudo class #html-css

    Aug 21, 2022
  • ๐Ÿ“ง Change the delivery method of a mailer #rails

    Aug 19, 2022
  • Access last argument in a shell #command-line

    Aug 15, 2022
  • Reverse proxy tcp/udp with nginx #devops

    Aug 12, 2022
  • Pass request format to url_for #rails

    Jul 25, 2022
  • Invert a hash #ruby

    Jun 10, 2022
  • Split a string on the first occurrence #ruby

    May 5, 2022
  • Write a warning message to $stderr #ruby

    Apr 30, 2022
  • Listen for onfocus events on document #javascript

    Apr 28, 2022
  • Conditionally eager load relationships in graphql #ruby

    Apr 28, 2022
  • Set the id of the root document fragment #javascript

    Apr 26, 2022
  • Use an array with Rails' attribute API #rails

    Apr 25, 2022
  • Start multiple processes in dev env with bin/dev #rails

    Apr 25, 2022
  • Hash#transform_keys takes a hash #ruby

    Apr 24, 2022
  • Avoid time discrepancies when benchmarking #ruby

    Apr 22, 2022
  • Add primary key to table #sql

    Apr 16, 2022
  • Print unknown exceptions in PL/pgSQL #sql

    Apr 15, 2022
  • curl with a progress bar #command-line

    Apr 9, 2022
  • Rails::Application has a "console(&blk)" method #rails

    Apr 7, 2022
  • Use encrypted env vars with direnv #workflow

    Apr 6, 2022
  • Use + as a closure in Array reduce #swift

    Apr 6, 2022
  • Repeat a string in swift like ruby #swift

    Apr 2, 2022
  • Get size of terminal #ruby

    Apr 2, 2022
  • Prevent rails' file server from serving index.html #rails

    Mar 30, 2022
  • Implicit order column #rails

    Mar 29, 2022
  • Ignore ~/.psqlrc when using psql #sql

    Mar 26, 2022
  • Get database value of model instance #rails

    Mar 24, 2022
  • Array#first returns different classes based on arg #ruby

    Mar 23, 2022
  • Search in an array in PostgreSQL #sql

    Mar 14, 2022
  • Add element to beginning of array #swift

    Mar 14, 2022
  • Invoke procs with brackets #ruby

    Mar 11, 2022
  • Remove a line number with sed #workflow

    Mar 6, 2022
  • Add a gem to a specific group in a Gemfile #ruby

    Mar 4, 2022
  • Add TypeScript support to forms #javascript

    Feb 26, 2022
  • ActiveSupport has a presence method #rails

    Feb 25, 2022
  • Install latest version of ruby with asdf #workflow

    Feb 24, 2022
  • Reject blank input with graphql-ruby #ruby

    Feb 23, 2022
  • Only fk constraints may be altered in PostgreSQL #sql

    Feb 22, 2022
  • Check if string starts with character #sql

    Jan 27, 2022
  • Select first element from array_agg #sql

    Jan 19, 2022
  • Add global variables in typescript #javascript

    Jan 18, 2022
  • Values in Hash literals can be omitted in ruby 3.1 #ruby

    Dec 26, 2021
  • Control video playback with keyboard controls #swift

    Dec 26, 2021
  • Keep 5 most recent files in a directory #workflow

    Dec 23, 2021
  • Use created_at in Ecto #elixir

    Dec 19, 2021
  • Rename iTerm tab with a shell function #command-line

    Dec 13, 2021
  • Ruby Struct can use keyword arguments #ruby

    Dec 10, 2021
  • How to install sqlite3 on heroku #workflow

    Dec 9, 2021
  • URI::MailTo has an email regex #ruby

    Dec 7, 2021
  • Ruby #ruby

    Dec 2, 2021
  • Lowercase a string in Python ๐Ÿ #python

    Dec 1, 2021
  • CurrentAttributes.set takes a block #rails

    Nov 24, 2021
  • View last modified time of file #workflow

    Nov 8, 2021
  • Ruby has endless ranges #ruby

    Nov 6, 2021
  • Use react component prop in TypeScript #react

    Nov 4, 2021
  • Enable key repeat in VSCode #workflow

    Nov 3, 2021
  • Disable broken VSCode feature #workflow

    Oct 28, 2021
  • Increase size of ProgressView #swiftui

    Oct 24, 2021
  • Use older version of bundler #ruby

    Oct 17, 2021
  • Reset iOS permissions #workflow

    Oct 16, 2021
  • Split a string in elixir #elixir

    Oct 13, 2021
  • Replace first letter of string #go

    Oct 7, 2021
  • You MUST use a ws protocol in rails๐Ÿ’ฉactioncable #rails

    Sep 30, 2021
  • Ruby's ENV::[]= only accepts strings #ruby

    Sep 30, 2021
  • Custom RSpec negation matchers #rails

    Sep 29, 2021
  • Open a browser's Web Developer Tools with F12 #workflow

    Sep 25, 2021
  • Method names can have spaces #ruby

    Sep 24, 2021
  • Have OS specific implementations in golang #go

    Sep 24, 2021
  • Get the first n items from a slice #go

    Sep 23, 2021
  • Enable vim mode in Xcode 13 #vim

    Sep 21, 2021
  • Create a string with a null byte #go

    Sep 21, 2021
  • Pass keyword arguments when using send #ruby

    Sep 19, 2021
  • Ruby's Thread::Queue has a clear method #ruby

    Sep 17, 2021
  • String#๏ธโƒฃstart_with? "emoji" #ruby

    Sep 16, 2021
  • How to use ActiveRecored.pluck without Arel.sql #rails

    Sep 16, 2021
  • Encrypt a zip when archiving ๐Ÿค๐Ÿ” #workflow

    Sep 14, 2021
  • Rails has helpers for uploading spec fixture files #rails

    Sep 13, 2021
  • Store cURL response headers in a file #workflow

    Sep 7, 2021
  • Check if in transaction in rails #rails

    Sep 6, 2021
  • javascript concat returns a new array #javascript

    Aug 5, 2021
  • Choose n random elements from an array #ruby

    Jul 27, 2021
  • Add a folder to git with exceptions #git

    Jul 20, 2021
  • ruby string has a #ruby

    Jul 15, 2021
  • rspec should receive thrice #ruby

    Jul 15, 2021
  • Split text in postgres #sql

    Jul 12, 2021
  • Replace multiple characters in ruby strings #ruby

    Jul 12, 2021
  • Use meta keys with AppleScript #workflow

    Jul 7, 2021
  • List cli xcodebuild archives in Xcode's organizer #workflow

    Jul 7, 2021
  • How to set authorized_keys in EdgeRouter X #workflow

    Jul 6, 2021
  • Save without formatting in VSCode #workflow

    Jul 1, 2021
  • ๐Ÿšฏ Prevent development logs from bloating on macOS #workflow

    Mar 29, 2021
  • What directory is the parent of root ๐Ÿ‘จโ€๐Ÿ‘ฆ๐Ÿ“ #command-line

    Jan 27, 2021
  • prevent execution when creating materialized views #sql

    Dec 3, 2020
  • Ignore Array destructuring variables #javascript

    Nov 16, 2020
  • Copy remote file to local destination with Ansible #devops

    Sep 30, 2020
  • Fix poor type support in immutablejs #javascript

    Aug 9, 2020
  • Postgres Identity Column #sql

    Jul 20, 2020
  • pg_dump can dump foreign table schemas #sql

    Jun 17, 2020
  • ๐Ÿ”” Ring a bell with ruby #ruby

    Jun 4, 2020
  • Let Postgres generate constraint names #sql

    May 13, 2020
  • List files vertically with ls #command-line

    Feb 15, 2020
  • Quickly switch workspaces in VSCode #workflow

    Feb 14, 2020
  • Cache-control behavior for ReactNative's Image #react

    Feb 13, 2020
  • Expo PushNotifications with pop-ups on Android #react

    Feb 12, 2020
  • Prefetch images in ReactNative #react

    Feb 11, 2020
  • RN fetch on Android requires mime type #react

    Feb 10, 2020
  • Ecto queries can be combined #elixir

    Feb 9, 2020
  • Wildcard prefix matching with tsquery #sql

    Feb 8, 2020
  • ๐Ÿ’… styled-components limit prop names #react

    Feb 8, 2020
  • How to manually edit ufw rules #devops

    Feb 6, 2020
  • See git history of a renamed file #git

    Feb 5, 2020
  • How to typescript react native list refs #react

    Feb 4, 2020
  • How to redirect standard error #workflow

    Feb 3, 2020
  • How to remove stale remote-tracking branches #git

    Feb 2, 2020
  • How to only stage deleted files #git

    Feb 1, 2020
  • How to change the placeholder text color #html-css

    Jan 31, 2020
  • How to exclude files when using rm #workflow

    Jan 30, 2020
  • How to open the Settings App in ReactNative 0.60 #react

    Jan 29, 2020
  • Browsers have a Web Cryptography API #javascript

    Jan 28, 2020
  • How to remove unused go modules #go

    Jan 27, 2020
  • How to use VSCode's built-in markdown preview #workflow

    Jan 25, 2020
  • How to remove unused deps from mix.lock #elixir

    Jan 25, 2020
  • What a cursor is in postgres #sql

    Jan 24, 2020
  • How to change the request body size in Phoenix #elixir

    Jan 23, 2020
  • Ecto can only execute 1 sql statement at a time #elixir

    Jan 6, 2020
  • Convert .mov to .gif with ffmpeg #workflow

    Sep 4, 2019
  • Sort files by date with /bin/ls #workflow

    Aug 30, 2019
  • Tuples are never inferred in TypeScript #javascript

    Jul 7, 2019
  • Apollo-React hooks can easily refetch queries #react

    Jun 27, 2019
  • Push git branch to another machine #git

    Jun 18, 2019
  • How to remove NotificationCenter observer in Swift #workflow

    May 28, 2019
  • How to expose entire Swift class to Objective-C #workflow

    May 28, 2019
  • Open iOS simulator app data directory #workflow

    May 24, 2019
  • ๐Ÿ“† git reflog with timestamps #git

    Mar 21, 2019
  • Default values for Makefile vars #workflow

    Feb 22, 2019
  • ๐Ÿ” Using NSArray with CONTAINS NSPredicates #workflow

    Feb 19, 2019
  • ๐Ÿงฎ assert_difference with negative values #ruby

    Feb 6, 2019
  • HTML tag #html-css

    Jan 30, 2019
  • ๅ‹•็š„ใชใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใง #ruby

    Jan 24, 2019
  • character_length string function #sql

    Oct 10, 2018
  • Shell parameter expansion #workflow

    Oct 3, 2018
  • Use a unix socket with Ecto #elixir

    Sep 3, 2018
  • Client Connection Vars with Ecto #elixir

    Sep 3, 2018
  • ๐Ÿ›ฃpre-commit bypass #git

    Jul 31, 2018
  • NODE_OPTIONS without node #javascript

    Jun 26, 2018
  • Finds diffs in long line #git

    Apr 23, 2018
  • ๐Ÿ–ผ๐Ÿš Get image dimensions from a shell #command-line

    Apr 18, 2018
  • ๐Ÿ†™ Update macOS from cli #workflow

    Apr 5, 2018
  • gcc case ranges #objective-c

    Mar 19, 2018
  • ๐Ÿ”ข CLI to bump iOS target versions #mobile

    Mar 5, 2018
  • ๐Ÿ”‘ Set foreign keys to null #rails

    Feb 20, 2018
  • Toggle macOS dock with keyboard โŒจ๏ธ #workflow

    Feb 6, 2018
  • Reinstall Gemfile #ruby

    Jan 12, 2018
  • Custom Browser with Create React App #react

    Oct 27, 2017
  • Custom Port with Create React App #react

    Oct 12, 2017
  • Find host and port in development #rails

    May 29, 2017
  • Rails/PG Statement Timeout ๐Ÿ˜โฐ #ruby

    Apr 11, 2017
  • Update a specific gem with bundler #ruby

    Mar 30, 2017
  • group by 1, 2, 3 ๐Ÿ”ข #sql

    Feb 16, 2017
  • Open images in vim with iTerm ๐Ÿ–ผ #vim

    Dec 28, 2016
  • where am i @? #ruby

    Nov 24, 2016
  • Use PostgreSQL socket in database.yml ๐Ÿ˜๐Ÿ”Œ #rails

    Sep 12, 2016
  • Swap tmux panes #workflow

    Jul 14, 2016
  • Respect Do Not Track ๐Ÿ‘โ€๐Ÿ—จ #javascript

    Jul 9, 2016
  • Drop connections with Nginx #workflow

    Jul 9, 2016
  • ๐Ÿš Private Shell History #workflow

    Jul 8, 2016
  • Remove a shell function #command-line

    May 18, 2016
  • Verify TLS cert with private key #devops

    May 12, 2016
  • Chaining TLS Certificates ๐Ÿฑ #devops

    May 12, 2016
  • Let's Encrypt Cloudfront #workflow

    May 2, 2016
  • Trust Issues ๐Ÿค” #workflow

    Apr 29, 2016
  • Put -L in your ssh config #workflow

    Apr 4, 2016
  • Respect Do Not Track ๐Ÿ‘โ€๐Ÿ—จ #javascript

    Apr 2, 2016
  • Enable ScreenSharing from a terminal #command-line

    Mar 10, 2016
  • The Case of the Default ๐Ÿ•ต #swift

    Feb 23, 2016
  • -y apt-get? #devops

    Jan 22, 2016
  • Rails Sandbox ๐Ÿ– #rails

    Jan 19, 2016
  • Keep mina fast #devops

    Jan 1, 2016
  • Encrypt a zip archive #devops

    Dec 16, 2015
  • You have new mail. #workflow

    Sep 24, 2015
  • Use rsync with a custom port #devops

    Aug 28, 2015
  • Line Kill #command-line

    Aug 24, 2015
  • Limit SSH by IP address #devops

    Jun 17, 2015
  • Complex Fragment Caching with Rails #rails

    Feb 1, 2015
  • Full Text Search with PostgreSQL #sql

    Dec 8, 2014
  • Testing Subdomains with Capybara #rails

    Jul 22, 2013
  • ASP: Default to Dangerous #C#

    Apr 19, 2013