Get a VPS that offers 2 or more IP addresses.
From the WHM cPanel, find the menu item Service Configuration
, select Apache Configuration
and then click on Reserved IPs Editor
.
# Change the port if you’re not using 22 (you probably shouldn’t) and change the remote.address. | |
ssh -L5984:127.0.0.1:5984 -p 22 -i ~/.ssh/id_rsa me@remote.address |
=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') |
# extension for string class | |
class String | |
# return character array of string with indices | |
def each_char_with_index | |
i = 0 | |
split(//).each do |c| | |
yield i, c | |
i += 1 | |
end | |
end |
#!/bin/bash | |
APP_NAME="your-app-name-goes-here" | |
APP_PATH=/home/deploy/${APP_NAME} | |
# Production environment | |
export RAILS_ENV="production" | |
# This loads RVM into a shell session. Uncomment if you're using RVM system wide. | |
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" |
/*! | |
* JavaScript - loadGoogleMaps( version, apiKey, language ) | |
* | |
* - Load Google Maps API using jQuery Deferred. | |
* Useful if you want to only load the Google Maps API on-demand. | |
* - Requires jQuery 1.5 | |
* | |
* Copyright (c) 2011 Glenn Baker | |
* Dual licensed under the MIT and GPL licenses. | |
*/ |
A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".
Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.
The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var rotate = Ti.UI.create2DMatrix().rotate(90); | |
var counterRotate = rotate.rotate(-180); | |
var scrollView = Titanium.UI.createScrollableView({ | |
views:[ | |
Titanium.UI.createImageView({ image:'default_app_logo.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_ui.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_views.png', transform: counterRotate }) |
#!/usr/bin/env bash | |
# call like this on the target server: | |
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='git@example.com:repo.git' bash <( curl -L https://raw.github.com/gist/1026628 ) | |
# You will need to ensure that the ssh key is already set up on the server. | |
set -e | |
export CHEF_DIR="${HOME}/chef" | |
sudo rm -rf $CHEF_DIR | |
mkdir -p "$CHEF_DIR" |
#!/bin/bash | |
APP_NAME="your-app-name-goes-here" | |
APP_PATH=/home/deploy/${APP_NAME} | |
# Production environment | |
export RAILS_ENV="production" | |
# This loads RVM into a shell session. Uncomment if you're using RVM system wide. | |
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" |