Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added jakes beauty

  • Loading branch information...
commit 3524315be8c39236babb84ad576312a54c5664c4 1 parent c162a96
@brianleroux authored
View
1  node-code-blog/lib/node-code-blog-themes/wtfjs/views/about.html.ejs
@@ -38,6 +38,7 @@
<li><a href="http://twitter.com/apike">@apike</a></li>
<li><a href="http://twitter.com/remi">@remi</a></li>
<li><a href="http://twitter.com/rwaldron">@rwaldron</a></li>
+ <li><a href="http://twitter.com/jakedevine">@jakedevine</a></li>
</ul>
View
2  node-code-blog/lib/node-code-blog-themes/wtfjs/views/layout.html.ejs
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!-- OOoooooh HTML5! -->
<html>
<head>
- <title>WTFJS</title>
+ <title>wtfjs</title>
<link rel="stylesheet" href="/public/app.css" type="text/css" charset="utf-8" />
<link rel="alternate" type="application/rss+xml" title="RSS Feed for http://wtfjs.com" href="/rss/" />
<link rel="icon" href="/public/favicon.ico" type="image/x-icon" />
View
20 node-code-blog/node-code-blog.js
@@ -3,13 +3,13 @@ require.paths.unshift(__dirname + "/lib/showdown-v0.9/src");
require.paths.unshift(__dirname + "/lib/prettyfy");
require.paths.unshift(__dirname + "/lib/express-clean-config");
-require("express");
-require("express/plugins");
+require('express');
+require('express/plugins');
-Object.merge(global, require("express-clean-config"));
+Object.merge(global, require('express-clean-config'));
-var path = require("path")
-, sys = require("sys")
+var path = require('path')
+, sys = require('sys')
, fs = require('fs')
, Post = require('post').Post;
@@ -35,24 +35,24 @@ get("/rss", function(){
});
// GET "/archive" - shows a summary of all posts by year/month
-get("/archive", function(){
+get("/archive", function() {
this.render("archive.html.ejs");
});
// GET "/archive/2010" - shows posts for year
-get("/archive/:year",function(){
+get("/archive/:year",function() {
return "no implemented"
});
// GET "/archive/2010/10"
-get("/archive/:year/:month",function(){
+get("/archive/:year/:month",function() {
return "no implemented"
});
// GET "/2010/05/10/title-of-article" - post permalink
get("/:y/:m/:d/:title", function() {
- var args = [].splice.call(arguments,0)
+ var args = [].splice.call(arguments, 0)
, title = args.join('-') + '.md'
- , post = Post.create(title);
+ , post = Post.create(title);
this.render("post.html.ejs", {locals:{ post:post }});
});
View
28 posts/2010-06-09-function-in-ur-string.md
@@ -0,0 +1,28 @@
+Old friend (_and clearly damaged by a career of JavaScript programming_) [@jakedevine](http://twitter.com/jakedevine) threw this down on twitter a few days ago.
+
+<code>
+ var Z = "constructor";
+ Z[Z][Z]("alert('wtfjs!')")();
+ // alerts wtfjs!
+</code>
+
+Ok. So wtf exactly is happening here?
+
+<code>
+ Z[Z]
+ // function String() { [native code] }
+
+ Z[Z][Z]
+ // function Function() { [native code] }
+</code>
+
+AHA! The constructor property of a string is `String` and the constructor property of `String` is `Function`. Makes sense.
+
+<code>
+ Z[Z][Z]("console.log('new Function accepts string for eval as argument')")();
+ // new Function accepts string for eval as argument
+</code>
+
+Of course. One wonders, as usual, wtf the programmer was up to when he discovered this!
+
+--- [@brianleroux](http://twitter.com/brianleroux)
View
3  server.js
@@ -5,7 +5,8 @@ config({
root: __dirname + '/node-code-blog/lib/node-code-blog-themes/wtfjs',
title: 'wtfjs',
domain: 'wtfjs.com',
- desciption: 'JavaScript is a language we love despite it giving us so much to hate. This is a collection of those very special irregularities, inconstancies and just plain painfully unintuitive moments for the language of the web.'
+ desciption: 'JavaScript is a language we love despite it giving us so much to hate. This is a collection of those very special irregularities, inconstancies and just plain painfully unintuitive moments for the language of the web.',
+ analytics:''
});
// GET "/license" - diplays the WTFPL
Please sign in to comment.
Something went wrong with that request. Please try again.