start new:
tmux
start new with session name:
tmux new -s myname
| require 'rest_client' | |
| require 'nokogiri' | |
| class FacebookLogin | |
| def initialize(username, password) | |
| @cookies = {} | |
| @payload = {email: username, pass: password} | |
| @headers = {'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'} | |
| # Define login flow | |
| @login_steps = [ |
| /*------------------------------------------ | |
| Responsive Grid Media Queries - 1280, 1024, 768, 480 | |
| 1280-1024 - desktop (default grid) | |
| 1024-768 - tablet landscape | |
| 768-480 - tablet | |
| 480-less - phone landscape & smaller | |
| --------------------------------------------*/ | |
| @media all and (min-width: 1024px) and (max-width: 1280px) { } | |
| @media all and (min-width: 768px) and (max-width: 1024px) { } |
| #Session controller provides a token | |
| #/controllers/api/sessions_controller.rb | |
| class Api::SessionsController < Devise::SessionsController | |
| before_filter :authenticate_user!, :except => [:create] | |
| before_filter :ensure_params_exist, :except => [:destroy] | |
| respond_to :json | |
| def create | |
| resource = User.find_for_database_authentication(:email => params[:user_login][:email]) | |
| return invalid_login_attempt unless resource |
| # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # @kyletcarlson | |
| # | |
| # This skeleton also assumes you're using the following gems: |
| #ack is a tool like grep, designed for programmers with large trees of heterogeneous source code | |
| #to install ack, see http://betterthangrep.com/ | |
| #to use ack, launch terminal (mac osx) and type 'ack <some_keywords>' | |
| #ack will search all files in the current directory & sub-directories | |
| #here's how I have my config file setup. this file is located on mac osx here | |
| # ~/.ackrc | |
| # Always sort the files |
In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.
| =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') |