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
var app = express.createServer(); | |
var publicPath = './public'; | |
var adminPath = './admin'; | |
app.use(express.static( path.resolve( publicPath ) ) ); | |
app.use(function(req,res,next){ | |
// if req.path starts with /admin/ and user is logged in call next | |
// else redirect to login page |
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 <webkit/webkit.h> | |
#include "node_gui_webkit_view.h" | |
namespace clip { | |
Persistent<FunctionTemplate> WebkitView::constructor_template; | |
void WebkitView::Init (Handle<v8::Object> target) { | |
ATTACH_CONSTRUCTOR("WebkitView", WebkitView, (Constructor<WebkitView, webkit_web_view_get_type>)); | |
ATTACH_INHERITANCE(Container); |
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 formatTag(tag){ | |
var elements = $('content').getElementsBySelector(tag); | |
elements.forEach(function(P,index){ | |
// calculate frequency of characters for the first few characters ( 30 ) | |
var charCode, | |
arabicFreq = 0, | |
englishFreq = 0, | |
length = 30, | |
parentDir = $(P).getStyle('direction'), | |
text = P.innerText; |
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
// Collision detection with javascript using semi-interval tree. | |
// Add elements using insert function, then check collision using hasCollision. | |
var collisionTree = { | |
LEFT: 1, | |
RIGHT: 0, | |
INTERSECT: 2, | |
nodes:null, | |
margin: 1, | |
init: function(margin){ | |
this.nodes = new Array(); |
NewerOlder