id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
47,600 | twolfson/value-mapper | lib/value-mapper.js | function (val) {
// Keep track of aliases used
var aliasesUsed = [],
aliasesNotFound = [],
that = this;
// Map the value through the middlewares
var middlewares = this.middlewares;
middlewares.forEach(function mapMiddlewareValue (fn) {
// Process the value through middleware
... | javascript | function (val) {
// Keep track of aliases used
var aliasesUsed = [],
aliasesNotFound = [],
that = this;
// Map the value through the middlewares
var middlewares = this.middlewares;
middlewares.forEach(function mapMiddlewareValue (fn) {
// Process the value through middleware
... | [
"function",
"(",
"val",
")",
"{",
"// Keep track of aliases used",
"var",
"aliasesUsed",
"=",
"[",
"]",
",",
"aliasesNotFound",
"=",
"[",
"]",
",",
"that",
"=",
"this",
";",
"// Map the value through the middlewares",
"var",
"middlewares",
"=",
"this",
".",
"mid... | Resolve values of values via middleware | [
"Resolve",
"values",
"of",
"values",
"via",
"middleware"
] | 956cfa193e02b6c4ae0e607b14eea41a15b7331d | https://github.com/twolfson/value-mapper/blob/956cfa193e02b6c4ae0e607b14eea41a15b7331d/lib/value-mapper.js#L45-L69 | |
47,601 | twolfson/value-mapper | lib/value-mapper.js | function (key) {
// Look up the normal value
var val = this.input[key];
// Save the key for reference
var _key = this.key;
this.key = key;
// Map our value through the middlewares
val = this.process(val);
// Restore the original key
this.key = _key;
// Return the value
re... | javascript | function (key) {
// Look up the normal value
var val = this.input[key];
// Save the key for reference
var _key = this.key;
this.key = key;
// Map our value through the middlewares
val = this.process(val);
// Restore the original key
this.key = _key;
// Return the value
re... | [
"function",
"(",
"key",
")",
"{",
"// Look up the normal value",
"var",
"val",
"=",
"this",
".",
"input",
"[",
"key",
"]",
";",
"// Save the key for reference",
"var",
"_key",
"=",
"this",
".",
"key",
";",
"this",
".",
"key",
"=",
"key",
";",
"// Map our v... | Resolve the value of a key
@param {String} key Name to lookup value by
@returns {Object} retObj Container for value and meta information
@returns {Mixed} retObj.value Aliased, mapped, and flattened copy of `key`
@returns {String[]} retObj.aliasesUsed Array of aliased keys used while looking up
@returns {String[]} retOb... | [
"Resolve",
"the",
"value",
"of",
"a",
"key"
] | 956cfa193e02b6c4ae0e607b14eea41a15b7331d | https://github.com/twolfson/value-mapper/blob/956cfa193e02b6c4ae0e607b14eea41a15b7331d/lib/value-mapper.js#L79-L95 | |
47,602 | Illyism/markade | lib/render.js | render | function render(content) {
var deferred = q.defer();
var blockType = "normal";
var lines = content.split("\n");
var blocks = {};
for (var i=0; i<lines.length; i++) {
var line = lines[i];
if (line.substr(0,1) == "@") {
blockType = line.substr(1).trim();
if (blockType === "end") blockType ... | javascript | function render(content) {
var deferred = q.defer();
var blockType = "normal";
var lines = content.split("\n");
var blocks = {};
for (var i=0; i<lines.length; i++) {
var line = lines[i];
if (line.substr(0,1) == "@") {
blockType = line.substr(1).trim();
if (blockType === "end") blockType ... | [
"function",
"render",
"(",
"content",
")",
"{",
"var",
"deferred",
"=",
"q",
".",
"defer",
"(",
")",
";",
"var",
"blockType",
"=",
"\"normal\"",
";",
"var",
"lines",
"=",
"content",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"var",
"blocks",
"=",
"{",
... | Catch all the blocks encapsulated in blocks with `key` as key. and make an object based on this to be used in the templates. ``` @ key # Normal Markdown content @ end ``` | [
"Catch",
"all",
"the",
"blocks",
"encapsulated",
"in",
"blocks",
"with",
"key",
"as",
"key",
".",
"and",
"make",
"an",
"object",
"based",
"on",
"this",
"to",
"be",
"used",
"in",
"the",
"templates",
"."
] | fa2a4b45084b468a8ed0eca9499ade65e2568052 | https://github.com/Illyism/markade/blob/fa2a4b45084b468a8ed0eca9499ade65e2568052/lib/render.js#L41-L73 |
47,603 | Illyism/markade | lib/render.js | splitInput | function splitInput(str) {
if (str.slice(0, 3) !== '---') return;
var matcher = /\n(\.{3}|-{3})/g;
var metaEnd = matcher.exec(str);
return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
} | javascript | function splitInput(str) {
if (str.slice(0, 3) !== '---') return;
var matcher = /\n(\.{3}|-{3})/g;
var metaEnd = matcher.exec(str);
return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
} | [
"function",
"splitInput",
"(",
"str",
")",
"{",
"if",
"(",
"str",
".",
"slice",
"(",
"0",
",",
"3",
")",
"!==",
"'---'",
")",
"return",
";",
"var",
"matcher",
"=",
"/",
"\\n(\\.{3}|-{3})",
"/",
"g",
";",
"var",
"metaEnd",
"=",
"matcher",
".",
"exec... | Splits the given string into a meta section and a markdown section if a meta section is present, else returns null | [
"Splits",
"the",
"given",
"string",
"into",
"a",
"meta",
"section",
"and",
"a",
"markdown",
"section",
"if",
"a",
"meta",
"section",
"is",
"present",
"else",
"returns",
"null"
] | fa2a4b45084b468a8ed0eca9499ade65e2568052 | https://github.com/Illyism/markade/blob/fa2a4b45084b468a8ed0eca9499ade65e2568052/lib/render.js#L101-L108 |
47,604 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function( range )
{
range.collapsed = (
range.startContainer &&
range.endContainer &&
range.startContainer.equals( range.endContainer ) &&
range.startOffset == range.endOffset );
} | javascript | function( range )
{
range.collapsed = (
range.startContainer &&
range.endContainer &&
range.startContainer.equals( range.endContainer ) &&
range.startOffset == range.endOffset );
} | [
"function",
"(",
"range",
")",
"{",
"range",
".",
"collapsed",
"=",
"(",
"range",
".",
"startContainer",
"&&",
"range",
".",
"endContainer",
"&&",
"range",
".",
"startContainer",
".",
"equals",
"(",
"range",
".",
"endContainer",
")",
"&&",
"range",
".",
... | Updates the "collapsed" property for the given range object. | [
"Updates",
"the",
"collapsed",
"property",
"for",
"the",
"given",
"range",
"object",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L94-L101 | |
47,605 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function( mergeThen )
{
var docFrag = new CKEDITOR.dom.documentFragment( this.document );
if ( !this.collapsed )
execContentsAction( this, 1, docFrag, mergeThen );
return docFrag;
} | javascript | function( mergeThen )
{
var docFrag = new CKEDITOR.dom.documentFragment( this.document );
if ( !this.collapsed )
execContentsAction( this, 1, docFrag, mergeThen );
return docFrag;
} | [
"function",
"(",
"mergeThen",
")",
"{",
"var",
"docFrag",
"=",
"new",
"CKEDITOR",
".",
"dom",
".",
"documentFragment",
"(",
"this",
".",
"document",
")",
";",
"if",
"(",
"!",
"this",
".",
"collapsed",
")",
"execContentsAction",
"(",
"this",
",",
"1",
"... | The content nodes of the range are cloned and added to a document fragment,
meanwhile they're removed permanently from the DOM tree.
@param {Boolean} [mergeThen] Merge any splitted elements result in DOM true due to partial selection. | [
"The",
"content",
"nodes",
"of",
"the",
"range",
"are",
"cloned",
"and",
"added",
"to",
"a",
"document",
"fragment",
"meanwhile",
"they",
"re",
"removed",
"permanently",
"from",
"the",
"DOM",
"tree",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L466-L474 | |
47,606 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function( normalized )
{
var startContainer = this.startContainer,
endContainer = this.endContainer;
var startOffset = this.startOffset,
endOffset = this.endOffset;
var collapsed = this.collapsed;
var child, previous;
// If there is no range then get out of here.
// It happe... | javascript | function( normalized )
{
var startContainer = this.startContainer,
endContainer = this.endContainer;
var startOffset = this.startOffset,
endOffset = this.endOffset;
var collapsed = this.collapsed;
var child, previous;
// If there is no range then get out of here.
// It happe... | [
"function",
"(",
"normalized",
")",
"{",
"var",
"startContainer",
"=",
"this",
".",
"startContainer",
",",
"endContainer",
"=",
"this",
".",
"endContainer",
";",
"var",
"startOffset",
"=",
"this",
".",
"startOffset",
",",
"endOffset",
"=",
"this",
".",
"endO... | Creates a "non intrusive" and "mutation sensible" bookmark. This
kind of bookmark should be used only when the DOM is supposed to
remain stable after its creation.
@param {Boolean} [normalized] Indicates that the bookmark must
normalized. When normalized, the successive text nodes are
considered a single node. To suces... | [
"Creates",
"a",
"non",
"intrusive",
"and",
"mutation",
"sensible",
"bookmark",
".",
"This",
"kind",
"of",
"bookmark",
"should",
"be",
"used",
"only",
"when",
"the",
"DOM",
"is",
"supposed",
"to",
"remain",
"stable",
"after",
"its",
"creation",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L558-L650 | |
47,607 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function()
{
var container = this.startContainer;
var offset = this.startOffset;
if ( container.type != CKEDITOR.NODE_ELEMENT )
{
if ( !offset )
this.setStartBefore( container );
else if ( offset >= container.getLength() )
this.setStartAfter( container );
}
container... | javascript | function()
{
var container = this.startContainer;
var offset = this.startOffset;
if ( container.type != CKEDITOR.NODE_ELEMENT )
{
if ( !offset )
this.setStartBefore( container );
else if ( offset >= container.getLength() )
this.setStartAfter( container );
}
container... | [
"function",
"(",
")",
"{",
"var",
"container",
"=",
"this",
".",
"startContainer",
";",
"var",
"offset",
"=",
"this",
".",
"startOffset",
";",
"if",
"(",
"container",
".",
"type",
"!=",
"CKEDITOR",
".",
"NODE_ELEMENT",
")",
"{",
"if",
"(",
"!",
"offset... | Transforms the startContainer and endContainer properties from text
nodes to element nodes, whenever possible. This is actually possible
if either of the boundary containers point to a text node, and its
offset is set to zero, or after the last char in the node. | [
"Transforms",
"the",
"startContainer",
"and",
"endContainer",
"properties",
"from",
"text",
"nodes",
"to",
"element",
"nodes",
"whenever",
"possible",
".",
"This",
"is",
"actually",
"possible",
"if",
"either",
"of",
"the",
"boundary",
"containers",
"point",
"to",
... | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L783-L806 | |
47,608 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function()
{
var startNode = this.startContainer,
endNode = this.endContainer;
if ( startNode.is && startNode.is( 'span' )
&& startNode.data( 'cke-bookmark' ) )
this.setStartAt( startNode, CKEDITOR.POSITION_BEFORE_START );
if ( endNode && endNode.is && endNode.is( 'span' )
&& endNod... | javascript | function()
{
var startNode = this.startContainer,
endNode = this.endContainer;
if ( startNode.is && startNode.is( 'span' )
&& startNode.data( 'cke-bookmark' ) )
this.setStartAt( startNode, CKEDITOR.POSITION_BEFORE_START );
if ( endNode && endNode.is && endNode.is( 'span' )
&& endNod... | [
"function",
"(",
")",
"{",
"var",
"startNode",
"=",
"this",
".",
"startContainer",
",",
"endNode",
"=",
"this",
".",
"endContainer",
";",
"if",
"(",
"startNode",
".",
"is",
"&&",
"startNode",
".",
"is",
"(",
"'span'",
")",
"&&",
"startNode",
".",
"data... | Move the range out of bookmark nodes if they'd been the container. | [
"Move",
"the",
"range",
"out",
"of",
"bookmark",
"nodes",
"if",
"they",
"d",
"been",
"the",
"container",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L811-L822 | |
47,609 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function( element, checkType )
{
var checkStart = ( checkType == CKEDITOR.START );
// Create a copy of this range, so we can manipulate it for our checks.
var walkerRange = this.clone();
// Collapse the range at the proper size.
walkerRange.collapse( checkStart );
// Expand the range to... | javascript | function( element, checkType )
{
var checkStart = ( checkType == CKEDITOR.START );
// Create a copy of this range, so we can manipulate it for our checks.
var walkerRange = this.clone();
// Collapse the range at the proper size.
walkerRange.collapse( checkStart );
// Expand the range to... | [
"function",
"(",
"element",
",",
"checkType",
")",
"{",
"var",
"checkStart",
"=",
"(",
"checkType",
"==",
"CKEDITOR",
".",
"START",
")",
";",
"// Create a copy of this range, so we can manipulate it for our checks.\r",
"var",
"walkerRange",
"=",
"this",
".",
"clone",
... | Check whether a range boundary is at the inner boundary of a given
element.
@param {CKEDITOR.dom.element} element The target element to check.
@param {Number} checkType The boundary to check for both the range
and the element. It can be CKEDITOR.START or CKEDITOR.END.
@returns {Boolean} "true" if the range boundary is ... | [
"Check",
"whether",
"a",
"range",
"boundary",
"is",
"at",
"the",
"inner",
"boundary",
"of",
"a",
"given",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L1779-L1799 | |
47,610 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/range.js | function()
{
var startContainer = this.startContainer,
startOffset = this.startOffset;
// If the starting node is a text node, and non-empty before the offset,
// then we're surely not at the start of block.
if ( startOffset && startContainer.type == CKEDITOR.NODE_TEXT )
{
var textBef... | javascript | function()
{
var startContainer = this.startContainer,
startOffset = this.startOffset;
// If the starting node is a text node, and non-empty before the offset,
// then we're surely not at the start of block.
if ( startOffset && startContainer.type == CKEDITOR.NODE_TEXT )
{
var textBef... | [
"function",
"(",
")",
"{",
"var",
"startContainer",
"=",
"this",
".",
"startContainer",
",",
"startOffset",
"=",
"this",
".",
"startOffset",
";",
"// If the starting node is a text node, and non-empty before the offset,\r",
"// then we're surely not at the start of block.\r",
"... | Calls to this function may produce changes to the DOM. The range may be updated to reflect such changes. | [
"Calls",
"to",
"this",
"function",
"may",
"produce",
"changes",
"to",
"the",
"DOM",
".",
"The",
"range",
"may",
"be",
"updated",
"to",
"reflect",
"such",
"changes",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/range.js#L1803-L1835 | |
47,611 | shlomiassaf/resty-stone | example/customTypeHandlers/cloudinaryimage.js | authorizedHandler | function authorizedHandler(value) {
if (! value) return value;
delete value.public_id;
delete value.version;
delete value.signature;
delete value.resource_type;
return value;
} | javascript | function authorizedHandler(value) {
if (! value) return value;
delete value.public_id;
delete value.version;
delete value.signature;
delete value.resource_type;
return value;
} | [
"function",
"authorizedHandler",
"(",
"value",
")",
"{",
"if",
"(",
"!",
"value",
")",
"return",
"value",
";",
"delete",
"value",
".",
"public_id",
";",
"delete",
"value",
".",
"version",
";",
"delete",
"value",
".",
"signature",
";",
"delete",
"value",
... | Handles CloudinaryImage instances for authorized requests. | [
"Handles",
"CloudinaryImage",
"instances",
"for",
"authorized",
"requests",
"."
] | 9ab093272ea7b68c6fe0aba45384206571896295 | https://github.com/shlomiassaf/resty-stone/blob/9ab093272ea7b68c6fe0aba45384206571896295/example/customTypeHandlers/cloudinaryimage.js#L20-L29 |
47,612 | coderaiser/ponse | lib/ponse.js | sendFile | function sendFile(params) {
const p = params;
checkParams(params);
fs.lstat(p.name, (error, stat) => {
if (error)
return sendError(error, params);
const isGzip = isGZIP(p.request) && p.gzip;
const time = stat.mtime.toUTCString();
const length = ... | javascript | function sendFile(params) {
const p = params;
checkParams(params);
fs.lstat(p.name, (error, stat) => {
if (error)
return sendError(error, params);
const isGzip = isGZIP(p.request) && p.gzip;
const time = stat.mtime.toUTCString();
const length = ... | [
"function",
"sendFile",
"(",
"params",
")",
"{",
"const",
"p",
"=",
"params",
";",
"checkParams",
"(",
"params",
")",
";",
"fs",
".",
"lstat",
"(",
"p",
".",
"name",
",",
"(",
"error",
",",
"stat",
")",
"=>",
"{",
"if",
"(",
"error",
")",
"return... | send file to client thru pipe
and gzip it if client support | [
"send",
"file",
"to",
"client",
"thru",
"pipe",
"and",
"gzip",
"it",
"if",
"client",
"support"
] | 0bea0b55304553a6b44254daffe178bb90fbe60b | https://github.com/coderaiser/ponse/blob/0bea0b55304553a6b44254daffe178bb90fbe60b/lib/ponse.js#L200-L238 |
47,613 | coderaiser/ponse | lib/ponse.js | sendError | function sendError(error, params) {
checkParams(params);
params.status = FILE_NOT_FOUND;
const data = error.message || String(error);
logError(error.stack);
send(data, params);
} | javascript | function sendError(error, params) {
checkParams(params);
params.status = FILE_NOT_FOUND;
const data = error.message || String(error);
logError(error.stack);
send(data, params);
} | [
"function",
"sendError",
"(",
"error",
",",
"params",
")",
"{",
"checkParams",
"(",
"params",
")",
";",
"params",
".",
"status",
"=",
"FILE_NOT_FOUND",
";",
"const",
"data",
"=",
"error",
".",
"message",
"||",
"String",
"(",
"error",
")",
";",
"logError"... | send error response | [
"send",
"error",
"response"
] | 0bea0b55304553a6b44254daffe178bb90fbe60b | https://github.com/coderaiser/ponse/blob/0bea0b55304553a6b44254daffe178bb90fbe60b/lib/ponse.js#L243-L253 |
47,614 | coderaiser/ponse | lib/ponse.js | redirect | function redirect(url, response) {
const header = {
'Location': url
};
assert(url, 'url could not be empty!');
assert(response, 'response could not be empty!');
fillHeader(header, response);
response.statusCode = MOVED_PERMANENTLY;
response.end();
} | javascript | function redirect(url, response) {
const header = {
'Location': url
};
assert(url, 'url could not be empty!');
assert(response, 'response could not be empty!');
fillHeader(header, response);
response.statusCode = MOVED_PERMANENTLY;
response.end();
} | [
"function",
"redirect",
"(",
"url",
",",
"response",
")",
"{",
"const",
"header",
"=",
"{",
"'Location'",
":",
"url",
"}",
";",
"assert",
"(",
"url",
",",
"'url could not be empty!'",
")",
";",
"assert",
"(",
"response",
",",
"'response could not be empty!'",
... | redirect to another URL | [
"redirect",
"to",
"another",
"URL"
] | 0bea0b55304553a6b44254daffe178bb90fbe60b | https://github.com/coderaiser/ponse/blob/0bea0b55304553a6b44254daffe178bb90fbe60b/lib/ponse.js#L318-L329 |
47,615 | jhermsmeier/node-speech | lib/distance/levenshtein.js | levenshtein | function levenshtein( source, target ) {
var s = source.length
var t = target.length
if( s === 0 ) return t
if( t === 0 ) return s
var i, k, matrix = []
for( i = 0; i <= t; i++ ) {
matrix[i] = [ i ]
}
for( k = 0; k <= s; k++ )
matrix[0][k] = k
for( i = 1; i <= t; i++ ) {
... | javascript | function levenshtein( source, target ) {
var s = source.length
var t = target.length
if( s === 0 ) return t
if( t === 0 ) return s
var i, k, matrix = []
for( i = 0; i <= t; i++ ) {
matrix[i] = [ i ]
}
for( k = 0; k <= s; k++ )
matrix[0][k] = k
for( i = 1; i <= t; i++ ) {
... | [
"function",
"levenshtein",
"(",
"source",
",",
"target",
")",
"{",
"var",
"s",
"=",
"source",
".",
"length",
"var",
"t",
"=",
"target",
".",
"length",
"if",
"(",
"s",
"===",
"0",
")",
"return",
"t",
"if",
"(",
"t",
"===",
"0",
")",
"return",
"s",... | Computes the Levenshtein distance
between two sequences.
@param {String} source
@param {String} target
@return {Number} distance | [
"Computes",
"the",
"Levenshtein",
"distance",
"between",
"two",
"sequences",
"."
] | 984c4dd6e2fe640c01267f10e3804ef81391e73a | https://github.com/jhermsmeier/node-speech/blob/984c4dd6e2fe640c01267f10e3804ef81391e73a/lib/distance/levenshtein.js#L10-L43 |
47,616 | saggiyogesh/nodeportal | public/ckeditor/_source/core/resourcemanager.js | function( name )
{
var external = this.externals[ name ];
return CKEDITOR.getUrl( ( external && external.dir ) || this.basePath + name + '/' );
} | javascript | function( name )
{
var external = this.externals[ name ];
return CKEDITOR.getUrl( ( external && external.dir ) || this.basePath + name + '/' );
} | [
"function",
"(",
"name",
")",
"{",
"var",
"external",
"=",
"this",
".",
"externals",
"[",
"name",
"]",
";",
"return",
"CKEDITOR",
".",
"getUrl",
"(",
"(",
"external",
"&&",
"external",
".",
"dir",
")",
"||",
"this",
".",
"basePath",
"+",
"name",
"+",... | Get the folder path for a specific loaded resource.
@param {String} name The resource name.
@type String
@example
alert( <b>CKEDITOR.plugins.getPath( 'sample' )</b> ); // "<editor path>/plugins/sample/" | [
"Get",
"the",
"folder",
"path",
"for",
"a",
"specific",
"loaded",
"resource",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/resourcemanager.js#L112-L116 | |
47,617 | saggiyogesh/nodeportal | public/ckeditor/_source/core/resourcemanager.js | function( name )
{
var external = this.externals[ name ];
return CKEDITOR.getUrl(
this.getPath( name ) +
( ( external && ( typeof external.file == 'string' ) ) ? external.file : this.fileName + '.js' ) );
} | javascript | function( name )
{
var external = this.externals[ name ];
return CKEDITOR.getUrl(
this.getPath( name ) +
( ( external && ( typeof external.file == 'string' ) ) ? external.file : this.fileName + '.js' ) );
} | [
"function",
"(",
"name",
")",
"{",
"var",
"external",
"=",
"this",
".",
"externals",
"[",
"name",
"]",
";",
"return",
"CKEDITOR",
".",
"getUrl",
"(",
"this",
".",
"getPath",
"(",
"name",
")",
"+",
"(",
"(",
"external",
"&&",
"(",
"typeof",
"external"... | Get the file path for a specific loaded resource.
@param {String} name The resource name.
@type String
@example
alert( <b>CKEDITOR.plugins.getFilePath( 'sample' )</b> ); // "<editor path>/plugins/sample/plugin.js" | [
"Get",
"the",
"file",
"path",
"for",
"a",
"specific",
"loaded",
"resource",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/resourcemanager.js#L125-L131 | |
47,618 | saggiyogesh/nodeportal | public/ckeditor/_source/core/resourcemanager.js | function( names, path, fileName )
{
names = names.split( ',' );
for ( var i = 0 ; i < names.length ; i++ )
{
var name = names[ i ];
this.externals[ name ] =
{
dir : path,
file : fileName
};
}
} | javascript | function( names, path, fileName )
{
names = names.split( ',' );
for ( var i = 0 ; i < names.length ; i++ )
{
var name = names[ i ];
this.externals[ name ] =
{
dir : path,
file : fileName
};
}
} | [
"function",
"(",
"names",
",",
"path",
",",
"fileName",
")",
"{",
"names",
"=",
"names",
".",
"split",
"(",
"','",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"names",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"name",
"="... | Registers one or more resources to be loaded from an external path
instead of the core base path.
@param {String} names The resource names, separated by commas.
@param {String} path The path of the folder containing the resource.
@param {String} [fileName] The resource file name. If not provided, the
default name is us... | [
"Registers",
"one",
"or",
"more",
"resources",
"to",
"be",
"loaded",
"from",
"an",
"external",
"path",
"instead",
"of",
"the",
"core",
"base",
"path",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/resourcemanager.js#L151-L164 | |
47,619 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | postProcessList | function postProcessList( list )
{
var children = list.children,
child,
attrs,
count = list.children.length,
match,
mergeStyle,
styleTypeRegexp = /list-style-type:(.*?)(?:;|$)/,
stylesFilter = CKEDITOR.plugins.pastefromword.filters.stylesFilter;
attrs = list.attributes;
if ( sty... | javascript | function postProcessList( list )
{
var children = list.children,
child,
attrs,
count = list.children.length,
match,
mergeStyle,
styleTypeRegexp = /list-style-type:(.*?)(?:;|$)/,
stylesFilter = CKEDITOR.plugins.pastefromword.filters.stylesFilter;
attrs = list.attributes;
if ( sty... | [
"function",
"postProcessList",
"(",
"list",
")",
"{",
"var",
"children",
"=",
"list",
".",
"children",
",",
"child",
",",
"attrs",
",",
"count",
"=",
"list",
".",
"children",
".",
"length",
",",
"match",
",",
"mergeStyle",
",",
"styleTypeRegexp",
"=",
"/... | 1. move consistent list item styles up to list root. 2. clear out unnecessary list item numbering. | [
"1",
".",
"move",
"consistent",
"list",
"item",
"styles",
"up",
"to",
"list",
"root",
".",
"2",
".",
"clear",
"out",
"unnecessary",
"list",
"item",
"numbering",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L123-L169 |
47,620 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | fromRoman | function fromRoman( str )
{
str = str.toUpperCase();
var l = romans.length, retVal = 0;
for ( var i = 0; i < l; ++i )
{
for ( var j = romans[i], k = j[1].length; str.substr( 0, k ) == j[1]; str = str.substr( k ) )
retVal += j[ 0 ];
}
return retVal;
} | javascript | function fromRoman( str )
{
str = str.toUpperCase();
var l = romans.length, retVal = 0;
for ( var i = 0; i < l; ++i )
{
for ( var j = romans[i], k = j[1].length; str.substr( 0, k ) == j[1]; str = str.substr( k ) )
retVal += j[ 0 ];
}
return retVal;
} | [
"function",
"fromRoman",
"(",
"str",
")",
"{",
"str",
"=",
"str",
".",
"toUpperCase",
"(",
")",
";",
"var",
"l",
"=",
"romans",
".",
"length",
",",
"retVal",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"++",
"i",... | Convert roman numbering back to decimal. | [
"Convert",
"roman",
"numbering",
"back",
"to",
"decimal",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L184-L194 |
47,621 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | fromAlphabet | function fromAlphabet( str )
{
str = str.toUpperCase();
var l = alpahbets.length, retVal = 1;
for ( var x = 1; str.length > 0; x *= l )
{
retVal += alpahbets.indexOf( str.charAt( str.length - 1 ) ) * x;
str = str.substr( 0, str.length - 1 );
}
return retVal;
} | javascript | function fromAlphabet( str )
{
str = str.toUpperCase();
var l = alpahbets.length, retVal = 1;
for ( var x = 1; str.length > 0; x *= l )
{
retVal += alpahbets.indexOf( str.charAt( str.length - 1 ) ) * x;
str = str.substr( 0, str.length - 1 );
}
return retVal;
} | [
"function",
"fromAlphabet",
"(",
"str",
")",
"{",
"str",
"=",
"str",
".",
"toUpperCase",
"(",
")",
";",
"var",
"l",
"=",
"alpahbets",
".",
"length",
",",
"retVal",
"=",
"1",
";",
"for",
"(",
"var",
"x",
"=",
"1",
";",
"str",
".",
"length",
">",
... | Convert alphabet numbering back to decimal. | [
"Convert",
"alphabet",
"numbering",
"back",
"to",
"decimal",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L197-L207 |
47,622 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | function ( styleDefiniton, variables )
{
return function( element )
{
var styleDef =
variables ?
new CKEDITOR.style( styleDefiniton, variables )._.definition
: styleDefiniton;
element.name = styleDef.element;
CKEDITOR.tools.extend( element.attrib... | javascript | function ( styleDefiniton, variables )
{
return function( element )
{
var styleDef =
variables ?
new CKEDITOR.style( styleDefiniton, variables )._.definition
: styleDefiniton;
element.name = styleDef.element;
CKEDITOR.tools.extend( element.attrib... | [
"function",
"(",
"styleDefiniton",
",",
"variables",
")",
"{",
"return",
"function",
"(",
"element",
")",
"{",
"var",
"styleDef",
"=",
"variables",
"?",
"new",
"CKEDITOR",
".",
"style",
"(",
"styleDefiniton",
",",
"variables",
")",
".",
"_",
".",
"definiti... | Migrate the element by decorate styles on it.
@param styleDefiniton
@param variables | [
"Migrate",
"the",
"element",
"by",
"decorate",
"styles",
"on",
"it",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L687-L699 | |
47,623 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | function( styleDefinition, variableName )
{
var elementMigrateFilter = this.elementMigrateFilter;
return function( value, element )
{
// Build an stylish element first.
var styleElement = new CKEDITOR.htmlParser.element( null ),
variables = {};
variables[ variable... | javascript | function( styleDefinition, variableName )
{
var elementMigrateFilter = this.elementMigrateFilter;
return function( value, element )
{
// Build an stylish element first.
var styleElement = new CKEDITOR.htmlParser.element( null ),
variables = {};
variables[ variable... | [
"function",
"(",
"styleDefinition",
",",
"variableName",
")",
"{",
"var",
"elementMigrateFilter",
"=",
"this",
".",
"elementMigrateFilter",
";",
"return",
"function",
"(",
"value",
",",
"element",
")",
"{",
"// Build an stylish element first.\r",
"var",
"styleElement"... | Migrate styles by creating a new nested stylish element.
@param styleDefinition | [
"Migrate",
"styles",
"by",
"creating",
"a",
"new",
"nested",
"stylish",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L705-L721 | |
47,624 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/pastefromword/filter/default.js | function( element )
{
if ( CKEDITOR.env.gecko )
{
// Grab only the style definition section.
var styleDefSection = element.onlyChild().value.match( /\/\* Style Definitions \*\/([\s\S]*?)\/\*/ ),
styleDefText = styleDefSection && styleDefSection[ 1 ],
rules = {}; // ... | javascript | function( element )
{
if ( CKEDITOR.env.gecko )
{
// Grab only the style definition section.
var styleDefSection = element.onlyChild().value.match( /\/\* Style Definitions \*\/([\s\S]*?)\/\*/ ),
styleDefText = styleDefSection && styleDefSection[ 1 ],
rules = {}; // ... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"CKEDITOR",
".",
"env",
".",
"gecko",
")",
"{",
"// Grab only the style definition section.\r",
"var",
"styleDefSection",
"=",
"element",
".",
"onlyChild",
"(",
")",
".",
"value",
".",
"match",
"(",
"/",
"\\/\... | We'll drop any style sheet, but Firefox conclude certain styles in a single style element, which are required to be changed into inline ones. | [
"We",
"ll",
"drop",
"any",
"style",
"sheet",
"but",
"Firefox",
"conclude",
"certain",
"styles",
"in",
"a",
"single",
"style",
"element",
"which",
"are",
"required",
"to",
"be",
"changed",
"into",
"inline",
"ones",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/pastefromword/filter/default.js#L855-L917 | |
47,625 | mdreizin/webpack-config-stream | lib/initStream.js | initStream | function initStream(options) {
if (!_.isObject(options)) {
options = {};
}
return through.obj(function(chunk, enc, cb) {
var compilerOptions = chunk[FIELD_NAME] || {};
compilerOptions = _.merge(compilerOptions, options);
if (options.progress === true) {
compile... | javascript | function initStream(options) {
if (!_.isObject(options)) {
options = {};
}
return through.obj(function(chunk, enc, cb) {
var compilerOptions = chunk[FIELD_NAME] || {};
compilerOptions = _.merge(compilerOptions, options);
if (options.progress === true) {
compile... | [
"function",
"initStream",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isObject",
"(",
"options",
")",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"return",
"through",
".",
"obj",
"(",
"function",
"(",
"chunk",
",",
"enc",
",",
"cb",
")... | Helps to init `webpack` compiler. Can be piped.
@function
@alias initStream
@param {Object=} options
@param {Boolean} [options.useMemoryFs=false] - Uses {@link https://github.com/webpack/memory-fs memory-fs} for `compiler.outputFileSystem`. Prevents writing of emitted files to file system. `gulp.dest()` can be used. `g... | [
"Helps",
"to",
"init",
"webpack",
"compiler",
".",
"Can",
"be",
"piped",
"."
] | f8424f97837a224bc07cc18a03ecf649d708e924 | https://github.com/mdreizin/webpack-config-stream/blob/f8424f97837a224bc07cc18a03ecf649d708e924/lib/initStream.js#L23-L41 |
47,626 | shlomiassaf/resty-stone | lib/models/BaseTypeHandler.js | BaseTypeHandler | function BaseTypeHandler(ksTypeName, handlers) {
this.ksTypeName = ksTypeName;
if ("function" === typeof handlers) {
this.handlers = {default: handlers};
}
else {
this.handlers = _.extend({}, handlers);
}
} | javascript | function BaseTypeHandler(ksTypeName, handlers) {
this.ksTypeName = ksTypeName;
if ("function" === typeof handlers) {
this.handlers = {default: handlers};
}
else {
this.handlers = _.extend({}, handlers);
}
} | [
"function",
"BaseTypeHandler",
"(",
"ksTypeName",
",",
"handlers",
")",
"{",
"this",
".",
"ksTypeName",
"=",
"ksTypeName",
";",
"if",
"(",
"\"function\"",
"===",
"typeof",
"handlers",
")",
"{",
"this",
".",
"handlers",
"=",
"{",
"default",
":",
"handlers",
... | Handles transformation of keystone field types.
@param ksTypeName The name of the field
@param handlers an object with profile/handler pairs or a single function that will be the default profile handler.
@constructor | [
"Handles",
"transformation",
"of",
"keystone",
"field",
"types",
"."
] | 9ab093272ea7b68c6fe0aba45384206571896295 | https://github.com/shlomiassaf/resty-stone/blob/9ab093272ea7b68c6fe0aba45384206571896295/lib/models/BaseTypeHandler.js#L10-L20 |
47,627 | fvsch/gulp-task-maker | feedback.js | onExit | function onExit() {
if (!onExit.done) {
if (options.strict !== true) showLoadingErrors()
if (options.debug === true) showDebugInfo()
}
onExit.done = true
} | javascript | function onExit() {
if (!onExit.done) {
if (options.strict !== true) showLoadingErrors()
if (options.debug === true) showDebugInfo()
}
onExit.done = true
} | [
"function",
"onExit",
"(",
")",
"{",
"if",
"(",
"!",
"onExit",
".",
"done",
")",
"{",
"if",
"(",
"options",
".",
"strict",
"!==",
"true",
")",
"showLoadingErrors",
"(",
")",
"if",
"(",
"options",
".",
"debug",
"===",
"true",
")",
"showDebugInfo",
"("... | Show saved errors if things went wrong | [
"Show",
"saved",
"errors",
"if",
"things",
"went",
"wrong"
] | 20ab4245f2d75174786ad140793e9438c025d546 | https://github.com/fvsch/gulp-task-maker/blob/20ab4245f2d75174786ad140793e9438c025d546/feedback.js#L25-L31 |
47,628 | fvsch/gulp-task-maker | feedback.js | showDebugInfo | function showDebugInfo() {
customLog(`gulp-task-maker options:\n${util.inspect(options)}`)
for (const data of scripts) {
const info = {
callback: data.callback,
configs: data.normalizedConfigs,
errors: data.errors
}
customLog(
`gulp-task-maker script '${data.name}':\n${util.inspe... | javascript | function showDebugInfo() {
customLog(`gulp-task-maker options:\n${util.inspect(options)}`)
for (const data of scripts) {
const info = {
callback: data.callback,
configs: data.normalizedConfigs,
errors: data.errors
}
customLog(
`gulp-task-maker script '${data.name}':\n${util.inspe... | [
"function",
"showDebugInfo",
"(",
")",
"{",
"customLog",
"(",
"`",
"\\n",
"${",
"util",
".",
"inspect",
"(",
"options",
")",
"}",
"`",
")",
"for",
"(",
"const",
"data",
"of",
"scripts",
")",
"{",
"const",
"info",
"=",
"{",
"callback",
":",
"data",
... | Get debug info such as the current options and GTM state
@return {object} | [
"Get",
"debug",
"info",
"such",
"as",
"the",
"current",
"options",
"and",
"GTM",
"state"
] | 20ab4245f2d75174786ad140793e9438c025d546 | https://github.com/fvsch/gulp-task-maker/blob/20ab4245f2d75174786ad140793e9438c025d546/feedback.js#L37-L51 |
47,629 | fvsch/gulp-task-maker | feedback.js | handleError | function handleError(err, store) {
if (err && !err.plugin) {
err.plugin = 'gulp-task-maker'
}
if (Array.isArray(store)) {
store.push(err)
} else {
showError(err)
}
} | javascript | function handleError(err, store) {
if (err && !err.plugin) {
err.plugin = 'gulp-task-maker'
}
if (Array.isArray(store)) {
store.push(err)
} else {
showError(err)
}
} | [
"function",
"handleError",
"(",
"err",
",",
"store",
")",
"{",
"if",
"(",
"err",
"&&",
"!",
"err",
".",
"plugin",
")",
"{",
"err",
".",
"plugin",
"=",
"'gulp-task-maker'",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"store",
")",
")",
"{",
"store... | Store an error for later, log it instantly or throw if in strict mode
@param {object} err - error object
@param {Array} [store] - where to store the error for later | [
"Store",
"an",
"error",
"for",
"later",
"log",
"it",
"instantly",
"or",
"throw",
"if",
"in",
"strict",
"mode"
] | 20ab4245f2d75174786ad140793e9438c025d546 | https://github.com/fvsch/gulp-task-maker/blob/20ab4245f2d75174786ad140793e9438c025d546/feedback.js#L58-L67 |
47,630 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/horizontalrule/plugin.js | function( editor )
{
var hr = editor.document.createElement( 'hr' ),
range = new CKEDITOR.dom.range( editor.document );
editor.insertElement( hr );
// If there's nothing or a non-editable block followed by, establish a new paragraph
// to make sure cursor is not trapped.
range.moveToPosi... | javascript | function( editor )
{
var hr = editor.document.createElement( 'hr' ),
range = new CKEDITOR.dom.range( editor.document );
editor.insertElement( hr );
// If there's nothing or a non-editable block followed by, establish a new paragraph
// to make sure cursor is not trapped.
range.moveToPosi... | [
"function",
"(",
"editor",
")",
"{",
"var",
"hr",
"=",
"editor",
".",
"document",
".",
"createElement",
"(",
"'hr'",
")",
",",
"range",
"=",
"new",
"CKEDITOR",
".",
"dom",
".",
"range",
"(",
"editor",
".",
"document",
")",
";",
"editor",
".",
"insert... | The undo snapshot will be handled by 'insertElement'. | [
"The",
"undo",
"snapshot",
"will",
"be",
"handled",
"by",
"insertElement",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/horizontalrule/plugin.js#L15-L30 | |
47,631 | levilindsey/physx | src/util/src/geometry.js | findSquaredDistanceBetweenSegments | function findSquaredDistanceBetweenSegments(segmentA, segmentB) {
findClosestPointsFromSegmentToSegment(_segmentDistance_tmpVecA, _segmentDistance_tmpVecB,
segmentA, segmentB);
return vec3.squaredDistance(_segmentDistance_tmpVecA, _segmentDistance_tmpVecB);
} | javascript | function findSquaredDistanceBetweenSegments(segmentA, segmentB) {
findClosestPointsFromSegmentToSegment(_segmentDistance_tmpVecA, _segmentDistance_tmpVecB,
segmentA, segmentB);
return vec3.squaredDistance(_segmentDistance_tmpVecA, _segmentDistance_tmpVecB);
} | [
"function",
"findSquaredDistanceBetweenSegments",
"(",
"segmentA",
",",
"segmentB",
")",
"{",
"findClosestPointsFromSegmentToSegment",
"(",
"_segmentDistance_tmpVecA",
",",
"_segmentDistance_tmpVecB",
",",
"segmentA",
",",
"segmentB",
")",
";",
"return",
"vec3",
".",
"squ... | Finds the minimum squared distance between two line segments.
@param {LineSegment} segmentA
@param {LineSegment} segmentB
@returns {number} | [
"Finds",
"the",
"minimum",
"squared",
"distance",
"between",
"two",
"line",
"segments",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L16-L20 |
47,632 | levilindsey/physx | src/util/src/geometry.js | findSquaredDistanceFromSegmentToPoint | function findSquaredDistanceFromSegmentToPoint(segment, point) {
findClosestPointOnSegmentToPoint(_segmentDistance_tmpVecA, segment, point);
return vec3.squaredDistance(_segmentDistance_tmpVecA, point);
} | javascript | function findSquaredDistanceFromSegmentToPoint(segment, point) {
findClosestPointOnSegmentToPoint(_segmentDistance_tmpVecA, segment, point);
return vec3.squaredDistance(_segmentDistance_tmpVecA, point);
} | [
"function",
"findSquaredDistanceFromSegmentToPoint",
"(",
"segment",
",",
"point",
")",
"{",
"findClosestPointOnSegmentToPoint",
"(",
"_segmentDistance_tmpVecA",
",",
"segment",
",",
"point",
")",
";",
"return",
"vec3",
".",
"squaredDistance",
"(",
"_segmentDistance_tmpVe... | Finds the minimum squared distance between a line segment and a point.
@param {LineSegment} segment
@param {vec3} point
@returns {number} | [
"Finds",
"the",
"minimum",
"squared",
"distance",
"between",
"a",
"line",
"segment",
"and",
"a",
"point",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L29-L32 |
47,633 | levilindsey/physx | src/util/src/geometry.js | findPoiBetweenSegmentAndPlaneRegion | function findPoiBetweenSegmentAndPlaneRegion(poi, segment, planeVertex1, planeVertex2, planeVertex3,
planeVertex4) {
return findPoiBetweenSegmentAndTriangle(poi, segment, planeVertex1, planeVertex2, planeVertex3) ||
findPoiBetweenSegmentAndTriangle(poi, segment, plan... | javascript | function findPoiBetweenSegmentAndPlaneRegion(poi, segment, planeVertex1, planeVertex2, planeVertex3,
planeVertex4) {
return findPoiBetweenSegmentAndTriangle(poi, segment, planeVertex1, planeVertex2, planeVertex3) ||
findPoiBetweenSegmentAndTriangle(poi, segment, plan... | [
"function",
"findPoiBetweenSegmentAndPlaneRegion",
"(",
"poi",
",",
"segment",
",",
"planeVertex1",
",",
"planeVertex2",
",",
"planeVertex3",
",",
"planeVertex4",
")",
"{",
"return",
"findPoiBetweenSegmentAndTriangle",
"(",
"poi",
",",
"segment",
",",
"planeVertex1",
... | Finds the point of intersection between a line segment and a coplanar quadrilateral.
This assumes the region is not degenerate (has non-zero side lengths).
@param {vec3} poi Output param. Null if there is no intersection.
@param {LineSegment} segment
@param {vec3} planeVertex1
@param {vec3} planeVertex2
@param {vec3}... | [
"Finds",
"the",
"point",
"of",
"intersection",
"between",
"a",
"line",
"segment",
"and",
"a",
"coplanar",
"quadrilateral",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L116-L120 |
47,634 | levilindsey/physx | src/util/src/geometry.js | findPoiBetweenSegmentAndTriangle | function findPoiBetweenSegmentAndTriangle(poi, segment, triangleVertex1, triangleVertex2,
triangleVertex3) {
//
// Find the point of intersection between the segment and the triangle's plane.
//
// First triangle edge.
vec3.subtract(_tmpVec1, triangleVertex2, triangl... | javascript | function findPoiBetweenSegmentAndTriangle(poi, segment, triangleVertex1, triangleVertex2,
triangleVertex3) {
//
// Find the point of intersection between the segment and the triangle's plane.
//
// First triangle edge.
vec3.subtract(_tmpVec1, triangleVertex2, triangl... | [
"function",
"findPoiBetweenSegmentAndTriangle",
"(",
"poi",
",",
"segment",
",",
"triangleVertex1",
",",
"triangleVertex2",
",",
"triangleVertex3",
")",
"{",
"//",
"// Find the point of intersection between the segment and the triangle's plane.",
"//",
"// First triangle edge.",
... | Finds the point of intersection between a line segment and a triangle.
This assumes the triangle is not degenerate (has non-zero side lengths).
----------------------------------------------------------------------------
Originally based on Dan Sunday's algorithms at http://geomalgorithms.com/a06-_intersect-2.html.
... | [
"Finds",
"the",
"point",
"of",
"intersection",
"between",
"a",
"line",
"segment",
"and",
"a",
"triangle",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L145-L201 |
47,635 | levilindsey/physx | src/util/src/geometry.js | findClosestPointsFromSegmentToSegment | function findClosestPointsFromSegmentToSegment(closestA, closestB, segmentA, segmentB) {
const {distA, distB} = findClosestPointsFromLineToLine(
segmentA.start, segmentA.dir, segmentB.start, segmentB.dir);
const isDistAInBounds = distA >= 0 && distA <= 1;
const isDistBInBounds = distB >= 0 && distB <= 1;
... | javascript | function findClosestPointsFromSegmentToSegment(closestA, closestB, segmentA, segmentB) {
const {distA, distB} = findClosestPointsFromLineToLine(
segmentA.start, segmentA.dir, segmentB.start, segmentB.dir);
const isDistAInBounds = distA >= 0 && distA <= 1;
const isDistBInBounds = distB >= 0 && distB <= 1;
... | [
"function",
"findClosestPointsFromSegmentToSegment",
"(",
"closestA",
",",
"closestB",
",",
"segmentA",
",",
"segmentB",
")",
"{",
"const",
"{",
"distA",
",",
"distB",
"}",
"=",
"findClosestPointsFromLineToLine",
"(",
"segmentA",
".",
"start",
",",
"segmentA",
"."... | Finds the closest position on one line segment to the other line segment, and vice versa.
----------------------------------------------------------------------------
Originally based on Jukka Jylänki's algorithm at
https://github.com/juj/MathGeoLib/blob/ff2d348a167008c831ae304483b824647f71fbf6/src/Geometry/LineSegmen... | [
"Finds",
"the",
"closest",
"position",
"on",
"one",
"line",
"segment",
"to",
"the",
"other",
"line",
"segment",
"and",
"vice",
"versa",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L266-L324 |
47,636 | levilindsey/physx | src/util/src/geometry.js | findClosestPointOnSegmentToPoint | function findClosestPointOnSegmentToPoint(closestPoint, segment, point) {
const dirSquaredLength = vec3.squaredLength(segment.dir);
if (!dirSquaredLength) {
// The point is at the segment start.
vec3.copy(closestPoint, segment.start);
} else {
// Calculate the projection of the point onto the line ex... | javascript | function findClosestPointOnSegmentToPoint(closestPoint, segment, point) {
const dirSquaredLength = vec3.squaredLength(segment.dir);
if (!dirSquaredLength) {
// The point is at the segment start.
vec3.copy(closestPoint, segment.start);
} else {
// Calculate the projection of the point onto the line ex... | [
"function",
"findClosestPointOnSegmentToPoint",
"(",
"closestPoint",
",",
"segment",
",",
"point",
")",
"{",
"const",
"dirSquaredLength",
"=",
"vec3",
".",
"squaredLength",
"(",
"segment",
".",
"dir",
")",
";",
"if",
"(",
"!",
"dirSquaredLength",
")",
"{",
"//... | Finds the closest position on a line segment to a point.
----------------------------------------------------------------------------
Originally based on Jukka Jylänki's algorithm at
https://github.com/juj/MathGeoLib/blob/ff2d348a167008c831ae304483b824647f71fbf6/src/Geometry/LineSegment.cpp.
Copyright 2011 Jukka Jylä... | [
"Finds",
"the",
"closest",
"position",
"on",
"a",
"line",
"segment",
"to",
"a",
"point",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L353-L375 |
47,637 | levilindsey/physx | src/util/src/geometry.js | findClosestPointsFromLineToLine | function findClosestPointsFromLineToLine(startA, dirA, startB, dirB) {
vec3.subtract(_tmpVec1, startA, startB);
const dirBDotDirAToB = vec3.dot(dirB, _tmpVec1);
const dirADotDirAToB = vec3.dot(dirA, _tmpVec1);
const sqrLenDirB = vec3.squaredLength(dirB);
const sqrLenDirA = vec3.squaredLength(dirA);
const ... | javascript | function findClosestPointsFromLineToLine(startA, dirA, startB, dirB) {
vec3.subtract(_tmpVec1, startA, startB);
const dirBDotDirAToB = vec3.dot(dirB, _tmpVec1);
const dirADotDirAToB = vec3.dot(dirA, _tmpVec1);
const sqrLenDirB = vec3.squaredLength(dirB);
const sqrLenDirA = vec3.squaredLength(dirA);
const ... | [
"function",
"findClosestPointsFromLineToLine",
"(",
"startA",
",",
"dirA",
",",
"startB",
",",
"dirB",
")",
"{",
"vec3",
".",
"subtract",
"(",
"_tmpVec1",
",",
"startA",
",",
"startB",
")",
";",
"const",
"dirBDotDirAToB",
"=",
"vec3",
".",
"dot",
"(",
"dir... | Finds the closest position on one line to the other line, and vice versa.
The positions are represented as scalar-value distances from the "start" positions of each line.
These are scaled according to the given direction vectors.
----------------------------------------------------------------------------
Originally ... | [
"Finds",
"the",
"closest",
"position",
"on",
"one",
"line",
"to",
"the",
"other",
"line",
"and",
"vice",
"versa",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/util/src/geometry.js#L408-L429 |
47,638 | levilindsey/physx | src/collisions/src/collision-handler.js | handleCollisionsForJob | function handleCollisionsForJob(job, elapsedTime, physicsParams) {
const collidable = job.collidable;
// Clear any previous collision info.
collidable.previousCollisions = collidable.collisions;
collidable.collisions = [];
// Find all colliding collidables.
const collidingCollidables = findIntersectingCol... | javascript | function handleCollisionsForJob(job, elapsedTime, physicsParams) {
const collidable = job.collidable;
// Clear any previous collision info.
collidable.previousCollisions = collidable.collisions;
collidable.collisions = [];
// Find all colliding collidables.
const collidingCollidables = findIntersectingCol... | [
"function",
"handleCollisionsForJob",
"(",
"job",
",",
"elapsedTime",
",",
"physicsParams",
")",
"{",
"const",
"collidable",
"=",
"job",
".",
"collidable",
";",
"// Clear any previous collision info.",
"collidable",
".",
"previousCollisions",
"=",
"collidable",
".",
"... | This module defines a collision pipeline.
These functions will detect collisions between collidable bodies and update their momenta in
response to the collisions.
- Consists of an efficient broad-phase collision detection step followed by a precise
narrow-phase step.
- Calculates the position, surface normal, and tim... | [
"This",
"module",
"defines",
"a",
"collision",
"pipeline",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L99-L117 |
47,639 | levilindsey/physx | src/collisions/src/collision-handler.js | checkThatNoObjectsCollide | function checkThatNoObjectsCollide() {
// Broad-phase collision detection (pairs whose bounding volumes intersect).
let collisions = collidableStore.getPossibleCollisionsForAllCollidables();
// Narrow-phase collision detection (pairs that actually intersect).
collisions = _detectPreciseCollisionsFromCollisions... | javascript | function checkThatNoObjectsCollide() {
// Broad-phase collision detection (pairs whose bounding volumes intersect).
let collisions = collidableStore.getPossibleCollisionsForAllCollidables();
// Narrow-phase collision detection (pairs that actually intersect).
collisions = _detectPreciseCollisionsFromCollisions... | [
"function",
"checkThatNoObjectsCollide",
"(",
")",
"{",
"// Broad-phase collision detection (pairs whose bounding volumes intersect).",
"let",
"collisions",
"=",
"collidableStore",
".",
"getPossibleCollisionsForAllCollidables",
"(",
")",
";",
"// Narrow-phase collision detection (pairs... | Logs a warning message for any pair of objects that intersect. | [
"Logs",
"a",
"warning",
"message",
"for",
"any",
"pair",
"of",
"objects",
"that",
"intersect",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L147-L157 |
47,640 | levilindsey/physx | src/collisions/src/collision-handler.js | _recordCollisions | function _recordCollisions(collidable, collidingCollidables, elapsedTime) {
return collidingCollidables.map(other => {
const collision = {
collidableA: collidable,
collidableB: other,
time: elapsedTime
};
// Record the fact that these objects collided (the ModelController may want to ha... | javascript | function _recordCollisions(collidable, collidingCollidables, elapsedTime) {
return collidingCollidables.map(other => {
const collision = {
collidableA: collidable,
collidableB: other,
time: elapsedTime
};
// Record the fact that these objects collided (the ModelController may want to ha... | [
"function",
"_recordCollisions",
"(",
"collidable",
",",
"collidingCollidables",
",",
"elapsedTime",
")",
"{",
"return",
"collidingCollidables",
".",
"map",
"(",
"other",
"=>",
"{",
"const",
"collision",
"=",
"{",
"collidableA",
":",
"collidable",
",",
"collidable... | Create collision objects that record the time of collision and the collidables in the collision.
Also record references to these collisions on the collidables.
@param {Collidable} collidable
@param {Array.<Collidable>} collidingCollidables
@param {DOMHighResTimeStamp} elapsedTime
@returns {Array.<Collision>}
@private | [
"Create",
"collision",
"objects",
"that",
"record",
"the",
"time",
"of",
"collision",
"and",
"the",
"collidables",
"in",
"the",
"collision",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L170-L184 |
47,641 | levilindsey/physx | src/collisions/src/collision-handler.js | _detectPreciseCollisionsFromCollisions | function _detectPreciseCollisionsFromCollisions(collisions) {
return collisions.filter(collision => {
// TODO:
// - Use temporal bisection with discrete sub-time steps to find time of collision (use
// x-vs-y-specific intersection detection methods).
// - Make sure the collision object is set up... | javascript | function _detectPreciseCollisionsFromCollisions(collisions) {
return collisions.filter(collision => {
// TODO:
// - Use temporal bisection with discrete sub-time steps to find time of collision (use
// x-vs-y-specific intersection detection methods).
// - Make sure the collision object is set up... | [
"function",
"_detectPreciseCollisionsFromCollisions",
"(",
"collisions",
")",
"{",
"return",
"collisions",
".",
"filter",
"(",
"collision",
"=>",
"{",
"// TODO:",
"// - Use temporal bisection with discrete sub-time steps to find time of collision (use",
"// x-vs-y-specific inte... | Narrow-phase collision detection.
Given a list of possible collision pairs, filter out which pairs are actually colliding.
@param {Array.<Collision>} collisions
@returns {Array.<Collision>}
@private | [
"Narrow",
"-",
"phase",
"collision",
"detection",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L195-L206 |
47,642 | levilindsey/physx | src/collisions/src/collision-handler.js | _resolveCollisions | function _resolveCollisions(collisions, physicsParams) {
collisions.forEach(collision => {
// If neither physics job needs the standard collision restitution, then don't do it.
if (_notifyPhysicsJobsOfCollision(collision)) {
if (collision.collidableA.physicsJob && collision.collidableB.physicsJob) {
... | javascript | function _resolveCollisions(collisions, physicsParams) {
collisions.forEach(collision => {
// If neither physics job needs the standard collision restitution, then don't do it.
if (_notifyPhysicsJobsOfCollision(collision)) {
if (collision.collidableA.physicsJob && collision.collidableB.physicsJob) {
... | [
"function",
"_resolveCollisions",
"(",
"collisions",
",",
"physicsParams",
")",
"{",
"collisions",
".",
"forEach",
"(",
"collision",
"=>",
"{",
"// If neither physics job needs the standard collision restitution, then don't do it.",
"if",
"(",
"_notifyPhysicsJobsOfCollision",
"... | Updates the linear and angular momenta of each body in response to its collision.
@param {Array.<Collision>} collisions
@param {PhysicsConfig} physicsParams
@private | [
"Updates",
"the",
"linear",
"and",
"angular",
"momenta",
"of",
"each",
"body",
"in",
"response",
"to",
"its",
"collision",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L248-L261 |
47,643 | levilindsey/physx | src/collisions/src/collision-handler.js | _resolveCollision | function _resolveCollision(collision, physicsParams) {
const collidableA = collision.collidableA;
const collidableB = collision.collidableB;
const previousStateA = collidableA.physicsJob.previousState;
const previousStateB = collidableB.physicsJob.previousState;
const nextStateA = collidableA.physicsJob.curre... | javascript | function _resolveCollision(collision, physicsParams) {
const collidableA = collision.collidableA;
const collidableB = collision.collidableB;
const previousStateA = collidableA.physicsJob.previousState;
const previousStateB = collidableB.physicsJob.previousState;
const nextStateA = collidableA.physicsJob.curre... | [
"function",
"_resolveCollision",
"(",
"collision",
",",
"physicsParams",
")",
"{",
"const",
"collidableA",
"=",
"collision",
".",
"collidableA",
";",
"const",
"collidableB",
"=",
"collision",
".",
"collidableB",
";",
"const",
"previousStateA",
"=",
"collidableA",
... | Resolve a collision between two moving, physics-based objects.
This is based on collision-response algorithms from Wikipedia
(https://en.wikipedia.org/wiki/Collision_response#Impulse-based_reaction_model).
@param {Collision} collision
@param {PhysicsConfig} physicsParams
@private | [
"Resolve",
"a",
"collision",
"between",
"two",
"moving",
"physics",
"-",
"based",
"objects",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L284-L349 |
47,644 | levilindsey/physx | src/collisions/src/collision-handler.js | _resolveCollisionWithStationaryObject | function _resolveCollisionWithStationaryObject(collision, physicsParams) {
const contactNormal = collision.contactNormal;
let physicsCollidable;
if (collision.collidableA.physicsJob) {
physicsCollidable = collision.collidableA;
} else {
physicsCollidable = collision.collidableB;
vec3.negate(contact... | javascript | function _resolveCollisionWithStationaryObject(collision, physicsParams) {
const contactNormal = collision.contactNormal;
let physicsCollidable;
if (collision.collidableA.physicsJob) {
physicsCollidable = collision.collidableA;
} else {
physicsCollidable = collision.collidableB;
vec3.negate(contact... | [
"function",
"_resolveCollisionWithStationaryObject",
"(",
"collision",
",",
"physicsParams",
")",
"{",
"const",
"contactNormal",
"=",
"collision",
".",
"contactNormal",
";",
"let",
"physicsCollidable",
";",
"if",
"(",
"collision",
".",
"collidableA",
".",
"physicsJob"... | Resolve a collision between one moving, physics-based object and one stationary object.
@param {Collision} collision
@param {PhysicsConfig} physicsParams
@private | [
"Resolve",
"a",
"collision",
"between",
"one",
"moving",
"physics",
"-",
"based",
"object",
"and",
"one",
"stationary",
"object",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collision-handler.js#L358-L410 |
47,645 | mdreizin/webpack-config-stream | lib/proxyStream.js | proxyStream | function proxyStream(err, stats) {
return through.obj(function(chunk, enc, cb) {
processStats.call(this, chunk, stats);
if (_.isError(err)) {
this.emit('error', wrapError(err));
}
cb(null, chunk);
});
} | javascript | function proxyStream(err, stats) {
return through.obj(function(chunk, enc, cb) {
processStats.call(this, chunk, stats);
if (_.isError(err)) {
this.emit('error', wrapError(err));
}
cb(null, chunk);
});
} | [
"function",
"proxyStream",
"(",
"err",
",",
"stats",
")",
"{",
"return",
"through",
".",
"obj",
"(",
"function",
"(",
"chunk",
",",
"enc",
",",
"cb",
")",
"{",
"processStats",
".",
"call",
"(",
"this",
",",
"chunk",
",",
"stats",
")",
";",
"if",
"(... | Re-uses existing `err` and `stats` objects. Can be piped.
@function
@alias proxyStream
@param {Error=} err
@param {Stats=} stats
@returns {Stream} | [
"Re",
"-",
"uses",
"existing",
"err",
"and",
"stats",
"objects",
".",
"Can",
"be",
"piped",
"."
] | f8424f97837a224bc07cc18a03ecf649d708e924 | https://github.com/mdreizin/webpack-config-stream/blob/f8424f97837a224bc07cc18a03ecf649d708e924/lib/proxyStream.js#L16-L26 |
47,646 | verbose/verb-cli | bin/verb.js | run | function run(env) {
console.log(); // empty line
var verbfile = env.configPath;
if (versionFlag && tasks.length === 0) {
verbLog('CLI version', pkg.version);
if (env.modulePackage && typeof env.modulePackage.version !== 'undefined') {
verbLog('Local version', env.modulePackage.version);
}
}
... | javascript | function run(env) {
console.log(); // empty line
var verbfile = env.configPath;
if (versionFlag && tasks.length === 0) {
verbLog('CLI version', pkg.version);
if (env.modulePackage && typeof env.modulePackage.version !== 'undefined') {
verbLog('Local version', env.modulePackage.version);
}
}
... | [
"function",
"run",
"(",
"env",
")",
"{",
"console",
".",
"log",
"(",
")",
";",
"// empty line",
"var",
"verbfile",
"=",
"env",
".",
"configPath",
";",
"if",
"(",
"versionFlag",
"&&",
"tasks",
".",
"length",
"===",
"0",
")",
"{",
"verbLog",
"(",
"'CLI... | the actual logic | [
"the",
"actual",
"logic"
] | f42621b3e43a631b1df40917ab5ecb9c0ff437b9 | https://github.com/verbose/verb-cli/blob/f42621b3e43a631b1df40917ab5ecb9c0ff437b9/bin/verb.js#L98-L155 |
47,647 | hash-bang/conkie-stats | modules/feedRSSAtom.js | callbackParser | function callbackParser(err, out) {
if (err) {
error += err + '\n\n';
} else {
results[counter] = out;
}
counter++;
if (counter === urlLength) {
let result = {sources: [], feeds: []};
let i = 0;
_.each(results, feed => {
feed.metadata.lastBuildDate = moment(feed.metadata.lastBuildDate).format('x');
... | javascript | function callbackParser(err, out) {
if (err) {
error += err + '\n\n';
} else {
results[counter] = out;
}
counter++;
if (counter === urlLength) {
let result = {sources: [], feeds: []};
let i = 0;
_.each(results, feed => {
feed.metadata.lastBuildDate = moment(feed.metadata.lastBuildDate).format('x');
... | [
"function",
"callbackParser",
"(",
"err",
",",
"out",
")",
"{",
"if",
"(",
"err",
")",
"{",
"error",
"+=",
"err",
"+",
"'\\n\\n'",
";",
"}",
"else",
"{",
"results",
"[",
"counter",
"]",
"=",
"out",
";",
"}",
"counter",
"++",
";",
"if",
"(",
"coun... | Callback call when parser is finished
@param err {string} Error reported
@param out {json} Data returned | [
"Callback",
"call",
"when",
"parser",
"is",
"finished"
] | c81775b305efb33a5788325ab851d4f356b240f5 | https://github.com/hash-bang/conkie-stats/blob/c81775b305efb33a5788325ab851d4f356b240f5/modules/feedRSSAtom.js#L66-L106 |
47,648 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/maximize/plugin.js | resizeHandler | function resizeHandler()
{
var viewPaneSize = mainWindow.getViewPaneSize();
shim && shim.setStyles( { width : viewPaneSize.width + 'px', height : viewPaneSize.height + 'px' } );
editor.resize( viewPaneSize.width, viewPaneSize.height, null, true );
} | javascript | function resizeHandler()
{
var viewPaneSize = mainWindow.getViewPaneSize();
shim && shim.setStyles( { width : viewPaneSize.width + 'px', height : viewPaneSize.height + 'px' } );
editor.resize( viewPaneSize.width, viewPaneSize.height, null, true );
} | [
"function",
"resizeHandler",
"(",
")",
"{",
"var",
"viewPaneSize",
"=",
"mainWindow",
".",
"getViewPaneSize",
"(",
")",
";",
"shim",
"&&",
"shim",
".",
"setStyles",
"(",
"{",
"width",
":",
"viewPaneSize",
".",
"width",
"+",
"'px'",
",",
"height",
":",
"v... | Saved resize handler function. | [
"Saved",
"resize",
"handler",
"function",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/maximize/plugin.js#L145-L150 |
47,649 | taylor1791/promissory-arbiter | src/spec/promissory-arbiter.spec.js | p1so | function p1so (topic1, topic2) {
pub(topic1, null, {persist: true});
var spy = sub(topic2);
return spy;
} | javascript | function p1so (topic1, topic2) {
pub(topic1, null, {persist: true});
var spy = sub(topic2);
return spy;
} | [
"function",
"p1so",
"(",
"topic1",
",",
"topic2",
")",
"{",
"pub",
"(",
"topic1",
",",
"null",
",",
"{",
"persist",
":",
"true",
"}",
")",
";",
"var",
"spy",
"=",
"sub",
"(",
"topic2",
")",
";",
"return",
"spy",
";",
"}"
] | Publish 1 Subscribe Other | [
"Publish",
"1",
"Subscribe",
"Other"
] | 6327b87efd9ee997cbfaa009164dac266d9e16c2 | https://github.com/taylor1791/promissory-arbiter/blob/6327b87efd9ee997cbfaa009164dac266d9e16c2/src/spec/promissory-arbiter.spec.js#L754-L758 |
47,650 | taylor1791/promissory-arbiter | src/spec/promissory-arbiter.spec.js | subPubArg | function subPubArg (topic, data, i) {
var spy = sub(topic);
pub(topic, data);
var args = spy.calls.first().args;
return typeof i === 'undefined' ? args : args[i];
} | javascript | function subPubArg (topic, data, i) {
var spy = sub(topic);
pub(topic, data);
var args = spy.calls.first().args;
return typeof i === 'undefined' ? args : args[i];
} | [
"function",
"subPubArg",
"(",
"topic",
",",
"data",
",",
"i",
")",
"{",
"var",
"spy",
"=",
"sub",
"(",
"topic",
")",
";",
"pub",
"(",
"topic",
",",
"data",
")",
";",
"var",
"args",
"=",
"spy",
".",
"calls",
".",
"first",
"(",
")",
".",
"args",
... | Subscribes to a topic, publishes data and returns the specified arguemnts | [
"Subscribes",
"to",
"a",
"topic",
"publishes",
"data",
"and",
"returns",
"the",
"specified",
"arguemnts"
] | 6327b87efd9ee997cbfaa009164dac266d9e16c2 | https://github.com/taylor1791/promissory-arbiter/blob/6327b87efd9ee997cbfaa009164dac266d9e16c2/src/spec/promissory-arbiter.spec.js#L768-L774 |
47,651 | saggiyogesh/nodeportal | public/js/jquery.fileupload-ui.js | function (options) {
var processQueue = [];
$.each(options.processQueue, function () {
var settings = {},
action = this.action,
prefix = this.prefix === true ? action : this.prefix;
$.each(this, function (key, value) {
... | javascript | function (options) {
var processQueue = [];
$.each(options.processQueue, function () {
var settings = {},
action = this.action,
prefix = this.prefix === true ? action : this.prefix;
$.each(this, function (key, value) {
... | [
"function",
"(",
"options",
")",
"{",
"var",
"processQueue",
"=",
"[",
"]",
";",
"$",
".",
"each",
"(",
"options",
".",
"processQueue",
",",
"function",
"(",
")",
"{",
"var",
"settings",
"=",
"{",
"}",
",",
"action",
"=",
"this",
".",
"action",
","... | Replaces the settings of each processQueue item that are strings starting with an "@", using the remaining substring as key for the option map, e.g. "@autoUpload" is replaced with options.autoUpload: | [
"Replaces",
"the",
"settings",
"of",
"each",
"processQueue",
"item",
"that",
"are",
"strings",
"starting",
"with",
"an"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/js/jquery.fileupload-ui.js#L738-L759 | |
47,652 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/link/plugin.js | function( editor )
{
try
{
var selection = editor.getSelection();
if ( selection.getType() == CKEDITOR.SELECTION_ELEMENT )
{
var selectedElement = selection.getSelectedElement();
if ( selectedElement.is( 'a' ) )
return selectedElement;
}
var range = selection.getRanges( tru... | javascript | function( editor )
{
try
{
var selection = editor.getSelection();
if ( selection.getType() == CKEDITOR.SELECTION_ELEMENT )
{
var selectedElement = selection.getSelectedElement();
if ( selectedElement.is( 'a' ) )
return selectedElement;
}
var range = selection.getRanges( tru... | [
"function",
"(",
"editor",
")",
"{",
"try",
"{",
"var",
"selection",
"=",
"editor",
".",
"getSelection",
"(",
")",
";",
"if",
"(",
"selection",
".",
"getType",
"(",
")",
"==",
"CKEDITOR",
".",
"SELECTION_ELEMENT",
")",
"{",
"var",
"selectedElement",
"=",... | Get the surrounding link element of current selection.
@param editor
@example CKEDITOR.plugins.link.getSelectedLink( editor );
@since 3.2.1
The following selection will all return the link element.
<pre>
<a href="#">li^nk</a>
<a href="#">[link]</a>
text[<a href="#">link]</a>
<a href="#">li[nk</a>]
[<b><a href="#">li]nk... | [
"Get",
"the",
"surrounding",
"link",
"element",
"of",
"current",
"selection",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/link/plugin.js#L265-L283 | |
47,653 | levilindsey/physx | src/collisions/contact-calculation/src/obb-contact-calculation.js | obbVsSphere | function obbVsSphere(contactPoint, contactNormal, obb, sphere) {
findClosestPointFromObbToPoint(contactPoint, obb, sphere.centerOfVolume);
vec3.subtract(contactNormal, sphere.centerOfVolume, contactPoint);
vec3.normalize(contactNormal, contactNormal);
} | javascript | function obbVsSphere(contactPoint, contactNormal, obb, sphere) {
findClosestPointFromObbToPoint(contactPoint, obb, sphere.centerOfVolume);
vec3.subtract(contactNormal, sphere.centerOfVolume, contactPoint);
vec3.normalize(contactNormal, contactNormal);
} | [
"function",
"obbVsSphere",
"(",
"contactPoint",
",",
"contactNormal",
",",
"obb",
",",
"sphere",
")",
"{",
"findClosestPointFromObbToPoint",
"(",
"contactPoint",
",",
"obb",
",",
"sphere",
".",
"centerOfVolume",
")",
";",
"vec3",
".",
"subtract",
"(",
"contactNo... | Finds the closest point anywhere inside the OBB to the center of the sphere.
@param {vec3} contactPoint Output param.
@param {vec3} contactNormal Output param.
@param {Obb} obb
@param {Sphere} sphere | [
"Finds",
"the",
"closest",
"point",
"anywhere",
"inside",
"the",
"OBB",
"to",
"the",
"center",
"of",
"the",
"sphere",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/contact-calculation/src/obb-contact-calculation.js#L42-L46 |
47,654 | gpolitis/node-tarantula | lib/ResourcePool.js | ResourcePool | function ResourcePool (options) {
this.max = options.max || 1;
this.maxUses = options.maxUses || 1;
this.create = options.create || function () {};
this.destroy = options.destroy || function () {};
this.active = 0;
this.resources = new Array(this.max);
this.resourceActive = new Array(this.max);
this.resourceUse... | javascript | function ResourcePool (options) {
this.max = options.max || 1;
this.maxUses = options.maxUses || 1;
this.create = options.create || function () {};
this.destroy = options.destroy || function () {};
this.active = 0;
this.resources = new Array(this.max);
this.resourceActive = new Array(this.max);
this.resourceUse... | [
"function",
"ResourcePool",
"(",
"options",
")",
"{",
"this",
".",
"max",
"=",
"options",
".",
"max",
"||",
"1",
";",
"this",
".",
"maxUses",
"=",
"options",
".",
"maxUses",
"||",
"1",
";",
"this",
".",
"create",
"=",
"options",
".",
"create",
"||",
... | Class for managing a pool of resources
@param {object} options
@param {int} options.max
Maximum number of resources to keep
@param {int} options.maxUses
Maximum number of times a resource may be used
@param {function} options.create
Called to create a new Resource
@param {function} options.destroy
Called to destroy an... | [
"Class",
"for",
"managing",
"a",
"pool",
"of",
"resources"
] | fd5bfdff5c287244bd5b4a871074a7a67c37387d | https://github.com/gpolitis/node-tarantula/blob/fd5bfdff5c287244bd5b4a871074a7a67c37387d/lib/ResourcePool.js#L15-L24 |
47,655 | bigpipe/fittings | index.js | Fittings | function Fittings(bigpipe) {
if (!this.name) throw new Error('The fittings.name property is required.');
this.ultron = new Ultron(bigpipe);
this.bigpipe = bigpipe;
this.setup();
} | javascript | function Fittings(bigpipe) {
if (!this.name) throw new Error('The fittings.name property is required.');
this.ultron = new Ultron(bigpipe);
this.bigpipe = bigpipe;
this.setup();
} | [
"function",
"Fittings",
"(",
"bigpipe",
")",
"{",
"if",
"(",
"!",
"this",
".",
"name",
")",
"throw",
"new",
"Error",
"(",
"'The fittings.name property is required.'",
")",
";",
"this",
".",
"ultron",
"=",
"new",
"Ultron",
"(",
"bigpipe",
")",
";",
"this",
... | Fittings is the default framework provider for BigPipe.
@constructor
@param {BigPipe} bigpipe
@api public | [
"Fittings",
"is",
"the",
"default",
"framework",
"provider",
"for",
"BigPipe",
"."
] | 3fc601c7835eec9c4c222fe78003af02a13671b0 | https://github.com/bigpipe/fittings/blob/3fc601c7835eec9c4c222fe78003af02a13671b0/index.js#L31-L38 |
47,656 | bigpipe/fittings | index.js | makeitso | function makeitso(where) {
if ('string' === typeof where) {
where = {
expose: path.basename(where).replace(new RegExp(path.extname(where).replace('.', '\\.') +'$'), ''),
path: where
};
}
return where;
} | javascript | function makeitso(where) {
if ('string' === typeof where) {
where = {
expose: path.basename(where).replace(new RegExp(path.extname(where).replace('.', '\\.') +'$'), ''),
path: where
};
}
return where;
} | [
"function",
"makeitso",
"(",
"where",
")",
"{",
"if",
"(",
"'string'",
"===",
"typeof",
"where",
")",
"{",
"where",
"=",
"{",
"expose",
":",
"path",
".",
"basename",
"(",
"where",
")",
".",
"replace",
"(",
"new",
"RegExp",
"(",
"path",
".",
"extname"... | As the libraries as run through browserify it makes sense to give them
a custom export name. When it's an object we assume that they already
follow our required structure. If this is not the case we use the filename
as the name it should be exposed under.
@param {String|Object} where Either the location of a file or o... | [
"As",
"the",
"libraries",
"as",
"run",
"through",
"browserify",
"it",
"makes",
"sense",
"to",
"give",
"them",
"a",
"custom",
"export",
"name",
".",
"When",
"it",
"s",
"an",
"object",
"we",
"assume",
"that",
"they",
"already",
"follow",
"our",
"required",
... | 3fc601c7835eec9c4c222fe78003af02a13671b0 | https://github.com/bigpipe/fittings/blob/3fc601c7835eec9c4c222fe78003af02a13671b0/index.js#L117-L126 |
47,657 | saggiyogesh/nodeportal | lib/Mailer/MailMessage.js | Attachment | function Attachment(options) {
this.fileName = options.fileName;
this.contents = options.contents;
this.filePath = options.filePath;
this.streamSource = options.streamSource;
this.contentType = options.contentType;
this.cid = options.cid;
} | javascript | function Attachment(options) {
this.fileName = options.fileName;
this.contents = options.contents;
this.filePath = options.filePath;
this.streamSource = options.streamSource;
this.contentType = options.contentType;
this.cid = options.cid;
} | [
"function",
"Attachment",
"(",
"options",
")",
"{",
"this",
".",
"fileName",
"=",
"options",
".",
"fileName",
";",
"this",
".",
"contents",
"=",
"options",
".",
"contents",
";",
"this",
".",
"filePath",
"=",
"options",
".",
"filePath",
";",
"this",
".",
... | Attachment constructor.
Options of nodemailer attachment are available
@constructor | [
"Attachment",
"constructor",
".",
"Options",
"of",
"nodemailer",
"attachment",
"are",
"available"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/Mailer/MailMessage.js#L14-L21 |
47,658 | gpolitis/node-tarantula | lib/tarantula.js | trimHash | function trimHash (uri) {
var indexOfHash = uri.indexOf('#');
return (indexOfHash != -1) ? uri.substring(0, indexOfHash) : uri;
} | javascript | function trimHash (uri) {
var indexOfHash = uri.indexOf('#');
return (indexOfHash != -1) ? uri.substring(0, indexOfHash) : uri;
} | [
"function",
"trimHash",
"(",
"uri",
")",
"{",
"var",
"indexOfHash",
"=",
"uri",
".",
"indexOf",
"(",
"'#'",
")",
";",
"return",
"(",
"indexOfHash",
"!=",
"-",
"1",
")",
"?",
"uri",
".",
"substring",
"(",
"0",
",",
"indexOfHash",
")",
":",
"uri",
";... | Remove Hash part of a URL
@param {string} uri
The URL to remove hash from
@return {string}
The URL without hash | [
"Remove",
"Hash",
"part",
"of",
"a",
"URL"
] | fd5bfdff5c287244bd5b4a871074a7a67c37387d | https://github.com/gpolitis/node-tarantula/blob/fd5bfdff5c287244bd5b4a871074a7a67c37387d/lib/tarantula.js#L346-L349 |
47,659 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/scayt/plugin.js | in_array | function in_array( needle, haystack )
{
var found = 0,
key;
for ( key in haystack )
{
if ( haystack[ key ] == needle )
{
found = 1;
break;
}
}
return found;
} | javascript | function in_array( needle, haystack )
{
var found = 0,
key;
for ( key in haystack )
{
if ( haystack[ key ] == needle )
{
found = 1;
break;
}
}
return found;
} | [
"function",
"in_array",
"(",
"needle",
",",
"haystack",
")",
"{",
"var",
"found",
"=",
"0",
",",
"key",
";",
"for",
"(",
"key",
"in",
"haystack",
")",
"{",
"if",
"(",
"haystack",
"[",
"key",
"]",
"==",
"needle",
")",
"{",
"found",
"=",
"1",
";",
... | Checks if a value exists in an array | [
"Checks",
"if",
"a",
"value",
"exists",
"in",
"an",
"array"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/scayt/plugin.js#L17-L30 |
47,660 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/scayt/plugin.js | function( editor, buttonName, buttonLabel, commandName, command, menugroup, menuOrder )
{
editor.addCommand( commandName, command );
// If the "menu" plugin is loaded, register the menu item.
editor.addMenuItem( commandName,
{
label : buttonLabel,
command : commandName,
group : menugroup... | javascript | function( editor, buttonName, buttonLabel, commandName, command, menugroup, menuOrder )
{
editor.addCommand( commandName, command );
// If the "menu" plugin is loaded, register the menu item.
editor.addMenuItem( commandName,
{
label : buttonLabel,
command : commandName,
group : menugroup... | [
"function",
"(",
"editor",
",",
"buttonName",
",",
"buttonLabel",
",",
"commandName",
",",
"command",
",",
"menugroup",
",",
"menuOrder",
")",
"{",
"editor",
".",
"addCommand",
"(",
"commandName",
",",
"command",
")",
";",
"// If the \"menu\" plugin is loaded, reg... | Context menu constructing. | [
"Context",
"menu",
"constructing",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/scayt/plugin.js#L447-L459 | |
47,661 | saggiyogesh/nodeportal | plugins/managePlugin/client/js/managePlugin.js | handlePermissionUpdate | function handlePermissionUpdate() {
permissionArea.find("form").submit(function (e) {
e.preventDefault();
//console.log(e);
var form = e.currentTarget;
appendFormFields(form);
Rocket.Util.submitFormAsync(form, function (response... | javascript | function handlePermissionUpdate() {
permissionArea.find("form").submit(function (e) {
e.preventDefault();
//console.log(e);
var form = e.currentTarget;
appendFormFields(form);
Rocket.Util.submitFormAsync(form, function (response... | [
"function",
"handlePermissionUpdate",
"(",
")",
"{",
"permissionArea",
".",
"find",
"(",
"\"form\"",
")",
".",
"submit",
"(",
"function",
"(",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"//console.log(e);",
"var",
"form",
"=",
"e",
".",
"c... | open permissions on tab click | [
"open",
"permissions",
"on",
"tab",
"click"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/plugins/managePlugin/client/js/managePlugin.js#L51-L64 |
47,662 | ForbesLindesay/stop | lib/manifest.js | addManifest | function addManifest(file, options) {
file = file || '/app.manifest';
var stream = new Transform({objectMode: true});
var domains = {};
var hostProtocols = {};
stream._transform = function (page, _, callback) {
if (!(options && options.justManifests)) {
if (page.statusCode !== 404 || url.resolve(pa... | javascript | function addManifest(file, options) {
file = file || '/app.manifest';
var stream = new Transform({objectMode: true});
var domains = {};
var hostProtocols = {};
stream._transform = function (page, _, callback) {
if (!(options && options.justManifests)) {
if (page.statusCode !== 404 || url.resolve(pa... | [
"function",
"addManifest",
"(",
"file",
",",
"options",
")",
"{",
"file",
"=",
"file",
"||",
"'/app.manifest'",
";",
"var",
"stream",
"=",
"new",
"Transform",
"(",
"{",
"objectMode",
":",
"true",
"}",
")",
";",
"var",
"domains",
"=",
"{",
"}",
";",
"... | Add cache manifest files to the stream.
Options:
- justManifests - set to `true` to only emit the manifest files.
- addLinks - set to `true` to add <link href="/app.manifest" rel="manifest"/> to each html page.
@param {String} file
@param {Ojbect} options
@returns {TransformStream} | [
"Add",
"cache",
"manifest",
"files",
"to",
"the",
"stream",
"."
] | 61db8899bdde604dc45cfc8f11fffa1beaa27abb | https://github.com/ForbesLindesay/stop/blob/61db8899bdde604dc45cfc8f11fffa1beaa27abb/lib/manifest.js#L24-L73 |
47,663 | h0x91b/ESB-node-driver | examples/bench-requester.js | report | function report(){
if(responses < 1) return;
var dt = new Date - starttime;
console.log(
'%s invokes per second, avg request time: %s ms, worst: %s ms, best: %s ms, invokes without response in queue: %s',
(responses/dt*1000).toFixed(2),
(totaltime/responses).toFixed(2),
maxtime,
mintime,
Obje... | javascript | function report(){
if(responses < 1) return;
var dt = new Date - starttime;
console.log(
'%s invokes per second, avg request time: %s ms, worst: %s ms, best: %s ms, invokes without response in queue: %s',
(responses/dt*1000).toFixed(2),
(totaltime/responses).toFixed(2),
maxtime,
mintime,
Obje... | [
"function",
"report",
"(",
")",
"{",
"if",
"(",
"responses",
"<",
"1",
")",
"return",
";",
"var",
"dt",
"=",
"new",
"Date",
"-",
"starttime",
";",
"console",
".",
"log",
"(",
"'%s invokes per second, avg request time: %s ms, worst: %s ms, best: %s ms, invokes withou... | ,5); | [
"5",
")",
";"
] | df9bda67a65c9f9c92218091a238ef3a5d5e694a | https://github.com/h0x91b/ESB-node-driver/blob/df9bda67a65c9f9c92218091a238ef3a5d5e694a/examples/bench-requester.js#L56-L71 |
47,664 | Pencroff/kea-config | src/config-manager.js | function (path) {
'use strict';
path = fs.realpathSync(path);
var config = require(path);
this.setData(config, false);
return this;
} | javascript | function (path) {
'use strict';
path = fs.realpathSync(path);
var config = require(path);
this.setData(config, false);
return this;
} | [
"function",
"(",
"path",
")",
"{",
"'use strict'",
";",
"path",
"=",
"fs",
".",
"realpathSync",
"(",
"path",
")",
";",
"var",
"config",
"=",
"require",
"(",
"path",
")",
";",
"this",
".",
"setData",
"(",
"config",
",",
"false",
")",
";",
"return",
... | ConfigManager initialization by data in file. Not save previous configuration.
@param {string} path - path to CommonJs module with configuration, from project root | [
"ConfigManager",
"initialization",
"by",
"data",
"in",
"file",
".",
"Not",
"save",
"previous",
"configuration",
"."
] | 0889d7b8a89ee8720ebc3493e2b102de079869b1 | https://github.com/Pencroff/kea-config/blob/0889d7b8a89ee8720ebc3493e2b102de079869b1/src/config-manager.js#L202-L208 | |
47,665 | Pencroff/kea-config | src/config-manager.js | function (path) {
'use strict';
path = fs.realpathSync(path);
var updateConf = require(path);
this.setData(updateConf, true);
return this;
} | javascript | function (path) {
'use strict';
path = fs.realpathSync(path);
var updateConf = require(path);
this.setData(updateConf, true);
return this;
} | [
"function",
"(",
"path",
")",
"{",
"'use strict'",
";",
"path",
"=",
"fs",
".",
"realpathSync",
"(",
"path",
")",
";",
"var",
"updateConf",
"=",
"require",
"(",
"path",
")",
";",
"this",
".",
"setData",
"(",
"updateConf",
",",
"true",
")",
";",
"retu... | Update exist configuration. Merge new config to exist.
@param {string} path - path to CommonJs module with configuration, from project root | [
"Update",
"exist",
"configuration",
".",
"Merge",
"new",
"config",
"to",
"exist",
"."
] | 0889d7b8a89ee8720ebc3493e2b102de079869b1 | https://github.com/Pencroff/kea-config/blob/0889d7b8a89ee8720ebc3493e2b102de079869b1/src/config-manager.js#L213-L219 | |
47,666 | Pencroff/kea-config | src/config-manager.js | function (key) {
'use strict';
var value = conf[key];
if (!isStr(key)) {
throw new Error(confKeyStrMsg, 'config-manager');
}
if (key.indexOf('.') !== -1) {
value = getNestedValue(conf, key);
}
if (isObj(value)) {
if (isExtension... | javascript | function (key) {
'use strict';
var value = conf[key];
if (!isStr(key)) {
throw new Error(confKeyStrMsg, 'config-manager');
}
if (key.indexOf('.') !== -1) {
value = getNestedValue(conf, key);
}
if (isObj(value)) {
if (isExtension... | [
"function",
"(",
"key",
")",
"{",
"'use strict'",
";",
"var",
"value",
"=",
"conf",
"[",
"key",
"]",
";",
"if",
"(",
"!",
"isStr",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"confKeyStrMsg",
",",
"'config-manager'",
")",
";",
"}",
"if... | Get 'value' of 'key'.
@param {string} key - key in configuration. Like 'simpleKey' or 'section.subsection.complex.key'. See config-managet-test.js
@returns {*} value - `value` of `key`. Can be `primitive` or `javascript object`. Objects not connected to original configuration.
If value contain reference (`{$ref: 'some.... | [
"Get",
"value",
"of",
"key",
"."
] | 0889d7b8a89ee8720ebc3493e2b102de079869b1 | https://github.com/Pencroff/kea-config/blob/0889d7b8a89ee8720ebc3493e2b102de079869b1/src/config-manager.js#L274-L292 | |
47,667 | Pencroff/kea-config | src/config-manager.js | function (key, value) {
'use strict';
var obj;
if (!isStr(key)) {
throw new Error(confKeyStrMsg, 'config-manager');
}
if (key.indexOf('.') === -1) {
conf[key] = value;
} else {
obj = getLastNodeKey(key, conf);
obj.node[obj.k... | javascript | function (key, value) {
'use strict';
var obj;
if (!isStr(key)) {
throw new Error(confKeyStrMsg, 'config-manager');
}
if (key.indexOf('.') === -1) {
conf[key] = value;
} else {
obj = getLastNodeKey(key, conf);
obj.node[obj.k... | [
"function",
"(",
"key",
",",
"value",
")",
"{",
"'use strict'",
";",
"var",
"obj",
";",
"if",
"(",
"!",
"isStr",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"confKeyStrMsg",
",",
"'config-manager'",
")",
";",
"}",
"if",
"(",
"key",
"."... | Set 'value' for 'key'
@param {string} key - key in configuration. Like 'simpleKey' or 'section.subsection.complex.key'. See config-managet-test.js
@param {*} value | [
"Set",
"value",
"for",
"key"
] | 0889d7b8a89ee8720ebc3493e2b102de079869b1 | https://github.com/Pencroff/kea-config/blob/0889d7b8a89ee8720ebc3493e2b102de079869b1/src/config-manager.js#L298-L311 | |
47,668 | mdreizin/webpack-config-stream | lib/formatStream.js | formatStream | function formatStream(options) {
if (!_.isObject(options)) {
options = {};
}
var statsOptions = options.verbose === true ? _.defaults(options, DEFAULT_VERBOSE_STATS_OPTIONS) : _.defaults(options, DEFAULT_STATS_OPTIONS);
if (!gutil.colors.supportsColor) {
statsOptions.colors = false;
... | javascript | function formatStream(options) {
if (!_.isObject(options)) {
options = {};
}
var statsOptions = options.verbose === true ? _.defaults(options, DEFAULT_VERBOSE_STATS_OPTIONS) : _.defaults(options, DEFAULT_STATS_OPTIONS);
if (!gutil.colors.supportsColor) {
statsOptions.colors = false;
... | [
"function",
"formatStream",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isObject",
"(",
"options",
")",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"var",
"statsOptions",
"=",
"options",
".",
"verbose",
"===",
"true",
"?",
"_",
".",
"def... | Writes formatted string of `stats` object and displays related `webpack.config.js` file path. Can be piped.
@function
@alias formatStream
@param {Object=} options - Options to pass to {@link http://webpack.github.io/docs/node.js-api.html#stats-tostring `stats.toString()`}.
@param {Boolean} [options.verbose=false] - Wri... | [
"Writes",
"formatted",
"string",
"of",
"stats",
"object",
"and",
"displays",
"related",
"webpack",
".",
"config",
".",
"js",
"file",
"path",
".",
"Can",
"be",
"piped",
"."
] | f8424f97837a224bc07cc18a03ecf649d708e924 | https://github.com/mdreizin/webpack-config-stream/blob/f8424f97837a224bc07cc18a03ecf649d708e924/lib/formatStream.js#L27-L51 |
47,669 | mattbasta/btype | src/parser.js | parseString | function parseString(input) {
var stripped = input.substring(1, input.length - 1);
return stripped.replace(/\\(\w|\\)/gi, function(_, b) {
switch (b) {
case '\\r': return '\r';
case '\\n': return '\n';
case '\\t': return '\t';
case '\\0': return '\0';
... | javascript | function parseString(input) {
var stripped = input.substring(1, input.length - 1);
return stripped.replace(/\\(\w|\\)/gi, function(_, b) {
switch (b) {
case '\\r': return '\r';
case '\\n': return '\n';
case '\\t': return '\t';
case '\\0': return '\0';
... | [
"function",
"parseString",
"(",
"input",
")",
"{",
"var",
"stripped",
"=",
"input",
".",
"substring",
"(",
"1",
",",
"input",
".",
"length",
"-",
"1",
")",
";",
"return",
"stripped",
".",
"replace",
"(",
"/",
"\\\\(\\w|\\\\)",
"/",
"gi",
",",
"function... | Turns an encoded string into its text content
@param {string} input
@return {string} | [
"Turns",
"an",
"encoded",
"string",
"into",
"its",
"text",
"content"
] | 7d28db96f3e14fd83d4a72f6008cb9a26208ab71 | https://github.com/mattbasta/btype/blob/7d28db96f3e14fd83d4a72f6008cb9a26208ab71/src/parser.js#L11-L25 |
47,670 | mattbasta/btype | src/parser.js | parseSwitchType | function parseSwitchType(lex) {
var start = lex.accept('switchtype');
if (!start) {
return null;
}
var expr = parseExpression(lex);
lex.assert('{');
var cases = [];
var end;
do {
let c = parseSwitchTypeCase(lex);
cases.push(c);
} while (!(end = lex.accept('}... | javascript | function parseSwitchType(lex) {
var start = lex.accept('switchtype');
if (!start) {
return null;
}
var expr = parseExpression(lex);
lex.assert('{');
var cases = [];
var end;
do {
let c = parseSwitchTypeCase(lex);
cases.push(c);
} while (!(end = lex.accept('}... | [
"function",
"parseSwitchType",
"(",
"lex",
")",
"{",
"var",
"start",
"=",
"lex",
".",
"accept",
"(",
"'switchtype'",
")",
";",
"if",
"(",
"!",
"start",
")",
"{",
"return",
"null",
";",
"}",
"var",
"expr",
"=",
"parseExpression",
"(",
"lex",
")",
";",... | Parses a `switchtype` statement
@param {Lexer} lex
@return {SwitchType} | [
"Parses",
"a",
"switchtype",
"statement"
] | 7d28db96f3e14fd83d4a72f6008cb9a26208ab71 | https://github.com/mattbasta/btype/blob/7d28db96f3e14fd83d4a72f6008cb9a26208ab71/src/parser.js#L1035-L1052 |
47,671 | mattbasta/btype | src/parser.js | parseSwitchTypeCase | function parseSwitchTypeCase(lex) {
var start = lex.assert('case');
var type = parseType(lex);
lex.assert('{');
var body = parseStatements(lex, '}', false);
var end = lex.assert('}');
return new nodes.SwitchTypeCaseNode(type, body, start.start, end.end);
} | javascript | function parseSwitchTypeCase(lex) {
var start = lex.assert('case');
var type = parseType(lex);
lex.assert('{');
var body = parseStatements(lex, '}', false);
var end = lex.assert('}');
return new nodes.SwitchTypeCaseNode(type, body, start.start, end.end);
} | [
"function",
"parseSwitchTypeCase",
"(",
"lex",
")",
"{",
"var",
"start",
"=",
"lex",
".",
"assert",
"(",
"'case'",
")",
";",
"var",
"type",
"=",
"parseType",
"(",
"lex",
")",
";",
"lex",
".",
"assert",
"(",
"'{'",
")",
";",
"var",
"body",
"=",
"par... | Parses a SwitchType's case statement
@param {Lexer}
@return {SwitchTypeCase} | [
"Parses",
"a",
"SwitchType",
"s",
"case",
"statement"
] | 7d28db96f3e14fd83d4a72f6008cb9a26208ab71 | https://github.com/mattbasta/btype/blob/7d28db96f3e14fd83d4a72f6008cb9a26208ab71/src/parser.js#L1059-L1068 |
47,672 | mattbasta/btype | src/parser.js | parseStatement | function parseStatement(lex, isRoot = false) {
return parseFunctionDeclaration(lex) ||
isRoot && parseOperatorStatement(lex) ||
isRoot && parseObjectDeclaration(lex) ||
parseIf(lex) ||
parseReturn(lex) ||
isRoot && parseExport(lex) ||
isRoot && parse... | javascript | function parseStatement(lex, isRoot = false) {
return parseFunctionDeclaration(lex) ||
isRoot && parseOperatorStatement(lex) ||
isRoot && parseObjectDeclaration(lex) ||
parseIf(lex) ||
parseReturn(lex) ||
isRoot && parseExport(lex) ||
isRoot && parse... | [
"function",
"parseStatement",
"(",
"lex",
",",
"isRoot",
"=",
"false",
")",
"{",
"return",
"parseFunctionDeclaration",
"(",
"lex",
")",
"||",
"isRoot",
"&&",
"parseOperatorStatement",
"(",
"lex",
")",
"||",
"isRoot",
"&&",
"parseObjectDeclaration",
"(",
"lex",
... | Parses a single statement
@param {Lexer} lex
@param {bool}
@return {*} | [
"Parses",
"a",
"single",
"statement"
] | 7d28db96f3e14fd83d4a72f6008cb9a26208ab71 | https://github.com/mattbasta/btype/blob/7d28db96f3e14fd83d4a72f6008cb9a26208ab71/src/parser.js#L1076-L1091 |
47,673 | mattbasta/btype | src/parser.js | parseStatements | function parseStatements(lex, endTokens, isRoot) {
endTokens = Array.isArray(endTokens) ? endTokens : [endTokens];
var statements = [];
var temp = lex.peek();
while (endTokens.indexOf(temp) === -1 &&
(temp.type && endTokens.indexOf(temp.type) === -1)) {
var statement = parseStatement(... | javascript | function parseStatements(lex, endTokens, isRoot) {
endTokens = Array.isArray(endTokens) ? endTokens : [endTokens];
var statements = [];
var temp = lex.peek();
while (endTokens.indexOf(temp) === -1 &&
(temp.type && endTokens.indexOf(temp.type) === -1)) {
var statement = parseStatement(... | [
"function",
"parseStatements",
"(",
"lex",
",",
"endTokens",
",",
"isRoot",
")",
"{",
"endTokens",
"=",
"Array",
".",
"isArray",
"(",
"endTokens",
")",
"?",
"endTokens",
":",
"[",
"endTokens",
"]",
";",
"var",
"statements",
"=",
"[",
"]",
";",
"var",
"... | Parses an array of statements
@param {Lexer} lex
@param {string|string[]} endTokens
@param {bool} isRoot
@return {array} | [
"Parses",
"an",
"array",
"of",
"statements"
] | 7d28db96f3e14fd83d4a72f6008cb9a26208ab71 | https://github.com/mattbasta/btype/blob/7d28db96f3e14fd83d4a72f6008cb9a26208ab71/src/parser.js#L1100-L1114 |
47,674 | bezoerb/asset-resolver | lib/resolver.js | requestAsync | function requestAsync(resource, opts = {}) {
const settings = {
followRedirect: true,
encoding: null,
rejectUnauthorized: false
};
if (opts.user && opts.pass) {
settings.headers = {Authorization: 'Basic ' + token(opts.user, opts.pass)};
}
return new Bluebird((resolve, reject) => {
// Han... | javascript | function requestAsync(resource, opts = {}) {
const settings = {
followRedirect: true,
encoding: null,
rejectUnauthorized: false
};
if (opts.user && opts.pass) {
settings.headers = {Authorization: 'Basic ' + token(opts.user, opts.pass)};
}
return new Bluebird((resolve, reject) => {
// Han... | [
"function",
"requestAsync",
"(",
"resource",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"const",
"settings",
"=",
"{",
"followRedirect",
":",
"true",
",",
"encoding",
":",
"null",
",",
"rejectUnauthorized",
":",
"false",
"}",
";",
"if",
"(",
"opts",
".",
"u... | Get external resource
@param {string} resource Ressource to be fetched
@param {object} opts Option hash
@returns {Promise} Promise | [
"Get",
"external",
"resource"
] | 031e634920d62d76e5766dfdfcd7b35b7ca84213 | https://github.com/bezoerb/asset-resolver/blob/031e634920d62d76e5766dfdfcd7b35b7ca84213/lib/resolver.js#L52-L88 |
47,675 | bezoerb/asset-resolver | lib/resolver.js | readAsync | function readAsync(resource) {
return fs.readFile(resource).then(body => {
const mimeType = mime.getType(resource);
debug('Fetched:', resource);
return Bluebird.resolve({
contents: body,
path: resource,
mime: mimeType
});
});
} | javascript | function readAsync(resource) {
return fs.readFile(resource).then(body => {
const mimeType = mime.getType(resource);
debug('Fetched:', resource);
return Bluebird.resolve({
contents: body,
path: resource,
mime: mimeType
});
});
} | [
"function",
"readAsync",
"(",
"resource",
")",
"{",
"return",
"fs",
".",
"readFile",
"(",
"resource",
")",
".",
"then",
"(",
"body",
"=>",
"{",
"const",
"mimeType",
"=",
"mime",
".",
"getType",
"(",
"resource",
")",
";",
"debug",
"(",
"'Fetched:'",
","... | Get local resource
@param {string} resource Resource to be fetched
@returns {Promise} Promise | [
"Get",
"local",
"resource"
] | 031e634920d62d76e5766dfdfcd7b35b7ca84213 | https://github.com/bezoerb/asset-resolver/blob/031e634920d62d76e5766dfdfcd7b35b7ca84213/lib/resolver.js#L95-L107 |
47,676 | dman777/gulp-newy | lib/newy.js | checkMissingDir | function checkMissingDir(destinationFile) {
var filePath = path.dirname(destinationFile);
var pathAbsolute = path.isAbsolute(filePath);
var directories = filePath.split(path.sep);
return transversePath(directories);
} | javascript | function checkMissingDir(destinationFile) {
var filePath = path.dirname(destinationFile);
var pathAbsolute = path.isAbsolute(filePath);
var directories = filePath.split(path.sep);
return transversePath(directories);
} | [
"function",
"checkMissingDir",
"(",
"destinationFile",
")",
"{",
"var",
"filePath",
"=",
"path",
".",
"dirname",
"(",
"destinationFile",
")",
";",
"var",
"pathAbsolute",
"=",
"path",
".",
"isAbsolute",
"(",
"filePath",
")",
";",
"var",
"directories",
"=",
"f... | check for missing directory | [
"check",
"for",
"missing",
"directory"
] | 12e5bb01b908e83c5e3d99d54630168770ec817d | https://github.com/dman777/gulp-newy/blob/12e5bb01b908e83c5e3d99d54630168770ec817d/lib/newy.js#L10-L15 |
47,677 | saggiyogesh/nodeportal | lib/ServeClientFiles/ClientDirWatcher.js | generateCache | function generateCache(filePath) {
var id = generateIdFromFilePath(filePath);
Debug._l(id);
fs.readFile(filePath, 'utf8', function (err, data) {
if (err) {
Debug._l("err: " + err);
return;
}
fs.stat(filePath, function (err, stat) {
setCache(id, {mo... | javascript | function generateCache(filePath) {
var id = generateIdFromFilePath(filePath);
Debug._l(id);
fs.readFile(filePath, 'utf8', function (err, data) {
if (err) {
Debug._l("err: " + err);
return;
}
fs.stat(filePath, function (err, stat) {
setCache(id, {mo... | [
"function",
"generateCache",
"(",
"filePath",
")",
"{",
"var",
"id",
"=",
"generateIdFromFilePath",
"(",
"filePath",
")",
";",
"Debug",
".",
"_l",
"(",
"id",
")",
";",
"fs",
".",
"readFile",
"(",
"filePath",
",",
"'utf8'",
",",
"function",
"(",
"err",
... | Reads file and cache its data
@param id
@param filePath | [
"Reads",
"file",
"and",
"cache",
"its",
"data"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/ServeClientFiles/ClientDirWatcher.js#L26-L38 |
47,678 | saggiyogesh/nodeportal | public/js/util.js | function (options) {
if (!options) {
throw Error("Ajax options missing");
}
var that = this, util = Rocket.Util;
options.success = util.ajaxResponse(options.callback);
util.ajax(options);
} | javascript | function (options) {
if (!options) {
throw Error("Ajax options missing");
}
var that = this, util = Rocket.Util;
options.success = util.ajaxResponse(options.callback);
util.ajax(options);
} | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"options",
")",
"{",
"throw",
"Error",
"(",
"\"Ajax options missing\"",
")",
";",
"}",
"var",
"that",
"=",
"this",
",",
"util",
"=",
"Rocket",
".",
"Util",
";",
"options",
".",
"success",
"=",
"ut... | Ajax io transport utility method
@param options | [
"Ajax",
"io",
"transport",
"utility",
"method"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/js/util.js#L57-L64 | |
47,679 | saggiyogesh/nodeportal | public/js/util.js | function (msg, nodeId, ns, isShow) {
ns = ns || Rocket.Plugin.currentPlugin.namespace;
var node = $("#" + ns + "_" + nodeId),
msgSpan = node.find("span.message");
isShow ? node.removeClass("hide") && node.css("display", "block") : node.addClass("hide");
if... | javascript | function (msg, nodeId, ns, isShow) {
ns = ns || Rocket.Plugin.currentPlugin.namespace;
var node = $("#" + ns + "_" + nodeId),
msgSpan = node.find("span.message");
isShow ? node.removeClass("hide") && node.css("display", "block") : node.addClass("hide");
if... | [
"function",
"(",
"msg",
",",
"nodeId",
",",
"ns",
",",
"isShow",
")",
"{",
"ns",
"=",
"ns",
"||",
"Rocket",
".",
"Plugin",
".",
"currentPlugin",
".",
"namespace",
";",
"var",
"node",
"=",
"$",
"(",
"\"#\"",
"+",
"ns",
"+",
"\"_\"",
"+",
"nodeId",
... | Method to toggle show of a flash messages
Jade template should be as
for error flash
#<nodeId>.hide.alert.alert-error
button(class="close", data-dismiss="alert") x
span.message
for success flash
#<nodeId>.hide.alert.alert-success
button(class="close", data-dismiss="alert") x
span.message
@param msg - Message to ... | [
"Method",
"to",
"toggle",
"show",
"of",
"a",
"flash",
"messages"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/js/util.js#L208-L227 | |
47,680 | saggiyogesh/nodeportal | public/js/util.js | function (msg, nodeId, ns) {
nodeId = nodeId || "errorFlash";
this.flashMessage(msg, nodeId, ns, true);
} | javascript | function (msg, nodeId, ns) {
nodeId = nodeId || "errorFlash";
this.flashMessage(msg, nodeId, ns, true);
} | [
"function",
"(",
"msg",
",",
"nodeId",
",",
"ns",
")",
"{",
"nodeId",
"=",
"nodeId",
"||",
"\"errorFlash\"",
";",
"this",
".",
"flashMessage",
"(",
"msg",
",",
"nodeId",
",",
"ns",
",",
"true",
")",
";",
"}"
] | Id for error flash is default "errorFlash", without namespace
@param msg
@param nodeId
@param ns | [
"Id",
"for",
"error",
"flash",
"is",
"default",
"errorFlash",
"without",
"namespace"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/js/util.js#L234-L237 | |
47,681 | saggiyogesh/nodeportal | lib/Renderer/ErrorRenderer.js | ErrorRenderer | function ErrorRenderer(err, req, res) {
PageRenderer.call(this, req, res);
Object.defineProperties(this, {
err: {
value: err || new Error()
}
});
req.attrs.isErrorPage = true;
} | javascript | function ErrorRenderer(err, req, res) {
PageRenderer.call(this, req, res);
Object.defineProperties(this, {
err: {
value: err || new Error()
}
});
req.attrs.isErrorPage = true;
} | [
"function",
"ErrorRenderer",
"(",
"err",
",",
"req",
",",
"res",
")",
"{",
"PageRenderer",
".",
"call",
"(",
"this",
",",
"req",
",",
"res",
")",
";",
"Object",
".",
"defineProperties",
"(",
"this",
",",
"{",
"err",
":",
"{",
"value",
":",
"err",
"... | Constructor to create ErrorRenderer
@param err
@param req
@param res
@constructor | [
"Constructor",
"to",
"create",
"ErrorRenderer"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/Renderer/ErrorRenderer.js#L21-L29 |
47,682 | KTH/kth-node-api-key-strategy | index.js | Strategy | function Strategy (options, verify) {
if (typeof options === 'function') {
verify = options
options = {}
} else {
if (options && options.log) {
log = options.log
}
}
if (!verify) {
throw new Error('apikey authentication strategy requires a verify function')
}
passport.Strategy.cal... | javascript | function Strategy (options, verify) {
if (typeof options === 'function') {
verify = options
options = {}
} else {
if (options && options.log) {
log = options.log
}
}
if (!verify) {
throw new Error('apikey authentication strategy requires a verify function')
}
passport.Strategy.cal... | [
"function",
"Strategy",
"(",
"options",
",",
"verify",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"'function'",
")",
"{",
"verify",
"=",
"options",
"options",
"=",
"{",
"}",
"}",
"else",
"{",
"if",
"(",
"options",
"&&",
"options",
".",
"log",
"... | Creates an instance of `Strategy` checking api keys. | [
"Creates",
"an",
"instance",
"of",
"Strategy",
"checking",
"api",
"keys",
"."
] | 617d28cee15661edd007e2567779df9a5a3e0264 | https://github.com/KTH/kth-node-api-key-strategy/blob/617d28cee15661edd007e2567779df9a5a3e0264/index.js#L19-L38 |
47,683 | ticup/CloudTypes-paper | shared/CString.js | CString | function CString(value, written, cond) {
this.value = value || '';
this.written = written || false;
this.cond = cond || false;
} | javascript | function CString(value, written, cond) {
this.value = value || '';
this.written = written || false;
this.cond = cond || false;
} | [
"function",
"CString",
"(",
"value",
",",
"written",
",",
"cond",
")",
"{",
"this",
".",
"value",
"=",
"value",
"||",
"''",
";",
"this",
".",
"written",
"=",
"written",
"||",
"false",
";",
"this",
".",
"cond",
"=",
"cond",
"||",
"false",
";",
"}"
] | Actual CString object of which an instance represents a variable of which the property is defined with CStringDeclaration | [
"Actual",
"CString",
"object",
"of",
"which",
"an",
"instance",
"represents",
"a",
"variable",
"of",
"which",
"the",
"property",
"is",
"defined",
"with",
"CStringDeclaration"
] | f3b6adcd60bd66a28eb0e22edfcdcd9500ef7dda | https://github.com/ticup/CloudTypes-paper/blob/f3b6adcd60bd66a28eb0e22edfcdcd9500ef7dda/shared/CString.js#L26-L30 |
47,684 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/undo/plugin.js | function( event )
{
var keystroke = event && event.data.getKey(),
isModifierKey = keystroke in modifierKeyCodes,
isEditingKey = keystroke in editingKeyCodes,
wasEditingKey = this.lastKeystroke in editingKeyCodes,
sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke,
// ... | javascript | function( event )
{
var keystroke = event && event.data.getKey(),
isModifierKey = keystroke in modifierKeyCodes,
isEditingKey = keystroke in editingKeyCodes,
wasEditingKey = this.lastKeystroke in editingKeyCodes,
sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke,
// ... | [
"function",
"(",
"event",
")",
"{",
"var",
"keystroke",
"=",
"event",
"&&",
"event",
".",
"data",
".",
"getKey",
"(",
")",
",",
"isModifierKey",
"=",
"keystroke",
"in",
"modifierKeyCodes",
",",
"isEditingKey",
"=",
"keystroke",
"in",
"editingKeyCodes",
",",
... | Process undo system regard keystrikes.
@param {CKEDITOR.dom.event} event | [
"Process",
"undo",
"system",
"regard",
"keystrikes",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/undo/plugin.js#L238-L325 | |
47,685 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/undo/plugin.js | function( onContentOnly, image, autoFireChange )
{
var snapshots = this.snapshots;
// Get a content image.
if ( !image )
image = new Image( this.editor );
// Do nothing if it was not possible to retrieve an image.
if ( image.contents === false )
return false;
// Check if this ... | javascript | function( onContentOnly, image, autoFireChange )
{
var snapshots = this.snapshots;
// Get a content image.
if ( !image )
image = new Image( this.editor );
// Do nothing if it was not possible to retrieve an image.
if ( image.contents === false )
return false;
// Check if this ... | [
"function",
"(",
"onContentOnly",
",",
"image",
",",
"autoFireChange",
")",
"{",
"var",
"snapshots",
"=",
"this",
".",
"snapshots",
";",
"// Get a content image.\r",
"if",
"(",
"!",
"image",
")",
"image",
"=",
"new",
"Image",
"(",
"this",
".",
"editor",
")... | Save a snapshot of document image for later retrieve. | [
"Save",
"a",
"snapshot",
"of",
"document",
"image",
"for",
"later",
"retrieve",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/undo/plugin.js#L378-L409 | |
47,686 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/undo/plugin.js | function( isUndo )
{
var snapshots = this.snapshots,
currentImage = this.currentImage,
image, i;
if ( currentImage )
{
if ( isUndo )
{
for ( i = this.index - 1 ; i >= 0 ; i-- )
{
image = snapshots[ i ];
if ( !currentImage.equals( image, true ) )
{
... | javascript | function( isUndo )
{
var snapshots = this.snapshots,
currentImage = this.currentImage,
image, i;
if ( currentImage )
{
if ( isUndo )
{
for ( i = this.index - 1 ; i >= 0 ; i-- )
{
image = snapshots[ i ];
if ( !currentImage.equals( image, true ) )
{
... | [
"function",
"(",
"isUndo",
")",
"{",
"var",
"snapshots",
"=",
"this",
".",
"snapshots",
",",
"currentImage",
"=",
"this",
".",
"currentImage",
",",
"image",
",",
"i",
";",
"if",
"(",
"currentImage",
")",
"{",
"if",
"(",
"isUndo",
")",
"{",
"for",
"("... | Get the closest available image. | [
"Get",
"the",
"closest",
"available",
"image",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/undo/plugin.js#L437-L472 | |
47,687 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/undo/plugin.js | function()
{
if ( this.undoable() )
{
this.save( true );
var image = this.getNextImage( true );
if ( image )
return this.restoreImage( image ), true;
}
return false;
} | javascript | function()
{
if ( this.undoable() )
{
this.save( true );
var image = this.getNextImage( true );
if ( image )
return this.restoreImage( image ), true;
}
return false;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"undoable",
"(",
")",
")",
"{",
"this",
".",
"save",
"(",
"true",
")",
";",
"var",
"image",
"=",
"this",
".",
"getNextImage",
"(",
"true",
")",
";",
"if",
"(",
"image",
")",
"return",
"this",
"... | Perform undo on current index. | [
"Perform",
"undo",
"on",
"current",
"index",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/undo/plugin.js#L496-L508 | |
47,688 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/undo/plugin.js | function()
{
if ( this.redoable() )
{
// Try to save. If no changes have been made, the redo stack
// will not change, so it will still be redoable.
this.save( true );
// If instead we had changes, we can't redo anymore.
if ( this.redoable() )
{
var image = this.getNextI... | javascript | function()
{
if ( this.redoable() )
{
// Try to save. If no changes have been made, the redo stack
// will not change, so it will still be redoable.
this.save( true );
// If instead we had changes, we can't redo anymore.
if ( this.redoable() )
{
var image = this.getNextI... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"redoable",
"(",
")",
")",
"{",
"// Try to save. If no changes have been made, the redo stack\r",
"// will not change, so it will still be redoable.\r",
"this",
".",
"save",
"(",
"true",
")",
";",
"// If instead we had ch... | Perform redo on current index. | [
"Perform",
"redo",
"on",
"current",
"index",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/undo/plugin.js#L513-L531 | |
47,689 | vega/vega-projection | src/projections.js | create | function create(type, constructor) {
return function projection() {
var p = constructor();
p.type = type;
p.path = geoPath().projection(p);
p.copy = p.copy || function() {
var c = projection();
projectionProperties.forEach(function(prop) {
if (p.hasOwnProperty(prop)) c[prop](p[p... | javascript | function create(type, constructor) {
return function projection() {
var p = constructor();
p.type = type;
p.path = geoPath().projection(p);
p.copy = p.copy || function() {
var c = projection();
projectionProperties.forEach(function(prop) {
if (p.hasOwnProperty(prop)) c[prop](p[p... | [
"function",
"create",
"(",
"type",
",",
"constructor",
")",
"{",
"return",
"function",
"projection",
"(",
")",
"{",
"var",
"p",
"=",
"constructor",
"(",
")",
";",
"p",
".",
"type",
"=",
"type",
";",
"p",
".",
"path",
"=",
"geoPath",
"(",
")",
".",
... | Augment projections with their type and a copy method. | [
"Augment",
"projections",
"with",
"their",
"type",
"and",
"a",
"copy",
"method",
"."
] | 0d71d4ed52196373f92f369ed8cffb9233eaabd1 | https://github.com/vega/vega-projection/blob/0d71d4ed52196373f92f369ed8cffb9233eaabd1/src/projections.js#L50-L69 |
47,690 | levilindsey/physx | src/collisions/src/collidable-factories.js | createObbFromRenderableShape | function createObbFromRenderableShape(params, physicsJob) {
const halfRangeX = params.scale[0] / 2;
const halfRangeY = params.scale[1] / 2;
const halfRangeZ = params.scale[2] / 2;
return new Obb(halfRangeX, halfRangeY, halfRangeZ, params.isStationary, physicsJob);
} | javascript | function createObbFromRenderableShape(params, physicsJob) {
const halfRangeX = params.scale[0] / 2;
const halfRangeY = params.scale[1] / 2;
const halfRangeZ = params.scale[2] / 2;
return new Obb(halfRangeX, halfRangeY, halfRangeZ, params.isStationary, physicsJob);
} | [
"function",
"createObbFromRenderableShape",
"(",
"params",
",",
"physicsJob",
")",
"{",
"const",
"halfRangeX",
"=",
"params",
".",
"scale",
"[",
"0",
"]",
"/",
"2",
";",
"const",
"halfRangeY",
"=",
"params",
".",
"scale",
"[",
"1",
"]",
"/",
"2",
";",
... | This assumes the base RenderableShape has a side length of one unit.
@param {CollidableShapeConfig} params
@param {CollidablePhysicsJob} [physicsJob]
@returns {Collidable} | [
"This",
"assumes",
"the",
"base",
"RenderableShape",
"has",
"a",
"side",
"length",
"of",
"one",
"unit",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collidable-factories.js#L28-L33 |
47,691 | levilindsey/physx | src/collisions/src/collidable-factories.js | createSphereFromRenderableShape | function createSphereFromRenderableShape(params, physicsJob) {
const radius = params.radius || vec3.length(params.scale) / Math.sqrt(3);
return new Sphere(0, 0, 0, radius, params.isStationary, physicsJob);
} | javascript | function createSphereFromRenderableShape(params, physicsJob) {
const radius = params.radius || vec3.length(params.scale) / Math.sqrt(3);
return new Sphere(0, 0, 0, radius, params.isStationary, physicsJob);
} | [
"function",
"createSphereFromRenderableShape",
"(",
"params",
",",
"physicsJob",
")",
"{",
"const",
"radius",
"=",
"params",
".",
"radius",
"||",
"vec3",
".",
"length",
"(",
"params",
".",
"scale",
")",
"/",
"Math",
".",
"sqrt",
"(",
"3",
")",
";",
"retu... | This assumes the base RenderableShape has a "radius" of one unit.
@param {CollidableShapeConfig} params
@param {CollidablePhysicsJob} [physicsJob]
@returns {Collidable} | [
"This",
"assumes",
"the",
"base",
"RenderableShape",
"has",
"a",
"radius",
"of",
"one",
"unit",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collidable-factories.js#L42-L45 |
47,692 | levilindsey/physx | src/collisions/src/collidable-factories.js | createCapsuleFromRenderableShape | function createCapsuleFromRenderableShape(params, physicsJob) {
const scale = params.scale;
const capsuleEndPointsDistance = params.capsuleEndPointsDistance;
const isStationary = params.isStationary;
let radius = params.radius;
let halfDistance;
// There are two modes: either we use scale, or we use radiu... | javascript | function createCapsuleFromRenderableShape(params, physicsJob) {
const scale = params.scale;
const capsuleEndPointsDistance = params.capsuleEndPointsDistance;
const isStationary = params.isStationary;
let radius = params.radius;
let halfDistance;
// There are two modes: either we use scale, or we use radiu... | [
"function",
"createCapsuleFromRenderableShape",
"(",
"params",
",",
"physicsJob",
")",
"{",
"const",
"scale",
"=",
"params",
".",
"scale",
";",
"const",
"capsuleEndPointsDistance",
"=",
"params",
".",
"capsuleEndPointsDistance",
";",
"const",
"isStationary",
"=",
"p... | The radius of the created capsule will be an average from the two shortest sides.
There are two modes: either we use scale, or we use radius and capsuleEndPointsDistance.
@param {CollidableShapeConfig} params
@param {CollidablePhysicsJob} [physicsJob]
@returns {Collidable} | [
"The",
"radius",
"of",
"the",
"created",
"capsule",
"will",
"be",
"an",
"average",
"from",
"the",
"two",
"shortest",
"sides",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/src/collidable-factories.js#L56-L95 |
47,693 | saggiyogesh/nodeportal | public/ckeditor/_source/core/htmlparser/fragment.js | function( node, index )
{
isNaN( index ) && ( index = this.children.length );
var previous = index > 0 ? this.children[ index - 1 ] : null;
if ( previous )
{
// If the block to be appended is following text, trim spaces at
// the right of it.
if ( node._.isBlockLike && previous.type ... | javascript | function( node, index )
{
isNaN( index ) && ( index = this.children.length );
var previous = index > 0 ? this.children[ index - 1 ] : null;
if ( previous )
{
// If the block to be appended is following text, trim spaces at
// the right of it.
if ( node._.isBlockLike && previous.type ... | [
"function",
"(",
"node",
",",
"index",
")",
"{",
"isNaN",
"(",
"index",
")",
"&&",
"(",
"index",
"=",
"this",
".",
"children",
".",
"length",
")",
";",
"var",
"previous",
"=",
"index",
">",
"0",
"?",
"this",
".",
"children",
"[",
"index",
"-",
"1... | Adds a node to this fragment.
@param {Object} node The node to be added. It can be any of of the
following types: {@link CKEDITOR.htmlParser.element},
{@link CKEDITOR.htmlParser.text} and
{@link CKEDITOR.htmlParser.comment}.
@param {Number} [index] From where the insertion happens.
@example | [
"Adds",
"a",
"node",
"to",
"this",
"fragment",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/htmlparser/fragment.js#L451-L483 | |
47,694 | saggiyogesh/nodeportal | public/ckeditor/_source/core/htmlparser/fragment.js | function( writer, filter )
{
var isChildrenFiltered;
this.filterChildren = function()
{
var writer = new CKEDITOR.htmlParser.basicWriter();
this.writeChildrenHtml.call( this, writer, filter, true );
var html = writer.getHtml();
this.children = new CKEDITOR.htmlParser.fragment.fromHtml... | javascript | function( writer, filter )
{
var isChildrenFiltered;
this.filterChildren = function()
{
var writer = new CKEDITOR.htmlParser.basicWriter();
this.writeChildrenHtml.call( this, writer, filter, true );
var html = writer.getHtml();
this.children = new CKEDITOR.htmlParser.fragment.fromHtml... | [
"function",
"(",
"writer",
",",
"filter",
")",
"{",
"var",
"isChildrenFiltered",
";",
"this",
".",
"filterChildren",
"=",
"function",
"(",
")",
"{",
"var",
"writer",
"=",
"new",
"CKEDITOR",
".",
"htmlParser",
".",
"basicWriter",
"(",
")",
";",
"this",
".... | Writes the fragment HTML to a CKEDITOR.htmlWriter.
@param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
@example
var writer = new CKEDITOR.htmlWriter();
var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<P><B>Example' );
fragment.writeHtml( writer )
alert( writer.getHtml() ); "<p... | [
"Writes",
"the",
"fragment",
"HTML",
"to",
"a",
"CKEDITOR",
".",
"htmlWriter",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/htmlparser/fragment.js#L494-L510 | |
47,695 | philmander/inverted | src/inverted/ProtoFactory.js | function(constructorFn, args) {
var newConstructorFn = function () {
constructorFn.apply(this, args);
};
newConstructorFn.prototype = constructorFn.prototype;
return new newConstructorFn();
} | javascript | function(constructorFn, args) {
var newConstructorFn = function () {
constructorFn.apply(this, args);
};
newConstructorFn.prototype = constructorFn.prototype;
return new newConstructorFn();
} | [
"function",
"(",
"constructorFn",
",",
"args",
")",
"{",
"var",
"newConstructorFn",
"=",
"function",
"(",
")",
"{",
"constructorFn",
".",
"apply",
"(",
"this",
",",
"args",
")",
";",
"}",
";",
"newConstructorFn",
".",
"prototype",
"=",
"constructorFn",
"."... | magic constructor fn | [
"magic",
"constructor",
"fn"
] | af49a1ab2f501a19c457a8b41a40306e12103bf4 | https://github.com/philmander/inverted/blob/af49a1ab2f501a19c457a8b41a40306e12103bf4/src/inverted/ProtoFactory.js#L126-L133 | |
47,696 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/tableresize/plugin.js | getMasterPillarRow | function getMasterPillarRow( table )
{
var $rows = table.$.rows,
maxCells = 0, cellsCount,
$elected, $tr;
for ( var i = 0, len = $rows.length ; i < len; i++ )
{
$tr = $rows[ i ];
cellsCount = $tr.cells.length;
if ( cellsCount > maxCells )
{
maxCells = cellsCount;
$electe... | javascript | function getMasterPillarRow( table )
{
var $rows = table.$.rows,
maxCells = 0, cellsCount,
$elected, $tr;
for ( var i = 0, len = $rows.length ; i < len; i++ )
{
$tr = $rows[ i ];
cellsCount = $tr.cells.length;
if ( cellsCount > maxCells )
{
maxCells = cellsCount;
$electe... | [
"function",
"getMasterPillarRow",
"(",
"table",
")",
"{",
"var",
"$rows",
"=",
"table",
".",
"$",
".",
"rows",
",",
"maxCells",
"=",
"0",
",",
"cellsCount",
",",
"$elected",
",",
"$tr",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"$rows... | Gets the table row that contains the most columns. | [
"Gets",
"the",
"table",
"row",
"that",
"contains",
"the",
"most",
"columns",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/tableresize/plugin.js#L39-L58 |
47,697 | fvsch/gulp-task-maker | tools.js | catchErrors | function catchErrors() {
// don't use an arrow function, we need the `this` instance!
return plumber(function(err) {
if (!err.plugin) {
err.plugin = 'gulp-task-maker'
}
showError(err)
// keep watch tasks running
if (this && typeof this.emit === 'function') {
this.emit('end')
}
... | javascript | function catchErrors() {
// don't use an arrow function, we need the `this` instance!
return plumber(function(err) {
if (!err.plugin) {
err.plugin = 'gulp-task-maker'
}
showError(err)
// keep watch tasks running
if (this && typeof this.emit === 'function') {
this.emit('end')
}
... | [
"function",
"catchErrors",
"(",
")",
"{",
"// don't use an arrow function, we need the `this` instance!",
"return",
"plumber",
"(",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
".",
"plugin",
")",
"{",
"err",
".",
"plugin",
"=",
"'gulp-task-maker'",
... | gulp-plumber with our custom error handler
@return {*} | [
"gulp",
"-",
"plumber",
"with",
"our",
"custom",
"error",
"handler"
] | 20ab4245f2d75174786ad140793e9438c025d546 | https://github.com/fvsch/gulp-task-maker/blob/20ab4245f2d75174786ad140793e9438c025d546/tools.js#L19-L31 |
47,698 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/list/plugin.js | dirToListItems | function dirToListItems( list )
{
var dir = list.getDirection();
if ( dir )
{
for ( var i = 0, children = list.getChildren(), child; child = children.getItem( i ), i < children.count(); i++ )
{
if ( child.type == CKEDITOR.NODE_ELEMENT && child.is( 'li' ) && !child.getDirection() )
child.se... | javascript | function dirToListItems( list )
{
var dir = list.getDirection();
if ( dir )
{
for ( var i = 0, children = list.getChildren(), child; child = children.getItem( i ), i < children.count(); i++ )
{
if ( child.type == CKEDITOR.NODE_ELEMENT && child.is( 'li' ) && !child.getDirection() )
child.se... | [
"function",
"dirToListItems",
"(",
"list",
")",
"{",
"var",
"dir",
"=",
"list",
".",
"getDirection",
"(",
")",
";",
"if",
"(",
"dir",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"children",
"=",
"list",
".",
"getChildren",
"(",
")",
",",
"ch... | Move direction attribute from root to list items. | [
"Move",
"direction",
"attribute",
"from",
"root",
"to",
"list",
"items",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/list/plugin.js#L487-L500 |
47,699 | slideme/rorschach | index.js | Rorschach | function Rorschach(connectionString, options) {
EventEmitter.call(this);
options = options || {};
var retryPolicy = options.retryPolicy;
if (retryPolicy instanceof RetryPolicy) {
this.retryPolicy = retryPolicy;
}
else {
this.retryPolicy = new RetryPolicy(retryPolicy);
}
// Initial state
thi... | javascript | function Rorschach(connectionString, options) {
EventEmitter.call(this);
options = options || {};
var retryPolicy = options.retryPolicy;
if (retryPolicy instanceof RetryPolicy) {
this.retryPolicy = retryPolicy;
}
else {
this.retryPolicy = new RetryPolicy(retryPolicy);
}
// Initial state
thi... | [
"function",
"Rorschach",
"(",
"connectionString",
",",
"options",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"retryPolicy",
"=",
"options",
".",
"retryPolicy",
";",
"if",
"(",
"ret... | Create instance and connect to ZooKeeper.
@constructor
@extends {events.EventEmitter}
@param {String} connectionString ZooKeeper connection string
@param {Object} [options] Options:
@param {Object|RetryPolicy} [options.retryPolicy] RetryPolicy instance or options
@param {Object} [options.zookeeper] ZooKeeper client op... | [
"Create",
"instance",
"and",
"connect",
"to",
"ZooKeeper",
"."
] | 899339baf31682f8a62b2960cdd26fbb58a9e3a1 | https://github.com/slideme/rorschach/blob/899339baf31682f8a62b2960cdd26fbb58a9e3a1/index.js#L48-L65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.