Skip to content

Instantly share code, notes, and snippets.

View bmeck's full-sized avatar

Bradley Farias bmeck

View GitHub Profile
var sys=require("sys");
//and so the evil begins...
function Interface() {
//BE SURE TO UPDATE compile -> var a = ...
var $this={}
, _tags = {}
, _properties = {}
, _arguments = []
//adds an argument, higher priority than a private variable
$this.addArgument=function(argumentName,position,defaultValue) {
require("overload").Watchable(
function(argInfo){
return typeof(argInfo.property)=='number'
? proxiedObj.item(argInfo.property)
: proxiedObj[argInfo.property];
}
,function(argInfo){return proxiedObj[argInfo.property]=argInfo.value}
,function(){return Object.getPropertyNames(proxiedObj)}
,function(argInfo){return argInfo.property in proxiedObj}
,function(argInfo){proxiedObj[delete argInfo.property]}
Handle<Value> Compile(const Arguments& args) {
HandleScope scope;
Handle<String> src=args[0]->ToString();
Handle<Buffer> src_buffer=Handle<Buffer>(Buffer::New(src->Length()));
src->WriteUtf8(src_buffer->data());
ScriptData* scriptdata = ScriptData::PreCompile(src_buffer->data(),src->Length());
if(scriptdata->HasError()) {
return scope.Close(ThrowException(Exception::Error(String::New("Error in script"))));
}

npm list [filters]

display list of packages in a format (default is terse)

Filters

Filters take may subfilter with the syntax subfilter=pattern, if you need multiple subfilters separate them by commas, by default all filters must be matched to return a package. For filters on a set of data such as authors the filter only needs to match 1 entry out of the set.

Syntax

module.exports = {a: 'async'}
console.log('in >> '+__filename)
function compile(template, locals, callback | stream)
switch(protocol) {
//first set it to secure
case "https:":
stream.setSecure(true)
case "http:":
stream.write(text)
stream.end()
break
case "ftp:":
...
var static_scripts = {}
, require
;(function(){
var _require = require
var path = _require("path")
var Script = process.binding("evals").Script
var path_chain = ['.']
require = function(script_path) {
var file = path.join(path.dirname(path_chain[path_chain.length-1]),script_path)
function evaluate() {
script loads via
resources.queue(type="script",url="...",blocks=["script","css"])
holds on script get a +1, holds on css +1
script handled via
resources.on("script")
default handler(stream,data=element,flush)
script.readyState = "loading"
buffer till ready to eval