Server: Nginx with Phusion Passenger
Ruby Version: 2.1.3
User System: deploy
Download and Install Vagrant http://www.vagrantup.com/ and VirtualBox https://www.virtualbox.org/ or VMware before beginning
#Set up Vagrant *this guide assumes the use of Mac OS X Mountain Lion on local machine and Ubuntu 12.04 LTS x64 on Vagrant box. It is compatible with many other distros but hasn't been tested.
##Step 1: Make and run box
vagrant init
vagrant box add <path to box directory or name according to https://vagrantcloud.com/>
vagrant up
var doctors = [ | |
{ number: 1, actor: "William Hartnell", begin: 1963, end: 1966 }, | |
{ number: 2, actor: "Patrick Troughton", begin: 1966, end: 1969 }, | |
{ number: 3, actor: "Jon Pertwee", begin: 1970, end: 1974 }, | |
{ number: 4, actor: "Tom Baker", begin: 1974, end: 1981 }, | |
{ number: 5, actor: "Peter Davison", begin: 1982, end: 1984 }, | |
{ number: 6, actor: "Colin Baker", begin: 1984, end: 1986 }, | |
{ number: 7, actor: "Sylvester McCoy", begin: 1987, end: 1989 }, | |
{ number: 8, actor: "Paul McGann", begin: 1996, end: 1996 }, | |
{ number: 9, actor: "Christopher Eccleston", begin: 2005, end: 2005 }, |
app.post('/upload/photo', function(req, res, next){ | |
var json_response = {} | |
req.form.complete(function (err, fields, files){ | |
if (err){ | |
next(err) | |
} | |
else{ | |
// temporary filename |
doctype html | |
html | |
head | |
title File uploads | |
body | |
form(method="post", action="/file", enctype="multipart/form-data") | |
input(type="file", name="file") | |
input(type="submit", value="Upload") |
var express = require('express') | |
, passport = require('passport') | |
, LocalStrategy = require('passport-local').Strategy | |
, mongodb = require('mongodb') | |
, mongoose = require('mongoose') | |
, bcrypt = require('bcrypt') | |
, SALT_WORK_FACTOR = 10; | |
mongoose.connect('localhost', 'test'); | |
var db = mongoose.connection; |
var passport = require('passport'), | |
FacebookStrategy = require('passport-facebook').Strategy, | |
TwitterStrategy = require('passport-twitter').Strategy, | |
GithubStrategy = require('passport-github').Strategy, | |
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; | |
/* ...server setup... */ | |
// Setup passport auth | |
app.use(passport.initialize()); |
<?php | |
date_default_timezone_set('Asia/Bangkok'); | |
require_once "lib/nusoap.php"; | |
// Create SOAP Server | |
$server = new soap_server(); | |
$server->configureWSDL("Test_Service", "http://www.example.com/test_service"); | |
// Example "hello" function | |
function hello($username) { |
var app = angular.module('app', ['ngResource']); | |
app.config(function($locationProvider, $routeProvider) { | |
// $locationProvider.html5Mode(true); | |
$routeProvider | |
.when('/', { templateUrl: 'partials/index', controller: 'ctrl' }) | |
.when('/about', { templateUrl: 'partials/about', controller: 'ctrl' }) | |
.otherwise({redirectTo:'/'}); | |
}); |