Brand new project, create dirs "lib/modules", "lib/templates", "config"
exports.register = function (server, options, next) {
server.route({
path: '/',
method: 'GET',
''' | |
Run this script either by doing: | |
python gmaildomain.py | |
And you will be prompted for details, or you can save time by doing: | |
python gmaildomain.py WEBFACTION_USERNAME_HERE DOMAIN_TO_USE_GMAIL_FOR_HERE_WITHOUT_WWW | |
And you will only be prompted for your password. |
Suppose you set up a custom app (listening on port) with Webfaction and you are assigned port 34544. | |
Now, let's say your node app is deployed by pushing to github on your local machine and pulling it down to your webfaction server. | |
The actual location within the directory Webfaction's control panel set up for you is irrelevant, so when you clone your Git repo, it creates a subfolder within the created directory - so your node app isn't at the root. But it'll still work as long as you get the correct port: | |
example node app: | |
var http = require('http'); | |
http.createServer(function (req, res) { |
# I use the Dropbox iPhone app, and I love it - automatically backing up my photos to the cloud? Great! | |
# However, automatic uploads from your camera roll go to "Camera Uploads". If, like me, you can often | |
# forget to go in and sort your photos for a while, pretty soon there's so much in there it becomes slow | |
# to load. Use this script from the command line to move your photos in to a folder named "Unsorted Photos | |
# By Date" (you can change that on line 75 by setting basefolder) with subfolders for YEAR and then MONTH. | |
# Run this manually whenever things get out of hand, or have it running as a cron job or similar to automatically | |
# stay on top of things. | |
# You'll need the Dropbox Python SDK installed, as well as Colorama (pip install colorama) |
// Requires jQuery | |
// Specify a max width. This will return any elements in the DOM on the current page | |
// with a width greater than that width. Useful when debugging what element is | |
// screwing up your fluid layout | |
// NOT PRODUCTION CODE - A QUICK 'N DIRTY UTILITY TO SAVE SOME TIME DEBUGGING! | |
var maxWidth = 400; | |
jQuery("*").filter(function () { | |
if (jQuery(this).width() > maxWidth){ |
"use strict"; | |
var joi = require("joi"); | |
var data = [{ | |
type : "A", | |
ip : "123.123.123.123" | |
}, | |
{ | |
type: "A", |
// GETTING STARTED: | |
// Express | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.send('hello world'); | |
}); |
const x = 12; | |
console.log(x); // 12 | |
x = 42; | |
console.log(x); // 12 (but no error) | |
const y = {}; | |
y.newProp = "value"; | |
console.log(y); // {newProp: "value"} | |
class MyComponent extends React.Component { | |
render() { | |
return ( | |
<ul> | |
{this.props.listItems.map((item) => { | |
return <li>{item}</li>; | |
})} | |
</ul> | |
); | |
} |
install presets
npm i babel-preset-stage-0 babel-preset-es2015
create/edit .babelrc
{
presets: ["es2015", "stage-0"]
}