Skip to content

Instantly share code, notes, and snippets.

View aikar's full-sized avatar
:atom:
Powered by Steak

Daniel Ennis aikar

:atom:
Powered by Steak
View GitHub Profile
(function(){
var fork = require('fork').fork;
var netBinding = process.binding('net');
var net = require('net');
var workers = [];
module.exports = preforkServer = function(port, numWorkers, clientServer)
{
net.createServer(function(s) {
s.pause();
var hv = 0;
(function()
{
var net = require('net');
var self = __filename;
var env = process.env;
if(!env.__IS_CHILD)
{
var spawn = require('child_process').spawn;
var path = require('path');
var netBinding = process.binding('net');
@aikar
aikar / a.txt
Created November 24, 2010 06:46
spawn js file that calls multiserv('gatewaynode.js', 8, 80);
child loads gatewaynode.js which does not call listen, gatewaynode also includes socket.io to attach to Express
multiserv passes FD to emit 'connection' event so the children should be doing no binding
>>> node app/gateway/index.js
[worker:1]<< 24 Nov 02:30:00 - socket.io ready - accepting connections>>
[worker:0]<< 24 Nov 02:30:00 - socket.io ready - accepting connections>>
[error worker:0]<< >>
[error worker:0]<< node.js:59>>
[error worker:0]<< throw e; // process.nextTick error, or 'error' event on first tick>>
.uibutton {
-moz-background-inline-policy:continuous;
-moz-border-radius:4px 4px 4px 4px;
-moz-box-shadow:0 0 1px #000000;
-moz-user-select:none;
background:-moz-linear-gradient(left top -90deg, #B1E37F 0pt, #8AC53C 40%) no-repeat scroll 0 0 transparent;
border:1px solid #DDEECD;
color:#333333;
cursor:pointer;
@aikar
aikar / gist:728339
Created December 4, 2010 17:24
Raphael.JS Question
any chance 2.0 will have the ability to have a viewport '100%' of its parent (ie full screen window), and then an option to 'align' to a side, so align bottom left x 10 y 10 would put the element right in the corner, and then when the window is resized have it automatically move with it and stay in bottom left corner?
firefox seems to better support percentages for position but it blows IE up on 1.5.2 in the setBox function where it does math on the width/height for like circle.
I'm looking to create a game UI with Raphael and would really like an align feature and 100% viewports
for % maybe store it but the actual X/Y is calculated any time the viewport is resized or position is moved?
diff --git a/src/msgpack.cc b/src/msgpack.cc
index 5374c3b..d083f32 100644
--- a/src/msgpack.cc
+++ b/src/msgpack.cc
@@ -174,11 +174,11 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
v8_to_msgpack(v, &mo->via.array.ptr[i], mz, mc);
}
} else if (Buffer::HasInstance(v8obj)) {
- Buffer *buf = ObjectWrap::Unwrap<Buffer>(v8obj->ToObject());
+ Local<Object> buf = v8obj->ToObject();
diff --git a/src/msgpack.cc b/src/msgpack.cc
index 5374c3b..fff0e9c 100644
--- a/src/msgpack.cc
+++ b/src/msgpack.cc
@@ -174,11 +174,11 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
v8_to_msgpack(v, &mo->via.array.ptr[i], mz, mc);
}
} else if (Buffer::HasInstance(v8obj)) {
- Buffer *buf = ObjectWrap::Unwrap<Buffer>(v8obj->ToObject());
+ Local<Object> buf = v8obj->ToObject();
[root@dhcppc2 node]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
(function()
{
var net = require('net');
var self = __filename;
var env = process.env;
if(!env.__IS_CHILD)
{
var spawn = require('child_process').spawn;
var path = require('path');
var util = require('util');
@aikar
aikar / client.html
Created December 9, 2010 20:00 — forked from roder/client.html
<html>
<head></head>
<body>
<p><textarea cols=100 rows=25 id="output"></textarea></p>
</body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var client = new function() {
var lastid=0;