Skip to content

Instantly share code, notes, and snippets.

Pushing keys

Matthew Hutchinson matthutchinson

Pushing keys
View GitHub Profile
View gocardless_get_country_codes.rb
@companies = []
@company_ids = {}
GocardlessSettings.where.not(oauth_access_token: nil).all.each do |settings|
pro =
records = pro.send(:client)
codes =
if codes.present? && codes.uniq != ["GB"]
@companies << "Company ID: #{settings.company_id} #{codes.uniq.join(", ")}"
View .envrc
#!/usr/bin/env bash
set -e
# load default envrc
# auto-switch rubies
use chruby --auto
# node from ~/.nvmrc
View vim

Vim Help

Forgotten shortcuts and mappings

Insert Mode

Ctrl+w Delete word backwards Ctrl+n Ctrl+p Autocomplete word from next found forward or backward in file CTRL+xl Autocomplete entire line (must start with same chars) CTRL+xl Autocomplete to a local file path

View gist:4d5b7eb19508122fcca894b6f033c554
What is your FreeAgent email?
==> Google OAuth 2 Setup
error: Did not recognize your adapter specification (incompatible library version - /Users/matt/.gem/ruby/2.6.3/gems/json-2.2.0/lib/json/ext/parser.bundle).
Traceback (most recent call last):
33: from /Users/matt/.gem/ruby/2.6.3/bin/devkit:23:in `<main>'
32: from /Users/matt/.gem/ruby/2.6.3/bin/devkit:23:in `load'
31: from /Users/matt/.gem/ruby/2.6.3/gems/freeagent-devkit-6.11.0/bin/devkit:64:in `<top (required)>'
matthutchinson / fzf_migrations
Last active Jun 12, 2018
Run rails migration commands via aliases with auto-completion for version numbers (via fzf)
View fzf_migrations
# TDLR; run rails migration commands via aliases with auto-completion for version numbers (via fzf)
# brew install fzf
# curl > ~/.fzf_migrations
# source ~/.fzf_migrations
# Then run these commands to migrate:
View linked_list_with_stack_azat.rb
#!/usr/bin/env ruby
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node = nil)
@value = value
@next_node = next_node
View home_serializer.rb
class HomeSerializer < ApplicationSerializer
def _links
order_volume_forecasts: { href: order_volume_forecasts_url }
slots: { href: slots_url },
micro_contracts: { href: micro_contracts_url }
matthutchinson / archive
Last active Jul 27, 2016
clone github repos and zip them
View archive
filecontent=( `cat "repo_list" `)
for repo in "${filecontent[@]}"
echo $repo " - cloning ..."
git clone -q$repo

Keybase proof

I hereby claim:

  • I am matthutchinson on github.
  • I am matthutchinson ( on keybase.
  • I have a public key ASAlmD84I8ALwQE6E17On0NCEVtzMgPtq3ZgtwBtDvG1NAo

To claim this, I am signing this object:

View .vimrc
" set this first (avoid use of -N for vi compatibility)
set nocompatible
" tip, write file and fire command into a Tmux window
" :map ,t :w\|:Tmux xcodebuild -scheme videosnap build && /u/code/videosnap/build/products/Debug/videosnap -v<cr>
" :map ,t :w\|:call SendToTmux("ruby ".expand('%')."\n")<cr>
" or just write file, compile and run it (no Tmux)
" :map ,t :w\|:!gcc % -o ./string_reverser; ./string_reverser<CR>
" plugins via Plug -
You can’t perform that action at this time.