For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
// 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 |
@@ -28,7 +28,7 @@ | |
### Set diff-cmd to the absolute path of your 'diff' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff implementation. | |
-# diff-cmd = diff_program (diff, gdiff, etc.) | |
+diff-cmd = colordiff | |
### Set diff3-cmd to the absolute path of your 'diff3' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff3 implementation. |
// Coders, if your goal is to align foo and bar, using a <tab> character is | |
// incorrect. If your goal, however, is to create an additional level of | |
// indentation, then go you. Either way, with a tab size other than 4, this | |
// looks like shit. | |
var foo = 1, | |
bar = 2; |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
/* | |
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'); |