mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.confto/usr/local/etc/nginx/defaultanddefault-sslto/usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plistto/Library/LaunchDaemons/
| -- Crash Report log information -------------------------------------------- | |
| See Crash Report log file under the one of following: | |
| * ~/Library/Logs/CrashReporter | |
| * /Library/Logs/CrashReporter | |
| * ~/Library/Logs/DiagnosticReports | |
| * /Library/Logs/DiagnosticReports | |
| for more details. | |
| -- Control frame information ----------------------------------------------- | |
| c:0025 p:-17578920525412 s:0096 e:000095 TOP [FINISH] |
| class Question < ActiveRecord::Base | |
| include Votable | |
| default_scope { order(created_at: :desc) } | |
| belongs_to :user | |
| has_many :answers, dependent: :destroy | |
| has_many :attachments, as: :attachable, dependent: :destroy | |
| has_many :comments, as: :commentable, dependent: :destroy |
| ThinkingSphinx::Index.define :question, with: :active_record, delta: true do | |
| #fields | |
| indexes title, sortable: true | |
| indexes body | |
| indexes user.username, as: :author, sortable: true | |
| #attributes | |
| has created_at, updated_at, votes_sum | |
| end |
| # paths | |
| app_path = "/home/deployer/qna" | |
| working_directory "#{app_path}/current" | |
| pid "#{app_path}/current/tmp/pids/unicorn.pid" | |
| # listen | |
| listen "/tmp/unicorn.qna.sock", :backlog => 64 | |
| # logging | |
| stderr_path "log/unicorn.stderr.log" |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script> | |
| </head> | |
| <body> |
| require 'rspec' | |
| module Authenticable | |
| def current_user | |
| @current_user ||= 'Pedro' | |
| end | |
| def authenticate_with_token! | |
| render json: { errors: "Not authenticated" }, | |
| status: :unauthorized unless user_signed_in? |
| require 'restclient' | |
| # RestClient logs using << which isn't supported by the Rails logger, | |
| # so wrap it up with a little proxy object. | |
| RestClient.log = | |
| Object.new.tap do |proxy| | |
| def proxy.<<(message) | |
| Rails.logger.info message | |
| end | |
| end |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf to /usr/local/etc/nginx/default and default-ssl to /usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plist to /Library/LaunchDaemons/| require 'rubygems' | |
| require 'bundler' | |
| require 'pathname' | |
| require 'logger' | |
| require 'fileutils' | |
| Bundler.require | |
| ROOT = Pathname(File.dirname(__FILE__)) | |
| LOGGER = Logger.new(STDOUT) |