Skip to content

Instantly share code, notes, and snippets.

PatrickJS / async-social-buttons-ga.js
Created December 2, 2013 05:37
Optimised async loading of cross-domain scripts
* Updated to use the function-based method described in
* Better handling of scripts without supplied ids.
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
In the node.js intro tutorial (, 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');