Skip to content

Instantly share code, notes, and snippets.

View ntreadway's full-sized avatar

Nick Treadway ntreadway

  • Yeti Media
  • Orange County, Ca
  • X @nicktea
View GitHub Profile
@ntreadway
ntreadway / setup.md
Last active February 22, 2018 10:24 — forked from aaronromeo/setup.md
Setting up Protractor tests for Ionic on CodeShip

Under Test Settings

'Select your technology to prepopulate basic commands' as Node.js

Setup Commands

# By default we use the Node.js version set in your package.json or the latest
# version from the 0.10 release
#
# You can use nvm to install any Node.js (or io.js) version you require.
@ntreadway
ntreadway / gist:6ebe205c84685ba070e61f8608a7fac5
Created June 3, 2016 00:17 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
source :rubygems
gem 'rake'
gem 'rack'
gem 'rack-rewrite'
gem 'thin'
gem 'sprockets', '2.2.0'
gem 'sass'
gem 'coffee-script'
@ntreadway
ntreadway / capybara-helpers.rb
Created April 20, 2012 23:46 — forked from jc00ke/capybara-helpers.rb
Capybara helpers
def set_mobile_agent
page.driver.header('User-Agent', 'iPhone')
end
def js_click(selector)
page.driver.execute_script "$('##{selector}').click()"
end
def screenshot
require 'capybara/util/save_and_open_page'
Given /^I visit subdomain "(.+)"$/ do |sub|
#host! "#{sub}.example.com" #for webrat
Capybara.default_host = "#{sub}.example.com" #for Rack::Test
Capybara.app_host = "http://#{sub}.example.com:9887" if Capybara.current_driver == :culerity
################################################################################
# As far as I know, you have to put all the {sub}.example.com entries that you're
# using in your /etc/hosts file for the Culerity tests. This didn't seem to be
# required for Rack::Test
################################################################################