This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
browser.get "/phones" # navigate to /phones URL | |
input.clear() # clear text input field | |
expect(browser.getTitle()).toMatch 'My Google Photo Gallery' | |
expect(browser.getCurrentUrl()).toMatch "/phones$" | |
# Find by... | |
# -------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8000; | |
server_name localhost; | |
root /Users/dmoore/projects/hotilinet/hotilinet-web; | |
access_log "/Users/dmoore/projects/hotilinet/hotilinet-web/logs/hotili-net.access.log"; | |
error_log "/Users/dmoore/projects/hotilinet/hotilinet-web/logs/hotilinet-web.error.log"; | |
error_page 404 /app/404.html; | |
error_page 403 /app/403.html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
error_log /usr/local/etc/nginx/logs/error.log debug; | |
events { | |
worker_connections 256; | |
} | |
http { | |
include mime.types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac OS X | |
# ============== | |
# Installation | |
$ brew update | |
$ brew doctor | |
$ brew install nginx | |
$ mkdir -p /usr/local/etc/nginx/sites-{enabled,available} | |
$ mkdir -p /usr/local/etc/nginx/logs | |
$ mkdir -p /usr/local/etc/nginx/conf.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Generate new rails api structure | |
# he "-S" options removes the sprockets stuff, we dont need it since we will use Grunt | |
# for our frontend code. "-T" is because I use RSpec and no need for "test/" directory | |
$ rails-api new [app_name]-S -T | |
2. Remove everything from | |
$ cd [app_name] | |
$ rm -fr public/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exports specified columns from doctors table to nplate_doctors.csv file | |
$ rails dbconsole | |
=# COPY doctors(customer_number,address_line_1,address_line_2,address_line_3,city,state,zip_code,primary_phone,prof_first_name,prof_middle_name,prof_last_name,prof_name_prefix,prof_name_suffix,primary_specialty,secondary_specialty,npi,ims,me,primary_specialty_dscr,latitude,longitude) TO '/Users/dmoore/projects/colddata-amgen/nplate_doc_finder/db/seeds/nplate_doctors.csv' DELIMITER ',' CSV HEADER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac OS X | |
# ========= | |
$ brew install | |
# To automatically load on login: | |
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist | |
# To refresh after upgrade: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A convinient way to stub out a current_user method if you are in the middle of development and don't want to add authentication yet: | |
class ApplicationController < ActionController::Base | |
... | |
def current_user | |
OpenStruct.new(admin?: false) | |
end | |
helper_method current_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:limit Numeric Type Column Size Max value | |
--------- ------------ ----------- ---------- | |
1 tinyint 1 byte 127 | |
2 smallint 2 bytes 32767 | |
3 mediumint 3 byte 8388607 | |
nil, 4, 11 int(11) 4 byte 2147483647 | |
5..8 bigint 8 byte 9223372036854775807 | |
Note: by default MySQL uses signed integers, so the max. values noted are for signed integers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails::API app | |
$ rails-api new [nplate-syjdata-api] --skip-sprockets --skip-test-unit | |
# Rails app | |
$ rails new [my-app-name] --skip-test-unit | |
$ rails generate controller PersonalityTests take results | |
$ rails g model Foo bar:string baz:integer | |
$ rails g migration AddWorkflowStateToGraduates workflow_state:string | |
$ rails g serializer doctor |