start new:
tmux
start new with session name:
tmux new -s myname
| - content_for :head do | |
| = stylesheet_link_tag 'products_page.css' | |
| = stylesheet_link_tag 'product_page.css' | |
| %main.products-page | |
| .row | |
| - if params[:category_type].present? | |
| %ul.breadcrumbs.column | |
| %li | |
| %a{:href => "/"} Home | |
| %li |
| class ProductsController < ApplicationController | |
| def index | |
| products = Product.active.includes(:variants).paginate(page: params[:page], per_page: 15).order('created_at ASC') | |
| if params[:keyword].present? | |
| @products = Product.standard_search(params[:keyword]).paginate(page: params[:page], per_page: 15).order('created_at ASC') | |
| else | |
| product_types = nil | |
| if params[:product_type_id].present? && product_type = ProductType.find_by_id(params[:product_type_id]) |
| # == Schema Information | |
| # | |
| # Table name: products | |
| # | |
| # id :integer(4) not null, primary key | |
| # name :string(255) not null | |
| # description :text | |
| # product_keywords :text | |
| # product_type_id :integer(4) not null | |
| # prototype_id :integer(4) |
| export const addTodo = text => ({ type: types.ADD_TODO, text }) | |
| export const deleteTodo = id => ({ type: types.DELETE_TODO, id }) | |
| export const editTodo = (id, text) => ({ type: types.EDIT_TODO, id, text }) | |
| export const completeTodo = id => ({ type: types.COMPLETE_TODO, id }) | |
| export const completeAll = () => ({ type: types.COMPLETE_ALL }) | |
| export const clearCompleted = () => ({ type: types.CLEAR_COMPLETED }) |
| export default function todos(state = initialState, action) { | |
| switch (action.type) { | |
| case ADD_TODO: | |
| return [ | |
| ...state, | |
| { | |
| id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, | |
| completed: false, | |
| text: action.text | |
| } |
| /*------------------------------------------ | |
| 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: |