(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-touch-fullscreen" content="yes"> | |
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> | |
<style> | |
html, body {margin: 0; padding: 0; overflow: hidden} |
(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
##What is the problem?
├─┬ grunt@0.4.5
│ ├─┬ findup-sync@0.1.3
│ │ └── lodash@2.4.1
│ ├─┬ grunt-legacy-log@0.1.1
│ │ └── lodash@2.4.1
│ └── lodash@0.9.2
├─┬ grunt-contrib-watch@0.6.1
│ └─┬ gaze@0.5.1
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
AWS.config.loadFromPath('./aws-config.json'); | |
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
function uploadToS3(file, destFileName, callback) { |
function map(array, cb, context) { | |
return function(array, cb) { | |
var returnArray = []; | |
for (var i = 0; i < array.length; i++) { | |
returnArray.push(cb(array[i], i, array)); | |
} | |
return returnArray; | |
}.call(null, array, cb.bind(context)); | |
} |
Here's the basic usage of the file that you'll be creating:
var sort = require('./') // <- this is the file you make;
var arr = [5, 1, 4, 2, 3];
var sorted = sort(arr);
console.log(sorted); // [1, 2, 3, 4, 5]
function quicksort(array) { | |
var sortedArray = array.slice(0); // clone the array | |
if(sortedArray.length == 0) return []; | |
var left = [], right = [], pivot = sortedArray[0]; | |
for (var i = 1; i < sortedArray.length; i++) { | |
if(sortedArray[i] < pivot) { | |
left.push(sortedArray[i]); | |
} else { |
Here's the basic usage of the file that you'll be creating:
var curry = require('./') // <- this is the file you make;
function add(a, b) { return a + b; }
var curried = curry(add); console.log( curried(1)(2) ); // 3
function currying(func) { | |
// how many args that func needs | |
var totalArgs = func.length; | |
var partial = function(args) { | |
return function() { | |
var newArgs = Array.prototype.slice.call(arguments, 0); | |
return fn.apply(null, args.concat(newArgs)); | |
} | |
} |
var func = function(a, b) { | |
console.log(“funcLength is”, this.length); | |
var totalArgs = Array.prototype.slice.call(arguments, 0); | |
console.log(“, totalArgs is”, totalArgs.length); | |
} | |
func.call(func, [1]); // Output: funcLength is 2, totalArgs is 1 | |
func.call(func, [1, 2, 3]); // Output: funcLength is 2, totalArgs is 3 |