knife cookbook site vendor -d ntp
Use chef-solo to launch ntp...
// 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 |
=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> |
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
sudo apt-get install nodejs | |
# install the Node package manager for later use | |
curl http://npmjs.org/install.sh | sudo sh | |
sudo npm install express | |
# clone the statsd project | |
git clone https://github.com/etsy/statsd.git | |
# download everything for graphite |
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |