View unicorn_init.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $network $remote_fs $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts the unicorn app server
# Description: Starts unicorn using start-stop-daemon
View unicorn_conf.rb
# Configuration file for Unicorn
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete documentation.
# See also http://unicorn.bogomips.org/examples/unicorn.conf.rb for a more verbose configuration using more features.
app_name = "appname"
root = "/home/deployer/apps/#{app_name}"
current_root = "#{root}/current"
# Help ensure your application will always spawn in the symlinked "current" directory
View nginx.conf
# use the socket we configured in our unicorn.rb
upstream unicorn_appname {
server unix:/tmp/unicorn.appname.sock fail_timeout=0;
}
server {
listen 80;
server_name domain;
root /home/deployer/apps/appname/current/public;
try_files $uri/index.html $uri @unicorn_appname;
View selectize.sh
#!/bin/bash
# Checkout vendor repo
echo "Cloning brianreavis/selectize.js github repo into tmp_vendor"
git clone https://github.com/brianreavis/selectize.js.git tmp_vendor
# Copy files
echo "Copying selectize.js"
mkdir -p app/assets/javascripts/vendor/selectize/
cp tmp_vendor/dist/js/standalone/selectize.js app/assets/javascripts/vendor/selectize/selectize.js
View nginx_php_cache.conf
server {
server_name domain;
rewrite ^/(.*) http://www.domain/$1 permanent;
access_log /dev/null;
error_log /dev/null;
}
server {
server_name www.domain;
root /home/deployer/apps/appname/current;
View php_init.sh
#!/bin/bash
# https://www.linode.com/docs/websites/nginx/nginx-and-phpfastcgi-on-ubuntu-10-04-lts-lucid
PHP_SCRIPT=/home/deployer/.php/appname/run.sh
FASTCGI_USER=deployer
FASTCGI_GROUP=deployer
PID_DIR=/home/deployer/.php/appname
PID_FILE=/home/deployer/.php/appname/php-fastcgi.pid
RET_VAL=0
View php_run.sh
#!/bin/bash
FASTCGI_USER=deployer
FASTCGI_GROUP=deployer
ADDRESS=127.0.0.1
PORT=9000
PIDFILE=/home/deployer/.php/appname/php-fastcgi.pid
CHILDREN=3
PHP5=/usr/bin/php5-cgi
View nginx_php.conf
server {
server_name domain;
rewrite ^/(.*) http://www.domain/$1 permanent;
access_log /dev/null;
error_log /dev/null;
}
server {
server_name domain;
root /home/deployer/apps/appname/current;
View inject.js
$('.item').each(function(i) {
$(this).append('<a style="position:absolute;top:0;right:0" href="' + '/x/a/' + $(this).data('id') + '">X</a>')
});
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
div {
display: none;
width: 100px; height: 100px;