If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| /* | |
| In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
| server, but for some reason omit a client connecting to it. I added an | |
| example at the bottom. | |
| Save the following server in example.js: | |
| */ | |
| var net = require('net'); |
| sudo apt-get install python-software-properties | |
| sudo apt-get install software-properties-common | |
| sudo add-apt-repository ppa:rwky/graphicsmagick | |
| sudo apt-get update | |
| sudo apt-get install graphicsmagick |
| module.exports = { | |
| /** | |
| * | |
| * Using raw socket.io functionality from a Sails.js controller | |
| * | |
| */ | |
| index: function (req,res) { |
| // App | |
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'app', | |
| template: '<span>{{ sayHello() }}</span>', | |
| }) | |
| export class App { | |
| public name: string = 'John'; |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| function memorySizeOf(obj) { | |
| var bytes = 0; | |
| function sizeOf(obj) { | |
| if(obj !== null && obj !== undefined) { | |
| switch(typeof obj) { | |
| case 'number': | |
| bytes += 8; | |
| break; | |
| case 'string': |
| <?php | |
| // SETUP: | |
| // 1. Customize all the settings (stripe api key, email settings, email text) | |
| // 2. Put this code somewhere where it's accessible by a URL on your server. | |
| // 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks | |
| // 4. Have fun! | |
| // set your secret key: remember to change this to your live secret key in production | |
| // see your keys here https://manage.stripe.com/account |
| // http://www.2ality.com/2015/02/es6-classes-final.html | |
| const chalk = require('chalk'); | |
| class Point { | |
| constructor(x, y) { | |
| this.x = x; | |
| this.y = y; | |
| } |
| var express = require('express'); | |
| var favicon = require('serve-favicon'); | |
| var app = express(); | |
| app.use(favicon(__dirname + '/public/images/favicon.ico')); | |
| var path = require('path'); | |
| var router = express.Router(); | |
| var request = require('request'); | |
| var exphbs = require('express-handlebars'); |