Skip to content

Instantly share code, notes, and snippets.

@isaacs
Forked from jhs/hello.js
Created April 6, 2012 00:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/2315571 to your computer and use it in GitHub Desktop.
Save isaacs/2315571 to your computer and use it in GitHub Desktop.
Safe Javascript semicolons
var http = require('http');;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
//////;/* /* /* make sure to *really* comment your comments.*******************/
http.createServer(function (request, response) {;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;response.writeHead(200, {'Content-Type': 'text/plain'});;;;;;;;;;;;;;;;;;;;;;;
;;response.end('Hello World\n');;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
}).listen(8124);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
console.log('Server running at http://127.0.0.1:8124/');;;;;;;;;;;;;;;;;;;;;;;;;
//////;/* /* /* FIX ISSUE #11245532 - WHITESPACE ADDED - 2012-04-05 isaacs ****/
@jhs
Copy link

jhs commented Apr 6, 2012

I agonized over whether to do that. I decided to leave it whitespaced

  • It looks more naive
  • The small, lone nice-looking area is funnier

Sorry to kill this joke with death-by-analysis.

@polotek
Copy link

polotek commented Apr 6, 2012

Need to increase whitespace for readability.

@isaacs
Copy link
Author

isaacs commented Apr 6, 2012

@polotek fixed. Thanks for reporting.

@jed
Copy link

jed commented Apr 6, 2012

for extra safety, make sure your payload complies too.

before:

;;response.end('Hello World\n');;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

after:

;;response.end('Hello World;\n');;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@mikefrey
Copy link

mikefrey commented Apr 6, 2012

Probably a good idea to escape the asterisks around really in your comment as well.

//////;/* /* /* make sure to \u002Areally\u002A comment your comments.*******************/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment