Skip to content

Instantly share code, notes, and snippets.

👾
Pushing keys

Matthew Hutchinson matthutchinson

👾
Pushing keys
Block or report user

Report or block matthutchinson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthutchinson
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
#!/bin/bash
# TDLR; run rails migration commands via aliases with auto-completion for version numbers (via fzf)
#
# brew install fzf
# curl https://gist.githubusercontent.com/matthutchinson/6c1bc7681b323d4d2ef5d5a55626a5cf/raw/fzf_migrations > ~/.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
end
end
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 }
}
end
end
@matthutchinson
matthutchinson / archive
Last active Jul 27, 2016
clone github repos and zip them
View archive
#!/bin/bash
filecontent=( `cat "repo_list" `)
for repo in "${filecontent[@]}"
do
echo $repo " - cloning ..."
git clone -q git@github.com:$repo
done
View keybase.md

Keybase proof

I hereby claim:

  • I am matthutchinson on github.
  • I am matthutchinson (https://keybase.io/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 - https://github.com/junegunn/vim-plug
View gist:a876f5b246c12a5d9c66
119006,15849,364397,"",""
287931,25665,1615619,"",""
249087,36798,1421176,"",""
131271,48647,1489200,"",""
207525,53651,1489200,"",""
207556,53812,1489200,"",""
207424,54991,1489200,"",""
243232,55069,1489200,"",""
182615,56985,1489200,"",""
92903,0,20326,"",""
@matthutchinson
matthutchinson / github-key.rb
Last active Feb 17, 2016
Send your SSH key to GitHub, with optional OTP auth
View github-key.rb
# install gems with;
# gem install io-console github_api --no-ri --no-rdoc
require 'github_api'
require 'io/console'
# Bypass annoying deprecation warning between the
# github_api gem and the faraday gem
Faraday::Builder = Faraday::RackBuilder
View deck.rb
#!/usr/bin/env ruby
class Card
attr_accessor :rank, :suit
def initialize(rank, suit)
self.rank = rank
self.suit = suit
end
@matthutchinson
matthutchinson / thx.sh
Last active Aug 29, 2015
THX startup sound :)
View thx.sh
# brew install sox
echo '(play -q -n synth sine F2 sine C3 remix - fade 0 4 .1 norm -4 bend 0.5,2399,2 fade 0 4.0 0.5 &)' >> ~/.bash_profile
# via https://twitter.com/climagic/status/467322823631831040
You can’t perform that action at this time.