Skip to content

Instantly share code, notes, and snippets.

nathan amick namick

Block or report user

Report or block namick

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
View gist:10389075
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAurZVJN2onopLd72rPy8P8Wv5rFZdDl3xD8vbHjTF1l7/cA99xK9GrB0gNCO/5CXD1ViK582BzyRPunVSs55tJnVHjKR+0WAfjnaxWF2swbrI/EGz0Y8yaSze4JBlRL89GQLTHCtNVRkut/BkxEadyTFT/l1tDlyz9H966t8clxR7WPTuGbmypvfZYGeGuhXc2agE+QJPy5ujza8a2wfuNaijhs4JcTxFOKu/+GtoUY3zUS2OS6o7of0Kw9nNoSa/dt6BIraOt9W8rtFVU4hS0ytVJ/jMhR9y9oe13ul6SUGTe5MxrzDP9fLm7fr4fBn4RBxXCpO/Ebp7y8xa0pYA0Q== namick@nv
View gist:44dca86721a071c2c988
def self.log_method_call(method_name)
original_method = instance_method(method_name)
define_method(method_name) do |*args, &block|
puts caller[3..5]
puts "-> #{self.inspect}##{method_name}(#{args.inspect})"
return_value = original_method.bind(self).call(*args, &block)
puts "<- #{self.inspect}##{method_name} #=> #{return_value.inspect}"
return_value
end
end
@namick
namick / spec_helper.rb
Created Jan 30, 2012
spec helper for plugin with dummy app
View spec_helper.rb
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require 'rspec/rails'
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@namick
namick / install-ruby
Last active Oct 20, 2015
Installs a good Ruby
View install-ruby
# The version of Ruby to be installed
ruby_ver="2.2.3"
# The base path to the Ruby
ruby_home="/usr/local"
# Enable truly non interactive apt-get installs
export DEBIAN_FRONTEND=noninteractive
apt-get update
@namick
namick / cowsay-inator.md
Created Mar 9, 2013
markdown shell script that installs cowsay
View cowsay-inator.md

Install cowsay and run it

This is a test shell script written in markdown

First, record what we want to say.

words_of_wisdom="Excellent, now we can run shell scripts written in markdown"

Lets install the cowsay app. Maybe we want to use the three backticks for multiple lines of code.

@namick
namick / id_rsa.pub
Created Mar 22, 2013
all your base are belong to us
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAurZVJN2onopLd72rPy8P8Wv5rFZdDl3xD8vbHjTF1l7/cA99xK9GrB0gNCO/5CXD1ViK582BzyRPunVSs55tJnVHjKR+0WAfjnaxWF2swbrI/EGz0Y8yaSze4JBlRL89GQLTHCtNVRkut/BkxEadyTFT/l1tDlyz9H966t8clxR7WPTuGbmypvfZYGeGuhXc2agE+QJPy5ujza8a2wfuNaijhs4JcTxFOKu/+GtoUY3zUS2OS6o7of0Kw9nNoSa/dt6BIraOt9W8rtFVU4hS0ytVJ/jMhR9y9oe13ul6SUGTe5MxrzDP9fLm7fr4fBn4RBxXCpO/Ebp7y8xa0pYA0Q== n8@nathanamick.com
@namick
namick / rbenv-inator.md
Created Mar 22, 2013
Install rbenv for ubuntu
View rbenv-inator.md

Clone the repo into a hidden home directory

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile

Add rbenv init to your shell to enable shims and autocompletion.

@namick
namick / resume.md
Created Mar 25, 2013
Relevant information for those who are considering employing me
View resume.md

Alternate Resume

Relevant information for those who are considering employing me.

If you like traditional looking resumes, check here.

What I do everyday

I code. Red, green, refactor. I love Vim, Ruby and Coffeescript.

@namick
namick / tech-screen.md
Created Mar 25, 2013
These are my responses to a tech screen questionnaire given to me recently.
View tech-screen.md

Q: What is Big O (time complexity) of finding an element in hash table?

O(1)

Q: What is Big O (time complexity) of sorting an array?

O(n log n)

I had to look up answers for these two questions. I now (hopefully) understand big O to be a notation used to estimate an algorithm's relationship between the size of its input and its performance (speed in this case but could also be used to estimate disk space or another resource).

View add-keys.sh
IFS="$(printf '\n\t')"
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
user=$1
keys=`curl https://api.github.com/users/$user/keys | grep -o -E "ssh-\w+\s+[^\"]+"`
You can’t perform that action at this time.