(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 deployAnd Update the new password
(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 deployAnd 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} |
Deploying a node app with Forever is great...until your server restarts unexpectedly. Then your app stops running and you have to re-deploy.
To get around this, we're going to run our node app as an Upstart service. Upstart services are great, because, once started, the system auto-restarts them if they fail, or if the server restarts.
###Step 1: Create a service for your node app
ssh root@youripaddressservice node-app start##Setup your server (this would ideally be done with automated provisioning)
npm install -g forever##Install flightplan
npm install -g flightplannpm install flightplan --save-devThis is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.
The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.
| // api/models/Account.js | |
| module.exports = { | |
| attributes: { | |
| acct_id: { | |
| type: 'int', | |
| primaryKey: true | |
| }, | |
| loginName: { | |
| type: 'string', |
Download [jshint.vim][jshint]
Put it in ~/.vim/plugin/jshint.vim
Edit your local vimrc file (I'm on macvim with janus, so it's at ~/.gvimrc.local) and add:
au BufWritePost *.js :JSHintRead the [vim docs][vim] and particularly [auto commands][auto] I'm a newb and the neckbeards are probably laughing at me for even posting this.
Throughout, let
return_type be the type of object/primitive/etc. you'd like to return (commonly void)blockName be the variable name of the block you're creatingvar_type be the type object/primitive/etc. you'd like to pass as an argument (leave blank for no parameters)varName be the variable name of the given parameter And remember that you can create as many parameters as you'd like.Possibly the most common for of declaration.
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2013 Peter Steinberger. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> | |
| // Compile-time selector checks. |
| @implementation KZPropertyMapper (MyAppBoxing) | |
| + (NSDate *)boxValueAsDateSince1970:(id)value __used | |
| { | |
| if (value == nil) { | |
| return nil; | |
| } | |
| AssertTrueOrReturnNil([value isKindOfClass:NSNumber.class]); | |
| return [NSDate dateWithTimeIntervalSince1970:[value floatValue]]; | |
| } |