This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<marquee style=" | |
position: absolute; | |
top:0; | |
right:0; | |
display: inline-block; | |
text-align:center; | |
width: 250px; | |
-webkit-transform: translateX(25%) translateY(75%) rotate(45deg); | |
font-family: arial, sans-serif; | |
font-weight: bold; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/net.js b/lib/net.js | |
index 2349bc1..fa2557c 100644 | |
--- a/lib/net.js | |
+++ b/lib/net.js | |
@@ -855,7 +855,7 @@ function doConnect (socket, port, host) { | |
}; | |
} | |
-function isPort (x) { return parseInt(x) >= 0; } | |
+function toPort (x) { return (x = Number(x)) >= 0 ? x : false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compile(pattern) { | |
var original = pattern | |
var state_id = 0 | |
var state_machine = {} | |
for(var i=0;i<pattern.length;i++) { | |
var c = pattern.charAt(i) | |
if(c == "\\") { | |
i++ | |
c = pattern.charAt(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomObjectWrap : ObjectWrap { | |
public: | |
static int EIO_Loop(eio_req *req) | |
{ | |
int i = 0; | |
printf("1\n"); | |
CustomObjectWrap* ow = (CustomObjectWrap*)(req->data); | |
while (i < 100 ) { | |
printf("%d from c++",i++); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node/node.h> | |
#include <v8.h> | |
using namespace v8; | |
using namespace node; | |
class CustomObjectWrap : ObjectWrap { | |
public: | |
static int EIO_Loop(eio_req *req) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node/node.h> | |
#include <v8.h> | |
using namespace v8; | |
using namespace node; | |
class CustomObjectWrap : ObjectWrap { | |
public: | |
static int EIO_Loop(eio_req *req) { | |
printf("%d req->data\n",(int)req->data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
//pistachio | |
//fear the stachio | |
function compile(source,opts) { | |
source = String(source) | |
opts = opts || {} | |
var template_source = "" | |
var matcher = /[{][{]([@])?([#])?([/])?([a-zA-Z_$]\w*|[.])([\[](-?\d+)?(..(-?\d+)?)?[\]])?[}][}]/g | |
var index = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//no whitespace whole number json array parsing | |
function SavedStateNumberArrayParser() { | |
this.state = "unopened" | |
this.value = undefined | |
} | |
SavedStateNumberArrayParser.prototype.arr = function() { | |
return this.state === "error" ? undefined : this.value | |
} | |
SavedStateNumberArrayParser.prototype.reset = function() { | |
this.state = this.state === "closed" || typeof this.value === "undefined" ? "unopened" : "inside" |