Skip to content

Instantly share code, notes, and snippets.

@frankolson
frankolson / ubuntu_setup_steps.md
Last active August 24, 2017 21:07
Steps I used to setup an Ubuntu 16.04 Rails dev machine.

Ubuntu 16.04 Rails Development Machine

Setup Ubuntu

  1. Ubuntu Image install
  2. OpenVPN + PIA install
  3. System Upgrade
  4. Enable Workspaces

Setup Rails

@frankolson
frankolson / Contract Killer 3.md
Last active June 26, 2017 20:53 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
@frankolson
frankolson / macOS_setup_steps.md
Last active June 1, 2018 20:49
Steps I used to setup an macOS 10.12 web development machine.

macOS 10.12 Web Development Machine

Show Library folder

$ chflags nohidden ~/Library

Show hidden files

Keybase proof

I hereby claim:

  • I am frankolson on github.
  • I am thinkolson (https://keybase.io/thinkolson) on keybase.
  • I have a public key ASCWbFZQkdhgoAle3mAEG-d6HcN_NWtByfW5_PGjB-nXUwo

To claim this, I am signing this object:

module MemoryLogger
def log_memory(&block)
begin
log_start
thread = create_memory_log_thread
yield
ensure
Thread.kill(thread)
log_finish
end
@frankolson
frankolson / linkedin_industries.rb
Created July 14, 2018 00:04
Grab the list of LinkedIn industries.
# Updated version of the following gist:
# https://gist.github.com/stevenzeiler/1895583
#
# list = Linkedin::IndustryList.new
# industry = list.industries.first
#
# industry.description
# => "Accounting"
#
# industry.code
@frankolson
frankolson / capybara_helpers.rb
Created October 27, 2018 01:01
Capybara helpers for the Trix Editor
# test/support/capybara_helpers.rb
def fill_in_trix_editor(id, with:)
find(:xpath, "//trix-editor[@input='#{id}']").click.set(with)
end
def find_trix_editor(id)
find(:xpath, "//*[@id='#{id}']", visible: false)
end
@frankolson
frankolson / articles.yml
Created October 27, 2018 01:02
Capybara/Trix Editor example fixtures
# test/fixtures/articles.yml
trix_capybara:
title: Testing the Trix Editor with Capybara
content: <div>We are going to learn some cool stuff!</div>
@frankolson
frankolson / test_helper.rb
Created October 27, 2018 01:03
Auto-load support files into your test helper
# test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
# Be sure to add this line to include all support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
@frankolson
frankolson / post_test.rb
Last active October 27, 2018 01:11
Capybara/Trix Editor example tests
# test/system/article/post_test.rb
require 'application_system_test_case'
class Articles::PostTest < ApplicationSystemTestCase
setup do
sign_in_as users(:will)
visit articles_path
end
test 'post a new article' do