This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To use this, you will need to `npm install iocane`! | |
| const crypto = require("crypto"); | |
| let aliceECDH = crypto.createECDH("secp256k1"); | |
| aliceECDH.generateKeys(); | |
| let alicePublicKey = aliceECDH.getPublicKey(null, "compressed"), | |
| alicePrivateKey = aliceECDH.getPrivateKey(null, "compressed"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Load the TCP Library | |
| net = require('net'); | |
| // Keep track of the chat clients | |
| var clients = []; | |
| // Start a TCP Server | |
| net.createServer(function (socket) { | |
| // Identify this client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var watchify = require('watchify'); | |
| var uglify = require('gulp-uglify'); | |
| var buffer = require('vinyl-buffer'); | |
| var source = require('vinyl-source-stream'); | |
| var browserify = require('browserify'); | |
| var browserSync = require('browser-sync'); | |
| var sass = require('gulp-ruby-sass'); | |
| var filter = require('gulp-filter'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "my-app", | |
| "version": "0.0.0", | |
| "devDependencies": { | |
| "browserify": "^10.2.4", | |
| "watchify": "^3.2.3", | |
| "node-sass": "^3.2.0", | |
| "uglify": "^2.4.23", | |
| "mkdirp": "^0.5.1", | |
| "parallelshell": "^1.2.0", |