#Search Framework (Product)
DASHBOARDS
- User segment (e.g. new vs return)
- Mobile (mobile, iOS, android) vs. Desktop
- Metro vs. Suburb
- Service category performance deltas
- Search types breakdown
- General service (e.g. haircut)
| import asyncio | |
| import logging | |
| from pathlib import Path | |
| from urllib.parse import urlparse | |
| import click | |
| from playwright.async_api import async_playwright | |
| @click.command() | |
| @click.option("--url", default="https://nytimes.com", help="The URL to screenshot") |
| // use the built-in ios linguistics functionality to stem the tags | |
| + (NSMutableArray *)stemTags:(NSMutableArray*)originalTags { | |
| NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc] | |
| initWithTagSchemes:[NSArray arrayWithObjects:NSLinguisticTagSchemeLemma, nil] | |
| options:(NSLinguisticTaggerOmitWhitespace | NSLinguisticTaggerOmitPunctuation)]; | |
| NSMutableArray *stemmedTags = [[NSMutableArray alloc] init]; | |
| // convert tags to string | |
| [tagger setString:[originalTags componentsJoinedByString:@" "]]; |
| ### Install OpenJDK | |
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| ### Download and Install ElasticSearch | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb | |
| sudo dpkg -i elasticsearch-1.3.1.deb |
#Search Framework (Product)
DASHBOARDS
| =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') |
| # app/controllers/users/password_controller.rb | |
| class Users::PasswordsController < Devise::PasswordsController | |
| def resource_params | |
| params.require(:user).permit(:email, :password, :password_confirmation) | |
| end | |
| private :resource_params | |
| end |
| Backbone.Model::nestCollection = (attributeName, nestedCollection) -> | |
| #setup nested references | |
| for item, i in nestedCollection | |
| @attributes[attributeName][i] = nestedCollection.at(i).attributes | |
| #create empty arrays if none | |
| nestedCollection.bind 'add', (initiative) => | |
| if !@get(attributeName) | |
| @attributes[attributeName] = [] | |
| @get(attributeName).push(initiative.attributes) |
| module CustomDatabase | |
| extend ActiveSupport::Concern | |
| included do | |
| store_in database: custom_database | |
| end | |
| module ClassMethods | |
| def custom_database |
| http://www.agileweboperations.com/chef-rvm-ruby-enterprise-edition-as-default-ruby | |
| http://www.christophersamuelson.com/2010/10/22/chef-rvm-capistrano-bundler/ | |
| http://blog.ninjahideout.com/posts/a-guide-to-a-nginx-passenger-and-rvm-server | |
| http://brandontilley.com/2011/01/29/serving-rails-apps-with-rvm-nginx-unicorn-and-upstart.html | |
| http://brandontilley.com/2011/01/29/rvm-unicorn-and-upstart.html | |
| Chef workflow | |
| # Install cookbook from opscode community site. (Automatically commits to local repo) | |
| knife cookbook site install <COOKBOOK_NAME> |