Skip to content

Instantly share code, notes, and snippets.

@sultano
sultano / ecdh_iocane.js
Created June 7, 2017 10:02 — forked from perry-mitchell/ecdh_iocane.js
ECDH key exchange with AES encryption using iocane
// 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");
@sultano
sultano / nodejs-tcp-example.js
Created May 29, 2017 10:44 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
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');
@sultano
sultano / chatServer.js
Created May 29, 2017 09:48 — forked from creationix/chatServer.js
A simple TCP based chat server written in node.js
// 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
@sultano
sultano / gulpfile.js
Created November 6, 2016 13:03 — forked from gregberge/gulpfile.js
Watchify, browserify gulp.
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');
@sultano
sultano / package.json
Created November 4, 2016 17:35 — forked from andreruffert/package.json
using `npm run` to build and watch with node-sass and browserify
{
"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",