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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,800 | Maciek416/weather-forecast | weather-forecast.js | function($, times, N) {
N = typeof N === 'undefined' ? 24 : N;
return _.chain(times).map(function(time){
// map to back to cheerio'fied object so we can read attr()
return $(time);
}).filter(function(time){
// filter by instantaneous forecasts only
return time.attr("from") == time.attr("to");
}... | javascript | function($, times, N) {
N = typeof N === 'undefined' ? 24 : N;
return _.chain(times).map(function(time){
// map to back to cheerio'fied object so we can read attr()
return $(time);
}).filter(function(time){
// filter by instantaneous forecasts only
return time.attr("from") == time.attr("to");
}... | [
"function",
"(",
"$",
",",
"times",
",",
"N",
")",
"{",
"N",
"=",
"typeof",
"N",
"===",
"'undefined'",
"?",
"24",
":",
"N",
";",
"return",
"_",
".",
"chain",
"(",
"times",
")",
".",
"map",
"(",
"function",
"(",
"time",
")",
"{",
"// map to back t... | return the closest N forecasts in the future to current time with the smallest time range | [
"return",
"the",
"closest",
"N",
"forecasts",
"in",
"the",
"future",
"to",
"current",
"time",
"with",
"the",
"smallest",
"time",
"range"
] | 634b75545eb0dd4b166b678d7d84b27960622fd5 | https://github.com/Maciek416/weather-forecast/blob/634b75545eb0dd4b166b678d7d84b27960622fd5/weather-forecast.js#L9-L23 | |
39,801 | Maciek416/weather-forecast | weather-forecast.js | function(time){
var tempC = parseFloat(time.find('temperature').eq(0).attr('value'));
return {
hoursFromNow: Math.ceil(((new Date(time.attr("from"))).getTime() - (new Date()).getTime()) / 1000 / 60 / 60),
// Celcius is kept decimal since met.no returns a pleasant formatted value.
// Fahrenheit is roun... | javascript | function(time){
var tempC = parseFloat(time.find('temperature').eq(0).attr('value'));
return {
hoursFromNow: Math.ceil(((new Date(time.attr("from"))).getTime() - (new Date()).getTime()) / 1000 / 60 / 60),
// Celcius is kept decimal since met.no returns a pleasant formatted value.
// Fahrenheit is roun... | [
"function",
"(",
"time",
")",
"{",
"var",
"tempC",
"=",
"parseFloat",
"(",
"time",
".",
"find",
"(",
"'temperature'",
")",
".",
"eq",
"(",
"0",
")",
".",
"attr",
"(",
"'value'",
")",
")",
";",
"return",
"{",
"hoursFromNow",
":",
"Math",
".",
"ceil"... | return an object with temperature in C and F and a relative ETA in hours for that temperature. | [
"return",
"an",
"object",
"with",
"temperature",
"in",
"C",
"and",
"F",
"and",
"a",
"relative",
"ETA",
"in",
"hours",
"for",
"that",
"temperature",
"."
] | 634b75545eb0dd4b166b678d7d84b27960622fd5 | https://github.com/Maciek416/weather-forecast/blob/634b75545eb0dd4b166b678d7d84b27960622fd5/weather-forecast.js#L26-L37 | |
39,802 | Maciek416/weather-forecast | weather-forecast.js | function(lat, lon, done){
var url = "http://api.met.no/weatherapi/locationforecast/1.8/?lat=" + lat + ";lon=" + lon;
request(url, function(error, response, body) {
if (!error && response.statusCode < 400) {
var $ = cheerio.load(body);
var nearbyForecasts = closestInstantForecasts($, $(... | javascript | function(lat, lon, done){
var url = "http://api.met.no/weatherapi/locationforecast/1.8/?lat=" + lat + ";lon=" + lon;
request(url, function(error, response, body) {
if (!error && response.statusCode < 400) {
var $ = cheerio.load(body);
var nearbyForecasts = closestInstantForecasts($, $(... | [
"function",
"(",
"lat",
",",
"lon",
",",
"done",
")",
"{",
"var",
"url",
"=",
"\"http://api.met.no/weatherapi/locationforecast/1.8/?lat=\"",
"+",
"lat",
"+",
"\";lon=\"",
"+",
"lon",
";",
"request",
"(",
"url",
",",
"function",
"(",
"error",
",",
"response",
... | call done with weather forecast results for GPS location lat, lon | [
"call",
"done",
"with",
"weather",
"forecast",
"results",
"for",
"GPS",
"location",
"lat",
"lon"
] | 634b75545eb0dd4b166b678d7d84b27960622fd5 | https://github.com/Maciek416/weather-forecast/blob/634b75545eb0dd4b166b678d7d84b27960622fd5/weather-forecast.js#L42-L60 | |
39,803 | Infomaker/cropjs | dist/js/cropjs.js | function(visible) {
var e = document.getElementById('imc_loading');
if (typeof visible == 'undefined') {
return e.classList.contains('loading');
}
if (visible) {
e.classList.add('loading');
}
else {
... | javascript | function(visible) {
var e = document.getElementById('imc_loading');
if (typeof visible == 'undefined') {
return e.classList.contains('loading');
}
if (visible) {
e.classList.add('loading');
}
else {
... | [
"function",
"(",
"visible",
")",
"{",
"var",
"e",
"=",
"document",
".",
"getElementById",
"(",
"'imc_loading'",
")",
";",
"if",
"(",
"typeof",
"visible",
"==",
"'undefined'",
")",
"{",
"return",
"e",
".",
"classList",
".",
"contains",
"(",
"'loading'",
"... | Toggle loading spinning indicator | [
"Toggle",
"loading",
"spinning",
"indicator"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L477-L492 | |
39,804 | Infomaker/cropjs | dist/js/cropjs.js | function (crop, setAsCurrent) {
var _this = this;
// Create image container element
var pvDivOuter = document.createElement('div');
pvDivOuter.id = this._image.id + '_' + crop.id;
pvDivOuter.classList.add('imc_preview_image_container');
if (setAs... | javascript | function (crop, setAsCurrent) {
var _this = this;
// Create image container element
var pvDivOuter = document.createElement('div');
pvDivOuter.id = this._image.id + '_' + crop.id;
pvDivOuter.classList.add('imc_preview_image_container');
if (setAs... | [
"function",
"(",
"crop",
",",
"setAsCurrent",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"// Create image container element",
"var",
"pvDivOuter",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"pvDivOuter",
".",
"id",
"=",
"this",
".",
"_im... | Add and render specific crop preview
@param crop
@param setAsCurrent
@private | [
"Add",
"and",
"render",
"specific",
"crop",
"preview"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L501-L566 | |
39,805 | Infomaker/cropjs | dist/js/cropjs.js | function (crop) {
var pvDiv = document.getElementById(this._image.id + '_' + crop.id);
if (pvDiv == null || typeof pvDiv != 'object') {
return;
}
var pvDivInner = pvDiv.getElementsByTagName('DIV')[0]
var pvImg = pvDiv.getElementsByTagName('IMG... | javascript | function (crop) {
var pvDiv = document.getElementById(this._image.id + '_' + crop.id);
if (pvDiv == null || typeof pvDiv != 'object') {
return;
}
var pvDivInner = pvDiv.getElementsByTagName('DIV')[0]
var pvImg = pvDiv.getElementsByTagName('IMG... | [
"function",
"(",
"crop",
")",
"{",
"var",
"pvDiv",
"=",
"document",
".",
"getElementById",
"(",
"this",
".",
"_image",
".",
"id",
"+",
"'_'",
"+",
"crop",
".",
"id",
")",
";",
"if",
"(",
"pvDiv",
"==",
"null",
"||",
"typeof",
"pvDiv",
"!=",
"'objec... | Update rendering of current crop preview
@param crop
@private | [
"Update",
"rendering",
"of",
"current",
"crop",
"preview"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L574-L610 | |
39,806 | Infomaker/cropjs | dist/js/cropjs.js | function (canvas) {
var c = canvas || this._canvas;
var ctx = c.getContext('2d');
var devicePixelRatio = window.devicePixelRatio || 1;
var backingStoreRatio =
ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
... | javascript | function (canvas) {
var c = canvas || this._canvas;
var ctx = c.getContext('2d');
var devicePixelRatio = window.devicePixelRatio || 1;
var backingStoreRatio =
ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
... | [
"function",
"(",
"canvas",
")",
"{",
"var",
"c",
"=",
"canvas",
"||",
"this",
".",
"_canvas",
";",
"var",
"ctx",
"=",
"c",
".",
"getContext",
"(",
"'2d'",
")",
";",
"var",
"devicePixelRatio",
"=",
"window",
".",
"devicePixelRatio",
"||",
"1",
";",
"v... | Adjust canvas for pixel ratio
@param canvas | [
"Adjust",
"canvas",
"for",
"pixel",
"ratio"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L670-L701 | |
39,807 | Infomaker/cropjs | dist/js/cropjs.js | function (url, onImageReady, applyAutocrop) {
var _this = this;
this.toggleLoadingImage(true);
this.clear();
this._applyAutocrop = (applyAutocrop !== false);
this._image = new IMSoftcrop.Image(
IMSoftcrop.Ratio.hashFnv32a(url),
... | javascript | function (url, onImageReady, applyAutocrop) {
var _this = this;
this.toggleLoadingImage(true);
this.clear();
this._applyAutocrop = (applyAutocrop !== false);
this._image = new IMSoftcrop.Image(
IMSoftcrop.Ratio.hashFnv32a(url),
... | [
"function",
"(",
"url",
",",
"onImageReady",
",",
"applyAutocrop",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"this",
".",
"toggleLoadingImage",
"(",
"true",
")",
";",
"this",
".",
"clear",
"(",
")",
";",
"this",
".",
"_applyAutocrop",
"=",
"(",
"appl... | Load image from url
@param url
@param onImageReady Callback after image has been loaded
@param autocropImage Optional, default true, if autocrops should be applied | [
"Load",
"image",
"from",
"url"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L710-L745 | |
39,808 | Infomaker/cropjs | dist/js/cropjs.js | function() {
var data = {
src: this._image.src,
width: this._image.w,
height: this._image.h,
crops: []
};
for(var n = 0; n < this._image.crops.length; n++) {
data.crops.push({
id: thi... | javascript | function() {
var data = {
src: this._image.src,
width: this._image.w,
height: this._image.h,
crops: []
};
for(var n = 0; n < this._image.crops.length; n++) {
data.crops.push({
id: thi... | [
"function",
"(",
")",
"{",
"var",
"data",
"=",
"{",
"src",
":",
"this",
".",
"_image",
".",
"src",
",",
"width",
":",
"this",
".",
"_image",
".",
"w",
",",
"height",
":",
"this",
".",
"_image",
".",
"h",
",",
"crops",
":",
"[",
"]",
"}",
";",... | Get soft crop data for image | [
"Get",
"soft",
"crop",
"data",
"for",
"image"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L801-L821 | |
39,809 | Infomaker/cropjs | dist/js/cropjs.js | function() {
if (this._image instanceof IMSoftcrop.Image == false || !this._image.ready) {
return;
}
// Always make sure all crops are added
for(var n = 0; n < this._crops.length; n++) {
var crop = this._image.getSoftcrop(this._crops[n].id... | javascript | function() {
if (this._image instanceof IMSoftcrop.Image == false || !this._image.ready) {
return;
}
// Always make sure all crops are added
for(var n = 0; n < this._crops.length; n++) {
var crop = this._image.getSoftcrop(this._crops[n].id... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_image",
"instanceof",
"IMSoftcrop",
".",
"Image",
"==",
"false",
"||",
"!",
"this",
".",
"_image",
".",
"ready",
")",
"{",
"return",
";",
"}",
"// Always make sure all crops are added",
"for",
"(",
"var"... | Apply all soft crops to image | [
"Apply",
"all",
"soft",
"crops",
"to",
"image"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L826-L859 | |
39,810 | Infomaker/cropjs | dist/js/cropjs.js | function (crop) {
if (crop instanceof IMSoftcrop.Softcrop !== true) {
return;
}
var div = document.getElementById(this._image.id + '_' + crop.id);
var divs = this._previewContainer.getElementsByClassName('imc_preview_image_container');
for (va... | javascript | function (crop) {
if (crop instanceof IMSoftcrop.Softcrop !== true) {
return;
}
var div = document.getElementById(this._image.id + '_' + crop.id);
var divs = this._previewContainer.getElementsByClassName('imc_preview_image_container');
for (va... | [
"function",
"(",
"crop",
")",
"{",
"if",
"(",
"crop",
"instanceof",
"IMSoftcrop",
".",
"Softcrop",
"!==",
"true",
")",
"{",
"return",
";",
"}",
"var",
"div",
"=",
"document",
".",
"getElementById",
"(",
"this",
".",
"_image",
".",
"id",
"+",
"'_'",
"... | Set active crop
@param crop | [
"Set",
"active",
"crop"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L865-L884 | |
39,811 | Infomaker/cropjs | dist/js/cropjs.js | function(crop) {
if(typeof crop === 'undefined') {
crop = this._crop;
}
crop.usable = !crop.usable;
this._renderUpdatedPreview(crop);
if (crop.id === this._crop.id) {
this._cropUsableToggle.on = crop.usable;
}
... | javascript | function(crop) {
if(typeof crop === 'undefined') {
crop = this._crop;
}
crop.usable = !crop.usable;
this._renderUpdatedPreview(crop);
if (crop.id === this._crop.id) {
this._cropUsableToggle.on = crop.usable;
}
... | [
"function",
"(",
"crop",
")",
"{",
"if",
"(",
"typeof",
"crop",
"===",
"'undefined'",
")",
"{",
"crop",
"=",
"this",
".",
"_crop",
";",
"}",
"crop",
".",
"usable",
"=",
"!",
"crop",
".",
"usable",
";",
"this",
".",
"_renderUpdatedPreview",
"(",
"crop... | Toggle a specified crops usable field, or the current crop if left out
@param crop | [
"Toggle",
"a",
"specified",
"crops",
"usable",
"field",
"or",
"the",
"current",
"crop",
"if",
"left",
"out"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L890-L900 | |
39,812 | Infomaker/cropjs | dist/js/cropjs.js | function() {
if (this._image instanceof IMSoftcrop.Image == false) {
return;
}
this._image.clear();
this._crops = [];
this._crop = undefined;
this._image = undefined;
this._previewContainer.innerHTML = '';
t... | javascript | function() {
if (this._image instanceof IMSoftcrop.Image == false) {
return;
}
this._image.clear();
this._crops = [];
this._crop = undefined;
this._image = undefined;
this._previewContainer.innerHTML = '';
t... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_image",
"instanceof",
"IMSoftcrop",
".",
"Image",
"==",
"false",
")",
"{",
"return",
";",
"}",
"this",
".",
"_image",
".",
"clear",
"(",
")",
";",
"this",
".",
"_crops",
"=",
"[",
"]",
";",
"th... | Clear image and all image crops | [
"Clear",
"image",
"and",
"all",
"image",
"crops"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L905-L916 | |
39,813 | Infomaker/cropjs | dist/js/cropjs.js | function() {
if (this._autocrop && this._applyAutocrop) {
if (!this.toggleLoadingImage()) {
this.toggleLoadingImage(true)
}
if (this._image.autocrop()) {
this.redraw();
}
}
if (t... | javascript | function() {
if (this._autocrop && this._applyAutocrop) {
if (!this.toggleLoadingImage()) {
this.toggleLoadingImage(true)
}
if (this._image.autocrop()) {
this.redraw();
}
}
if (t... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_autocrop",
"&&",
"this",
".",
"_applyAutocrop",
")",
"{",
"if",
"(",
"!",
"this",
".",
"toggleLoadingImage",
"(",
")",
")",
"{",
"this",
".",
"toggleLoadingImage",
"(",
"true",
")",
"}",
"if",
"(",... | Auto crop images | [
"Auto",
"crop",
"images"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L922-L936 | |
39,814 | Infomaker/cropjs | dist/js/cropjs.js | function() {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
var body = document.getElementsByTagName('body');
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canva... | javascript | function() {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
var body = document.getElementsByTagName('body');
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canva... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_image",
"instanceof",
"IMSoftcrop",
".",
"Image",
"||",
"!",
"this",
".",
"_image",
".",
"ready",
")",
"{",
"return",
";",
"}",
"var",
"body",
"=",
"document",
".",
"getElementsByTagName",
"(",
... | Create temporary canvas in image size and extract image data
@returns {ImageData} | [
"Create",
"temporary",
"canvas",
"in",
"image",
"size",
"and",
"extract",
"image",
"data"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L942-L975 | |
39,815 | Infomaker/cropjs | dist/js/cropjs.js | function() {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
var _this = this,
imageData = this.getImageData();
this._waitForWorkers++;
if (window.Worker) {
// If workers are av... | javascript | function() {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
var _this = this,
imageData = this.getImageData();
this._waitForWorkers++;
if (window.Worker) {
// If workers are av... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_image",
"instanceof",
"IMSoftcrop",
".",
"Image",
"||",
"!",
"this",
".",
"_image",
".",
"ready",
")",
"{",
"return",
";",
"}",
"var",
"_this",
"=",
"this",
",",
"imageData",
"=",
"this",
".... | Detect features in image | [
"Detect",
"features",
"in",
"image"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L981-L1026 | |
39,816 | Infomaker/cropjs | dist/js/cropjs.js | function(data) {
var corners = [];
for (var i = 0; i < data.length; i += 2) {
corners.push({
x: data[i],
y: data[i + 1]
});
}
this._image.addDetailData(corners);
} | javascript | function(data) {
var corners = [];
for (var i = 0; i < data.length; i += 2) {
corners.push({
x: data[i],
y: data[i + 1]
});
}
this._image.addDetailData(corners);
} | [
"function",
"(",
"data",
")",
"{",
"var",
"corners",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"corners",
".",
"push",
"(",
"{",
"x",
":",
"data",
"[",
"i",
... | Add detected details to current image
@param data | [
"Add",
"detected",
"details",
"to",
"current",
"image"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1032-L1042 | |
39,817 | Infomaker/cropjs | dist/js/cropjs.js | function () {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
this._waitForWorkers++;
var _this = this;
if (window.Worker) {
// If workers are available, thread it
var featureWor... | javascript | function () {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
this._waitForWorkers++;
var _this = this;
if (window.Worker) {
// If workers are available, thread it
var featureWor... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_image",
"instanceof",
"IMSoftcrop",
".",
"Image",
"||",
"!",
"this",
".",
"_image",
".",
"ready",
")",
"{",
"return",
";",
"}",
"this",
".",
"_waitForWorkers",
"++",
";",
"var",
"_this",
"=",
... | Detect faces in image | [
"Detect",
"faces",
"in",
"image"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1048-L1101 | |
39,818 | Infomaker/cropjs | dist/js/cropjs.js | function(rect) {
var imageRadius = 0,
imagePoint = {
x: rect.x,
y: rect.y
};
if (rect.width / this._image.w > 0.45) {
// Feature point (face) takes up a large portion of the image
rect.height *= 1.2;
... | javascript | function(rect) {
var imageRadius = 0,
imagePoint = {
x: rect.x,
y: rect.y
};
if (rect.width / this._image.w > 0.45) {
// Feature point (face) takes up a large portion of the image
rect.height *= 1.2;
... | [
"function",
"(",
"rect",
")",
"{",
"var",
"imageRadius",
"=",
"0",
",",
"imagePoint",
"=",
"{",
"x",
":",
"rect",
".",
"x",
",",
"y",
":",
"rect",
".",
"y",
"}",
";",
"if",
"(",
"rect",
".",
"width",
"/",
"this",
".",
"_image",
".",
"w",
">",... | Add a feature point with radius.
Heads are important and therefore we naïvely assume features to be faces. Heads
are larger so we need to increase rect height about 40% and then move the y point
so that the forehead can be covered by the full focus point.
Then again. If the face covers more than a certain percent of ... | [
"Add",
"a",
"feature",
"point",
"with",
"radius",
"."
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1114-L1151 | |
39,819 | Infomaker/cropjs | dist/js/cropjs.js | function (redraw) {
var cx, cy;
this._keepCenter = true;
cx = this._container.clientWidth / 2;
cy = this._container.clientHeight / 2;
var ix = ((this._image.w * this._zoomLevel) / 2) + (this._image.x * this._zoomLevel) + this._margin;
var iy = ((... | javascript | function (redraw) {
var cx, cy;
this._keepCenter = true;
cx = this._container.clientWidth / 2;
cy = this._container.clientHeight / 2;
var ix = ((this._image.w * this._zoomLevel) / 2) + (this._image.x * this._zoomLevel) + this._margin;
var iy = ((... | [
"function",
"(",
"redraw",
")",
"{",
"var",
"cx",
",",
"cy",
";",
"this",
".",
"_keepCenter",
"=",
"true",
";",
"cx",
"=",
"this",
".",
"_container",
".",
"clientWidth",
"/",
"2",
";",
"cy",
"=",
"this",
".",
"_container",
".",
"clientHeight",
"/",
... | Center image around the middle point of the drawing area
@param redraw | [
"Center",
"image",
"around",
"the",
"middle",
"point",
"of",
"the",
"drawing",
"area"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1179-L1197 | |
39,820 | Infomaker/cropjs | dist/js/cropjs.js | function (zoomLevel, redraw) {
this._zoomLevel = zoomLevel / 100;
if (this._keepCenter) {
this.centerImage(false);
}
if (redraw === true) {
this.redraw();
}
} | javascript | function (zoomLevel, redraw) {
this._zoomLevel = zoomLevel / 100;
if (this._keepCenter) {
this.centerImage(false);
}
if (redraw === true) {
this.redraw();
}
} | [
"function",
"(",
"zoomLevel",
",",
"redraw",
")",
"{",
"this",
".",
"_zoomLevel",
"=",
"zoomLevel",
"/",
"100",
";",
"if",
"(",
"this",
".",
"_keepCenter",
")",
"{",
"this",
".",
"centerImage",
"(",
"false",
")",
";",
"}",
"if",
"(",
"redraw",
"===",... | Set zoom by percent
@param zoomLevel
@param redraw | [
"Set",
"zoom",
"by",
"percent"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1215-L1225 | |
39,821 | Infomaker/cropjs | dist/js/cropjs.js | function (redraw) {
var imgDim = this._image.getDimensions();
var vFactor = (this._container.clientHeight - this._margin * 2) / imgDim.h;
var hFactor = (this._container.clientWidth - this._margin * 2) / imgDim.w;
// Set correct zoom level
if (vFactor < hFacto... | javascript | function (redraw) {
var imgDim = this._image.getDimensions();
var vFactor = (this._container.clientHeight - this._margin * 2) / imgDim.h;
var hFactor = (this._container.clientWidth - this._margin * 2) / imgDim.w;
// Set correct zoom level
if (vFactor < hFacto... | [
"function",
"(",
"redraw",
")",
"{",
"var",
"imgDim",
"=",
"this",
".",
"_image",
".",
"getDimensions",
"(",
")",
";",
"var",
"vFactor",
"=",
"(",
"this",
".",
"_container",
".",
"clientHeight",
"-",
"this",
".",
"_margin",
"*",
"2",
")",
"/",
"imgDi... | Fill drawing area with image as best as possible
@param redraw | [
"Fill",
"drawing",
"area",
"with",
"image",
"as",
"best",
"as",
"possible"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1231-L1255 | |
39,822 | Infomaker/cropjs | dist/js/cropjs.js | function () {
var _this = this;
window.addEventListener(
'resize',
function () {
_this.onResize(event);
},
false
);
this._canvas.addEventListener(
'dblclick',
... | javascript | function () {
var _this = this;
window.addEventListener(
'resize',
function () {
_this.onResize(event);
},
false
);
this._canvas.addEventListener(
'dblclick',
... | [
"function",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"window",
".",
"addEventListener",
"(",
"'resize'",
",",
"function",
"(",
")",
"{",
"_this",
".",
"onResize",
"(",
"event",
")",
";",
"}",
",",
"false",
")",
";",
"this",
".",
"_canvas",
... | Add all event listeners required for drawing and dragging | [
"Add",
"all",
"event",
"listeners",
"required",
"for",
"drawing",
"and",
"dragging"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1261-L1370 | |
39,823 | Infomaker/cropjs | dist/js/cropjs.js | function(event) {
event.preventDefault();
event.stopPropagation();
if (typeof this._image == 'undefined') {
return false;
}
this.toggleLoadingImage(true);
var point = this.getMousePoint(event);
this._image.addFocusPoi... | javascript | function(event) {
event.preventDefault();
event.stopPropagation();
if (typeof this._image == 'undefined') {
return false;
}
this.toggleLoadingImage(true);
var point = this.getMousePoint(event);
this._image.addFocusPoi... | [
"function",
"(",
"event",
")",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"if",
"(",
"typeof",
"this",
".",
"_image",
"==",
"'undefined'",
")",
"{",
"return",
"false",
";",
"}",
"this",
".",
"t... | Add focus point
@param event | [
"Add",
"focus",
"point"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1413-L1435 | |
39,824 | Infomaker/cropjs | dist/js/cropjs.js | function (event) {
var point = this.getMousePoint(event);
if (this._crop instanceof IMSoftcrop.Softcrop && typeof this.handle === 'string') {
this.updateImageInfo(true);
this._dragPoint = point;
this._dragObject = this.handle;
}
... | javascript | function (event) {
var point = this.getMousePoint(event);
if (this._crop instanceof IMSoftcrop.Softcrop && typeof this.handle === 'string') {
this.updateImageInfo(true);
this._dragPoint = point;
this._dragObject = this.handle;
}
... | [
"function",
"(",
"event",
")",
"{",
"var",
"point",
"=",
"this",
".",
"getMousePoint",
"(",
"event",
")",
";",
"if",
"(",
"this",
".",
"_crop",
"instanceof",
"IMSoftcrop",
".",
"Softcrop",
"&&",
"typeof",
"this",
".",
"handle",
"===",
"'string'",
")",
... | On mouse down event handler
@param event | [
"On",
"mouse",
"down",
"event",
"handler"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1442-L1460 | |
39,825 | Infomaker/cropjs | dist/js/cropjs.js | function (event) {
var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
var zoom = 0;
if (delta < 0 && this._zoomLevel < this._zoomMax) {
// Zoom in
zoom = this._zoomLevel < 1 ? 0.01 : 0.03;
}
else if (de... | javascript | function (event) {
var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
var zoom = 0;
if (delta < 0 && this._zoomLevel < this._zoomMax) {
// Zoom in
zoom = this._zoomLevel < 1 ? 0.01 : 0.03;
}
else if (de... | [
"function",
"(",
"event",
")",
"{",
"var",
"delta",
"=",
"Math",
".",
"max",
"(",
"-",
"1",
",",
"Math",
".",
"min",
"(",
"1",
",",
"(",
"event",
".",
"wheelDelta",
"||",
"-",
"event",
".",
"detail",
")",
")",
")",
";",
"var",
"zoom",
"=",
"0... | On mouse wheel event handler.
@fixme Fix code for calculating offsets based on current mouse point
@param event | [
"On",
"mouse",
"wheel",
"event",
"handler",
"."
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1565-L1595 | |
39,826 | Infomaker/cropjs | dist/js/cropjs.js | function (event) {
return {
x: event.pageX - this._position.x,
y: event.pageY - this._position.y
};
} | javascript | function (event) {
return {
x: event.pageX - this._position.x,
y: event.pageY - this._position.y
};
} | [
"function",
"(",
"event",
")",
"{",
"return",
"{",
"x",
":",
"event",
".",
"pageX",
"-",
"this",
".",
"_position",
".",
"x",
",",
"y",
":",
"event",
".",
"pageY",
"-",
"this",
".",
"_position",
".",
"y",
"}",
";",
"}"
] | Get mouse coordinates
@param event
@returns {{x: number, y: number}} | [
"Get",
"mouse",
"coordinates"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1603-L1608 | |
39,827 | Infomaker/cropjs | dist/js/cropjs.js | function() {
var offset = IMSoftcrop.Ratio.getElementPosition(this._canvas);
this._position.x = offset.x;
this._position.y = offset.y;
} | javascript | function() {
var offset = IMSoftcrop.Ratio.getElementPosition(this._canvas);
this._position.x = offset.x;
this._position.y = offset.y;
} | [
"function",
"(",
")",
"{",
"var",
"offset",
"=",
"IMSoftcrop",
".",
"Ratio",
".",
"getElementPosition",
"(",
"this",
".",
"_canvas",
")",
";",
"this",
".",
"_position",
".",
"x",
"=",
"offset",
".",
"x",
";",
"this",
".",
"_position",
".",
"y",
"=",
... | Calculate true x,y offset of canvas, including the border and margin
@returns {{x: number, y: number}} | [
"Calculate",
"true",
"x",
"y",
"offset",
"of",
"canvas",
"including",
"the",
"border",
"and",
"margin"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1624-L1629 | |
39,828 | Infomaker/cropjs | dist/js/cropjs.js | function () {
this._drawCross(
'red',
{
x: this._container.clientWidth / 2,
y: this._container.clientHeight / 2
}
);
this._drawCross(
'green',
{
... | javascript | function () {
this._drawCross(
'red',
{
x: this._container.clientWidth / 2,
y: this._container.clientHeight / 2
}
);
this._drawCross(
'green',
{
... | [
"function",
"(",
")",
"{",
"this",
".",
"_drawCross",
"(",
"'red'",
",",
"{",
"x",
":",
"this",
".",
"_container",
".",
"clientWidth",
"/",
"2",
",",
"y",
":",
"this",
".",
"_container",
".",
"clientHeight",
"/",
"2",
"}",
")",
";",
"this",
".",
... | Render and output debug position and dimensions
@private | [
"Render",
"and",
"output",
"debug",
"position",
"and",
"dimensions"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1636-L1672 | |
39,829 | Infomaker/cropjs | dist/js/cropjs.js | function (color, point) {
var ctx = this._canvas.getContext('2d');
ctx.beginPath();
ctx.fillStyle = color;
ctx.strokeStyle = color;
ctx.lineWidth = 0.5;
ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI, false);
ctx.fill();
ctx... | javascript | function (color, point) {
var ctx = this._canvas.getContext('2d');
ctx.beginPath();
ctx.fillStyle = color;
ctx.strokeStyle = color;
ctx.lineWidth = 0.5;
ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI, false);
ctx.fill();
ctx... | [
"function",
"(",
"color",
",",
"point",
")",
"{",
"var",
"ctx",
"=",
"this",
".",
"_canvas",
".",
"getContext",
"(",
"'2d'",
")",
";",
"ctx",
".",
"beginPath",
"(",
")",
";",
"ctx",
".",
"fillStyle",
"=",
"color",
";",
"ctx",
".",
"strokeStyle",
"=... | Helper function for drawing a cross mark
@param color
@param point | [
"Helper",
"function",
"for",
"drawing",
"a",
"cross",
"mark"
] | 10a84e6d83d07b327cbed3714e42b5ba3bd506b5 | https://github.com/Infomaker/cropjs/blob/10a84e6d83d07b327cbed3714e42b5ba3bd506b5/dist/js/cropjs.js#L1680-L1700 | |
39,830 | SewanDevs/ceiba-router | packages/path-matcher/src/compileTree.js | globsToRegExpStr | function globsToRegExpStr(str) {
return str.split(STRING_TESTS.GLOBSTAR)
// => [ theWholeTextIfThereIsNoGlobstar, "**", everythingAfter ]
.map((v, i) =>
(i + 1) % 2 === 0 ? // (**) part
// Replace unescaped '**' glob
v.r... | javascript | function globsToRegExpStr(str) {
return str.split(STRING_TESTS.GLOBSTAR)
// => [ theWholeTextIfThereIsNoGlobstar, "**", everythingAfter ]
.map((v, i) =>
(i + 1) % 2 === 0 ? // (**) part
// Replace unescaped '**' glob
v.r... | [
"function",
"globsToRegExpStr",
"(",
"str",
")",
"{",
"return",
"str",
".",
"split",
"(",
"STRING_TESTS",
".",
"GLOBSTAR",
")",
"// => [ theWholeTextIfThereIsNoGlobstar, \"**\", everythingAfter ]",
".",
"map",
"(",
"(",
"v",
",",
"i",
")",
"=>",
"(",
"i",
"+",
... | Transform globs into RegExp string | [
"Transform",
"globs",
"into",
"RegExp",
"string"
] | d92478426b3d246ffd04d8943349b75bc20049b3 | https://github.com/SewanDevs/ceiba-router/blob/d92478426b3d246ffd04d8943349b75bc20049b3/packages/path-matcher/src/compileTree.js#L47-L61 |
39,831 | SewanDevs/ceiba-router | packages/path-matcher/src/compileTree.js | preparePatternStringSegment | function preparePatternStringSegment(str) {
if (STRING_TESTS.ARRAY.test(str)) {
const els = str.replace(/([^\\]),/g, "$1$1,")
.split(/[^\\],/);
return arrayToORRegExpStr(els.map(_transformSegment))
} else {
return _transformSegment(str);
}
} | javascript | function preparePatternStringSegment(str) {
if (STRING_TESTS.ARRAY.test(str)) {
const els = str.replace(/([^\\]),/g, "$1$1,")
.split(/[^\\],/);
return arrayToORRegExpStr(els.map(_transformSegment))
} else {
return _transformSegment(str);
}
} | [
"function",
"preparePatternStringSegment",
"(",
"str",
")",
"{",
"if",
"(",
"STRING_TESTS",
".",
"ARRAY",
".",
"test",
"(",
"str",
")",
")",
"{",
"const",
"els",
"=",
"str",
".",
"replace",
"(",
"/",
"([^\\\\]),",
"/",
"g",
",",
"\"$1$1,\"",
")",
".",
... | Prepare string to be passed through RegExp constructor while transforming
glob patterns. | [
"Prepare",
"string",
"to",
"be",
"passed",
"through",
"RegExp",
"constructor",
"while",
"transforming",
"glob",
"patterns",
"."
] | d92478426b3d246ffd04d8943349b75bc20049b3 | https://github.com/SewanDevs/ceiba-router/blob/d92478426b3d246ffd04d8943349b75bc20049b3/packages/path-matcher/src/compileTree.js#L71-L79 |
39,832 | blaise-io/gcc-rest | gcc-rest.js | function(setting, value) {
if (-1 === this._supportedPostParams.indexOf(setting)) {
this.console.error('Parameter unsupported, may cause error:', setting);
}
this._reqParam[setting] = value;
return this;
} | javascript | function(setting, value) {
if (-1 === this._supportedPostParams.indexOf(setting)) {
this.console.error('Parameter unsupported, may cause error:', setting);
}
this._reqParam[setting] = value;
return this;
} | [
"function",
"(",
"setting",
",",
"value",
")",
"{",
"if",
"(",
"-",
"1",
"===",
"this",
".",
"_supportedPostParams",
".",
"indexOf",
"(",
"setting",
")",
")",
"{",
"this",
".",
"console",
".",
"error",
"(",
"'Parameter unsupported, may cause error:'",
",",
... | Set a Google Closure Compiler request parameter.
@param {string} setting
@param {string|Array} value
@return {GccRest} | [
"Set",
"a",
"Google",
"Closure",
"Compiler",
"request",
"parameter",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L57-L63 | |
39,833 | blaise-io/gcc-rest | gcc-rest.js | function(settings) {
for (var k in settings) {
if (settings.hasOwnProperty(k)) {
this.param(k, settings[k]);
}
}
return this;
} | javascript | function(settings) {
for (var k in settings) {
if (settings.hasOwnProperty(k)) {
this.param(k, settings[k]);
}
}
return this;
} | [
"function",
"(",
"settings",
")",
"{",
"for",
"(",
"var",
"k",
"in",
"settings",
")",
"{",
"if",
"(",
"settings",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"this",
".",
"param",
"(",
"k",
",",
"settings",
"[",
"k",
"]",
")",
";",
"}",
"}"... | Set multiple Google Closure Compiler request parameters.
@param {Object} settings
@return {GccRest} | [
"Set",
"multiple",
"Google",
"Closure",
"Compiler",
"request",
"parameters",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L70-L77 | |
39,834 | blaise-io/gcc-rest | gcc-rest.js | function(varArgs) {
for (var i = 0, m = arguments.length; i < m; i++) {
this.addFile(arguments[i]);
}
return this;
} | javascript | function(varArgs) {
for (var i = 0, m = arguments.length; i < m; i++) {
this.addFile(arguments[i]);
}
return this;
} | [
"function",
"(",
"varArgs",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"m",
"=",
"arguments",
".",
"length",
";",
"i",
"<",
"m",
";",
"i",
"++",
")",
"{",
"this",
".",
"addFile",
"(",
"arguments",
"[",
"i",
"]",
")",
";",
"}",
"return",... | Add multiple files to the list of files to be compiled.
@param {...string} varArgs
@return {GccRest} | [
"Add",
"multiple",
"files",
"to",
"the",
"list",
"of",
"files",
"to",
"be",
"compiled",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L122-L127 | |
39,835 | blaise-io/gcc-rest | gcc-rest.js | function(config) {
var data, request;
data = querystring.stringify(config);
request = http.request(this._closureEndpoint, this._handleResponse.bind(this));
request.on('error', function(e) {
this.console.error('Request error', e);
this._errCallback('http_request_... | javascript | function(config) {
var data, request;
data = querystring.stringify(config);
request = http.request(this._closureEndpoint, this._handleResponse.bind(this));
request.on('error', function(e) {
this.console.error('Request error', e);
this._errCallback('http_request_... | [
"function",
"(",
"config",
")",
"{",
"var",
"data",
",",
"request",
";",
"data",
"=",
"querystring",
".",
"stringify",
"(",
"config",
")",
";",
"request",
"=",
"http",
".",
"request",
"(",
"this",
".",
"_closureEndpoint",
",",
"this",
".",
"_handleRespon... | Compile source HTTP request.
@param {Object} config
@private | [
"Compile",
"source",
"HTTP",
"request",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L189-L207 | |
39,836 | blaise-io/gcc-rest | gcc-rest.js | function(response) {
var chunks = [];
response.on('data', function(chunk) {
chunks.push(chunk);
});
response.on('end', function() {
var json = JSON.parse(chunks.join(''));
this._showOutputInfo(json);
this._handleOutput(json);
}.bi... | javascript | function(response) {
var chunks = [];
response.on('data', function(chunk) {
chunks.push(chunk);
});
response.on('end', function() {
var json = JSON.parse(chunks.join(''));
this._showOutputInfo(json);
this._handleOutput(json);
}.bi... | [
"function",
"(",
"response",
")",
"{",
"var",
"chunks",
"=",
"[",
"]",
";",
"response",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"chunk",
")",
"{",
"chunks",
".",
"push",
"(",
"chunk",
")",
";",
"}",
")",
";",
"response",
".",
"on",
"(",
... | Handle a succesful compile request response.
@param {ServerResponse} response
@private | [
"Handle",
"a",
"succesful",
"compile",
"request",
"response",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L228-L240 | |
39,837 | blaise-io/gcc-rest | gcc-rest.js | function(json) {
if (json.serverErrors) {
this._handleNoCompiledCode(json.serverErrors);
} else {
json.compiledCode = this._header + json.compiledCode;
if (this.file) {
this._writeOutputTofile(json.compiledCode);
}
if (this.ca... | javascript | function(json) {
if (json.serverErrors) {
this._handleNoCompiledCode(json.serverErrors);
} else {
json.compiledCode = this._header + json.compiledCode;
if (this.file) {
this._writeOutputTofile(json.compiledCode);
}
if (this.ca... | [
"function",
"(",
"json",
")",
"{",
"if",
"(",
"json",
".",
"serverErrors",
")",
"{",
"this",
".",
"_handleNoCompiledCode",
"(",
"json",
".",
"serverErrors",
")",
";",
"}",
"else",
"{",
"json",
".",
"compiledCode",
"=",
"this",
".",
"_header",
"+",
"jso... | Handle output JSON object
@param {Object} json
@private | [
"Handle",
"output",
"JSON",
"object"
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L247-L265 | |
39,838 | blaise-io/gcc-rest | gcc-rest.js | function(response) {
this.console.error('Server responded with error:');
this.console.error('Status', response.statusCode);
this.console.error('Headers', response.headers);
response.on('data', function(chunk) {
this.console.info('Body', chunk);
}.bind(this));
... | javascript | function(response) {
this.console.error('Server responded with error:');
this.console.error('Status', response.statusCode);
this.console.error('Headers', response.headers);
response.on('data', function(chunk) {
this.console.info('Body', chunk);
}.bind(this));
... | [
"function",
"(",
"response",
")",
"{",
"this",
".",
"console",
".",
"error",
"(",
"'Server responded with error:'",
")",
";",
"this",
".",
"console",
".",
"error",
"(",
"'Status'",
",",
"response",
".",
"statusCode",
")",
";",
"this",
".",
"console",
".",
... | Handle a failed compile request response.
@param {ServerResponse} response
@private | [
"Handle",
"a",
"failed",
"compile",
"request",
"response",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L284-L292 | |
39,839 | blaise-io/gcc-rest | gcc-rest.js | function(err) {
var file = fs.realpathSync(this.file);
if (!err) {
this.console.info('Compiled code saved to', file);
} else {
this.console.info('Saving code failed to', file);
}
} | javascript | function(err) {
var file = fs.realpathSync(this.file);
if (!err) {
this.console.info('Compiled code saved to', file);
} else {
this.console.info('Saving code failed to', file);
}
} | [
"function",
"(",
"err",
")",
"{",
"var",
"file",
"=",
"fs",
".",
"realpathSync",
"(",
"this",
".",
"file",
")",
";",
"if",
"(",
"!",
"err",
")",
"{",
"this",
".",
"console",
".",
"info",
"(",
"'Compiled code saved to'",
",",
"file",
")",
";",
"}",
... | Report result of writing compiled code to file.
@param {string} err
@private | [
"Report",
"result",
"of",
"writing",
"compiled",
"code",
"to",
"file",
"."
] | 680b6a2f18f24fcbce8c71fad6393f7963129d9e | https://github.com/blaise-io/gcc-rest/blob/680b6a2f18f24fcbce8c71fad6393f7963129d9e/gcc-rest.js#L355-L362 | |
39,840 | dreampiggy/functional.js | Retroactive/lib/data_structures/heap.js | MinHeap | function MinHeap(compareFn) {
this._elements = [null];
this._comparator = new Comparator(compareFn);
Object.defineProperty(this, 'n', {
get: function () {
return this._elements.length - 1;
}.bind(this)
});
} | javascript | function MinHeap(compareFn) {
this._elements = [null];
this._comparator = new Comparator(compareFn);
Object.defineProperty(this, 'n', {
get: function () {
return this._elements.length - 1;
}.bind(this)
});
} | [
"function",
"MinHeap",
"(",
"compareFn",
")",
"{",
"this",
".",
"_elements",
"=",
"[",
"null",
"]",
";",
"this",
".",
"_comparator",
"=",
"new",
"Comparator",
"(",
"compareFn",
")",
";",
"Object",
".",
"defineProperty",
"(",
"this",
",",
"'n'",
",",
"{... | Basic Heap structure | [
"Basic",
"Heap",
"structure"
] | ec7b7213de7965659a8a1e8fa61438e3ae564260 | https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/heap.js#L7-L16 |
39,841 | skerit/protoblast | lib/init.js | parseUseragent | function parseUseragent(ua) {
if (!ua) {
return null;
}
let platform,
webview = false,
version,
engine,
result,
major,
minor,
patch,
float,
index,
name,
temp,
os;
ua = ua.toLowerCase();
if (~ua.indexOf('mobile')) {
platform = 'm... | javascript | function parseUseragent(ua) {
if (!ua) {
return null;
}
let platform,
webview = false,
version,
engine,
result,
major,
minor,
patch,
float,
index,
name,
temp,
os;
ua = ua.toLowerCase();
if (~ua.indexOf('mobile')) {
platform = 'm... | [
"function",
"parseUseragent",
"(",
"ua",
")",
"{",
"if",
"(",
"!",
"ua",
")",
"{",
"return",
"null",
";",
"}",
"let",
"platform",
",",
"webview",
"=",
"false",
",",
"version",
",",
"engine",
",",
"result",
",",
"major",
",",
"minor",
",",
"patch",
... | Parse a useragent string
@author Jelle De Loecker <jelle@develry.be>
@since 0.6.6
@version 0.6.6
@param {String} useragent
@return {Object} | [
"Parse",
"a",
"useragent",
"string"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/init.js#L44-L149 |
39,842 | skerit/protoblast | lib/init.js | clearAndDoTasks | function clearAndDoTasks(arr) {
var tasks = arr.slice(0),
i;
// Clear the original array
arr.length = 0;
for (i = 0; i < tasks.length; i++) {
tasks[i]();
}
} | javascript | function clearAndDoTasks(arr) {
var tasks = arr.slice(0),
i;
// Clear the original array
arr.length = 0;
for (i = 0; i < tasks.length; i++) {
tasks[i]();
}
} | [
"function",
"clearAndDoTasks",
"(",
"arr",
")",
"{",
"var",
"tasks",
"=",
"arr",
".",
"slice",
"(",
"0",
")",
",",
"i",
";",
"// Clear the original array",
"arr",
".",
"length",
"=",
"0",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"tasks",
".",... | Do the tasks in an array
@author Jelle De Loecker <jelle@develry.be>
@since 0.6.5
@version 0.6.5 | [
"Do",
"the",
"tasks",
"in",
"an",
"array"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/init.js#L1175-L1186 |
39,843 | skerit/protoblast | lib/init.js | checkNextRequire | function checkNextRequire(options) {
if (!modulep) {
return;
}
if (options.strict === false) {
return;
}
// Overwrite the original wrap method
modulep.wrap = function wrap(script) {
var head;
// Restore the original functions
modulep.wrap = modulep.original_wrap;
modulep._resolveFilen... | javascript | function checkNextRequire(options) {
if (!modulep) {
return;
}
if (options.strict === false) {
return;
}
// Overwrite the original wrap method
modulep.wrap = function wrap(script) {
var head;
// Restore the original functions
modulep.wrap = modulep.original_wrap;
modulep._resolveFilen... | [
"function",
"checkNextRequire",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"modulep",
")",
"{",
"return",
";",
"}",
"if",
"(",
"options",
".",
"strict",
"===",
"false",
")",
"{",
"return",
";",
"}",
"// Overwrite the original wrap method",
"modulep",
".",
"... | PROTOBLAST START CUT
Check require call
@author Jelle De Loecker <jelle@develry.be>
@version 0.6.6
@param {Object} options | [
"PROTOBLAST",
"START",
"CUT",
"Check",
"require",
"call"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/init.js#L1348-L1405 |
39,844 | jprichardson/node-dq | lib/dq.js | Queue | function Queue (name, redisClient) {
this.hasQuit = false
this._name = name
this.redisClient = redisClient
this._key = Queue.PREFIX + this.name
} | javascript | function Queue (name, redisClient) {
this.hasQuit = false
this._name = name
this.redisClient = redisClient
this._key = Queue.PREFIX + this.name
} | [
"function",
"Queue",
"(",
"name",
",",
"redisClient",
")",
"{",
"this",
".",
"hasQuit",
"=",
"false",
"this",
".",
"_name",
"=",
"name",
"this",
".",
"redisClient",
"=",
"redisClient",
"this",
".",
"_key",
"=",
"Queue",
".",
"PREFIX",
"+",
"this",
".",... | redis.debug_mode = true | [
"redis",
".",
"debug_mode",
"=",
"true"
] | 1e8fe3cd14ae54b05d2cdf1bc8d56c1fccdb2f3d | https://github.com/jprichardson/node-dq/blob/1e8fe3cd14ae54b05d2cdf1bc8d56c1fccdb2f3d/lib/dq.js#L5-L10 |
39,845 | EikosPartners/scalejs | dist/scalejs.base.array.js | removeOne | function removeOne(array, item) {
var found = array.indexOf(item);
if (found > -1) {
array.splice(found, 1);
}
} | javascript | function removeOne(array, item) {
var found = array.indexOf(item);
if (found > -1) {
array.splice(found, 1);
}
} | [
"function",
"removeOne",
"(",
"array",
",",
"item",
")",
"{",
"var",
"found",
"=",
"array",
".",
"indexOf",
"(",
"item",
")",
";",
"if",
"(",
"found",
">",
"-",
"1",
")",
"{",
"array",
".",
"splice",
"(",
"found",
",",
"1",
")",
";",
"}",
"}"
] | Removes the first occurrance of the passed item from the passed array
@param {Array} array list remove the item from
@param {Any} item item to be removed from the list
@memberOf array | [
"Removes",
"the",
"first",
"occurrance",
"of",
"the",
"passed",
"item",
"from",
"the",
"passed",
"array"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.array.js#L42-L47 |
39,846 | EikosPartners/scalejs | dist/scalejs.base.array.js | copy | function copy(array, first, count) {
first = valueOrDefault(first, 0);
count = valueOrDefault(count, array.length);
return Array.prototype.slice.call(array, first, count);
} | javascript | function copy(array, first, count) {
first = valueOrDefault(first, 0);
count = valueOrDefault(count, array.length);
return Array.prototype.slice.call(array, first, count);
} | [
"function",
"copy",
"(",
"array",
",",
"first",
",",
"count",
")",
"{",
"first",
"=",
"valueOrDefault",
"(",
"first",
",",
"0",
")",
";",
"count",
"=",
"valueOrDefault",
"(",
"count",
",",
"array",
".",
"length",
")",
";",
"return",
"Array",
".",
"pr... | Copy the items from the array into a new one
@param {Array} array list to copy from
@param {Number} [first] starting index to copy from (defult:0)
@param {Number} [count] number of items to copy (default:array.length)
@memberOf array
@return {Array} copied list | [
"Copy",
"the",
"items",
"from",
"the",
"array",
"into",
"a",
"new",
"one"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.array.js#L68-L72 |
39,847 | EikosPartners/scalejs | dist/scalejs.base.array.js | find | function find(array, f, context) {
var i, // iterative variable
l; // array length variable
for (i = 0, l = array.length; i < l; i += 1) {
if (array.hasOwnProperty(i) && f.call(context, array[i], i, array)) {
return array[i];
}
}
return null;
} | javascript | function find(array, f, context) {
var i, // iterative variable
l; // array length variable
for (i = 0, l = array.length; i < l; i += 1) {
if (array.hasOwnProperty(i) && f.call(context, array[i], i, array)) {
return array[i];
}
}
return null;
} | [
"function",
"find",
"(",
"array",
",",
"f",
",",
"context",
")",
"{",
"var",
"i",
",",
"// iterative variable",
"l",
";",
"// array length variable",
"for",
"(",
"i",
"=",
"0",
",",
"l",
"=",
"array",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"+... | Finds the passed item in the array
@param {Array} array list in which to search
@param {Function} f function to seach with
@param {Any} content context on which to call the function
@memberOf array
@return {Any|Object} item if found, null if not | [
"Finds",
"the",
"passed",
"item",
"in",
"the",
"array"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.array.js#L83-L94 |
39,848 | stezu/node-stream | lib/modifiers/batch.js | batch | function batch(options) {
var validationError = validateOptions(options);
var settings = _.extend({
time: 0,
count: 0
}, options);
var cache = [];
var lastWrite = 0;
var timeout;
/**
* @private
* @description
* Writes all the collected data to the stream.
*
* @param {Stream} stre... | javascript | function batch(options) {
var validationError = validateOptions(options);
var settings = _.extend({
time: 0,
count: 0
}, options);
var cache = [];
var lastWrite = 0;
var timeout;
/**
* @private
* @description
* Writes all the collected data to the stream.
*
* @param {Stream} stre... | [
"function",
"batch",
"(",
"options",
")",
"{",
"var",
"validationError",
"=",
"validateOptions",
"(",
"options",
")",
";",
"var",
"settings",
"=",
"_",
".",
"extend",
"(",
"{",
"time",
":",
"0",
",",
"count",
":",
"0",
"}",
",",
"options",
")",
";",
... | Returns a new stream that batches writes based on a specific interval, count of items, or both.
All items read on the stream and will be re-emitted as part of an array of one or more items
based on the criteria defined in the options.
@method
@static
@since 1.5.0
@category Modifiers
@param {Object} [options] ... | [
"Returns",
"a",
"new",
"stream",
"that",
"batches",
"writes",
"based",
"on",
"a",
"specific",
"interval",
"count",
"of",
"items",
"or",
"both",
".",
"All",
"items",
"read",
"on",
"the",
"stream",
"and",
"will",
"be",
"re",
"-",
"emitted",
"as",
"part",
... | f70c03351746c958865a854f614932f1df441b9b | https://github.com/stezu/node-stream/blob/f70c03351746c958865a854f614932f1df441b9b/lib/modifiers/batch.js#L112-L232 |
39,849 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js | ConditionalExpression | function ConditionalExpression(node, print) {
print.plain(node.test);
this.space();
this.push("?");
this.space();
print.plain(node.consequent);
this.space();
this.push(":");
this.space();
print.plain(node.alternate);
} | javascript | function ConditionalExpression(node, print) {
print.plain(node.test);
this.space();
this.push("?");
this.space();
print.plain(node.consequent);
this.space();
this.push(":");
this.space();
print.plain(node.alternate);
} | [
"function",
"ConditionalExpression",
"(",
"node",
",",
"print",
")",
"{",
"print",
".",
"plain",
"(",
"node",
".",
"test",
")",
";",
"this",
".",
"space",
"(",
")",
";",
"this",
".",
"push",
"(",
"\"?\"",
")",
";",
"this",
".",
"space",
"(",
")",
... | Prints ConditionalExpression, prints test, consequent, and alternate. | [
"Prints",
"ConditionalExpression",
"prints",
"test",
"consequent",
"and",
"alternate",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js#L121-L131 |
39,850 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js | AssignmentPattern | function AssignmentPattern(node, print) {
print.plain(node.left);
this.push(" = ");
print.plain(node.right);
} | javascript | function AssignmentPattern(node, print) {
print.plain(node.left);
this.push(" = ");
print.plain(node.right);
} | [
"function",
"AssignmentPattern",
"(",
"node",
",",
"print",
")",
"{",
"print",
".",
"plain",
"(",
"node",
".",
"left",
")",
";",
"this",
".",
"push",
"(",
"\" = \"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"right",
")",
";",
"}"
] | Prints AssignmentPattern, prints left and right. | [
"Prints",
"AssignmentPattern",
"prints",
"left",
"and",
"right",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js#L259-L263 |
39,851 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js | AssignmentExpression | function AssignmentExpression(node, print, parent) {
// Somewhere inside a for statement `init` node but doesn't usually
// needs a paren except for `in` expressions: `for (a in b ? a : b;;)`
var parens = this._inForStatementInit && node.operator === "in" && !_node2["default"].needsParens(node, parent);
if (pa... | javascript | function AssignmentExpression(node, print, parent) {
// Somewhere inside a for statement `init` node but doesn't usually
// needs a paren except for `in` expressions: `for (a in b ? a : b;;)`
var parens = this._inForStatementInit && node.operator === "in" && !_node2["default"].needsParens(node, parent);
if (pa... | [
"function",
"AssignmentExpression",
"(",
"node",
",",
"print",
",",
"parent",
")",
"{",
"// Somewhere inside a for statement `init` node but doesn't usually",
"// needs a paren except for `in` expressions: `for (a in b ? a : b;;)`",
"var",
"parens",
"=",
"this",
".",
"_inForStateme... | Prints AssignmentExpression, prints left, operator, and right. | [
"Prints",
"AssignmentExpression",
"prints",
"left",
"operator",
"and",
"right",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js#L269-L300 |
39,852 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js | BindExpression | function BindExpression(node, print) {
print.plain(node.object);
this.push("::");
print.plain(node.callee);
} | javascript | function BindExpression(node, print) {
print.plain(node.object);
this.push("::");
print.plain(node.callee);
} | [
"function",
"BindExpression",
"(",
"node",
",",
"print",
")",
"{",
"print",
".",
"plain",
"(",
"node",
".",
"object",
")",
";",
"this",
".",
"push",
"(",
"\"::\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"callee",
")",
";",
"}"
] | Prints BindExpression, prints object and callee. | [
"Prints",
"BindExpression",
"prints",
"object",
"and",
"callee",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/expressions.js#L306-L310 |
39,853 | dreampiggy/functional.js | Retroactive/lib/data_structures/linked_list.js | LinkedList | function LinkedList() {
this._length = 0;
this.head = null;
this.tail = null;
// Read-only length property
Object.defineProperty(this, 'length', {
get: function () {
return this._length;
}.bind(this)
});
} | javascript | function LinkedList() {
this._length = 0;
this.head = null;
this.tail = null;
// Read-only length property
Object.defineProperty(this, 'length', {
get: function () {
return this._length;
}.bind(this)
});
} | [
"function",
"LinkedList",
"(",
")",
"{",
"this",
".",
"_length",
"=",
"0",
";",
"this",
".",
"head",
"=",
"null",
";",
"this",
".",
"tail",
"=",
"null",
";",
"// Read-only length property",
"Object",
".",
"defineProperty",
"(",
"this",
",",
"'length'",
"... | Doubly-linked list | [
"Doubly",
"-",
"linked",
"list"
] | ec7b7213de7965659a8a1e8fa61438e3ae564260 | https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/linked_list.js#L6-L18 |
39,854 | aplib/processor.js | processor.js | function(object, __type, parameters, args) {
if (parameters) {
object.id = parameters.id || (parameters.id = (processor.id_generator++).toString(16)); // set per session uid
object.name = parameters.name;
// default prime binds
... | javascript | function(object, __type, parameters, args) {
if (parameters) {
object.id = parameters.id || (parameters.id = (processor.id_generator++).toString(16)); // set per session uid
object.name = parameters.name;
// default prime binds
... | [
"function",
"(",
"object",
",",
"__type",
",",
"parameters",
",",
"args",
")",
"{",
"if",
"(",
"parameters",
")",
"{",
"object",
".",
"id",
"=",
"parameters",
".",
"id",
"||",
"(",
"parameters",
".",
"id",
"=",
"(",
"processor",
".",
"id_generator",
... | Registered subtypes
Component initialization. Initialize component attributes ```parameters, arguments, parent, childs``` etc. Normally called from the constructor function of the component.
@param {object} object Object to be initialized.
@param {string} __type Base type of the component. This value is assigned to t... | [
"Registered",
"subtypes",
"Component",
"initialization",
".",
"Initialize",
"component",
"attributes",
"parameters",
"arguments",
"parent",
"childs",
"etc",
".",
"Normally",
"called",
"from",
"the",
"constructor",
"function",
"of",
"the",
"component",
"."
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L25-L56 | |
39,855 | aplib/processor.js | processor.js | function(type, factory) {
var key_parameters = {},
__type = parse_type(type, key_parameters) .toLowerCase();
// normalize prop name, remove lead '/'
for(var prop in key_parameters)
if (prop[0] === '/') {
key_parameters[prop.slice(1)] = key... | javascript | function(type, factory) {
var key_parameters = {},
__type = parse_type(type, key_parameters) .toLowerCase();
// normalize prop name, remove lead '/'
for(var prop in key_parameters)
if (prop[0] === '/') {
key_parameters[prop.slice(1)] = key... | [
"function",
"(",
"type",
",",
"factory",
")",
"{",
"var",
"key_parameters",
"=",
"{",
"}",
",",
"__type",
"=",
"parse_type",
"(",
"type",
",",
"key_parameters",
")",
".",
"toLowerCase",
"(",
")",
";",
"// normalize prop name, remove lead '/'",
"for",
"(",
"v... | Register factory function in the processor library
@param {string} type Type string can include namespace, type and optional parameters.
@param {function} factory Object or value factory function
@returns {undefined} no returns value | [
"Register",
"factory",
"function",
"in",
"the",
"processor",
"library"
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L77-L101 | |
39,856 | aplib/processor.js | processor.js | function(alias, type) {
var parameters = {},
__type = parse_type(type, parameters) .toLowerCase(),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + __type + ' not registered!');
this[alias.... | javascript | function(alias, type) {
var parameters = {},
__type = parse_type(type, parameters) .toLowerCase(),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + __type + ' not registered!');
this[alias.... | [
"function",
"(",
"alias",
",",
"type",
")",
"{",
"var",
"parameters",
"=",
"{",
"}",
",",
"__type",
"=",
"parse_type",
"(",
"type",
",",
"parameters",
")",
".",
"toLowerCase",
"(",
")",
",",
"constructor",
"=",
"resolve_ctr",
"(",
"__type",
",",
"param... | Register existing parameterized type as a standalone type
@param {string} alias New alias that will be registered, in format namespace.task
@param {string} type Existing base type + additional #parameters, in format existingtype#parameters
@returns {undefined} | [
"Register",
"existing",
"parameterized",
"type",
"as",
"a",
"standalone",
"type"
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L110-L118 | |
39,857 | aplib/processor.js | processor.js | function(type, parameters, args) {
parameters = parameters || {};
args = args || {};
var __type = parse_type(type, parameters, args),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + __type +... | javascript | function(type, parameters, args) {
parameters = parameters || {};
args = args || {};
var __type = parse_type(type, parameters, args),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + __type +... | [
"function",
"(",
"type",
",",
"parameters",
",",
"args",
")",
"{",
"parameters",
"=",
"parameters",
"||",
"{",
"}",
";",
"args",
"=",
"args",
"||",
"{",
"}",
";",
"var",
"__type",
"=",
"parse_type",
"(",
"type",
",",
"parameters",
",",
"args",
")",
... | Create from parsed parameters and arguments.
@param {string} type base type [and parameters].
@param {object} parameters Parsed parameters.
@param {object} args Parsed arguments.
@returns {object} Returns newly created component object. | [
"Create",
"from",
"parsed",
"parameters",
"and",
"arguments",
"."
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L128-L154 | |
39,858 | aplib/processor.js | processor.js | function(com) {
var root_nodes = this.root_nodes;
if (typeof com === 'string') {
if (com in processor) {
var object = processor[com];
if (typeof object === 'object' && '__type' in object) {
delete processor[name];
... | javascript | function(com) {
var root_nodes = this.root_nodes;
if (typeof com === 'string') {
if (com in processor) {
var object = processor[com];
if (typeof object === 'object' && '__type' in object) {
delete processor[name];
... | [
"function",
"(",
"com",
")",
"{",
"var",
"root_nodes",
"=",
"this",
".",
"root_nodes",
";",
"if",
"(",
"typeof",
"com",
"===",
"'string'",
")",
"{",
"if",
"(",
"com",
"in",
"processor",
")",
"{",
"var",
"object",
"=",
"processor",
"[",
"com",
"]",
... | Remove the specified root node.
@param {object|string} com Node object to be removed or root node name.
@returns Returns this. | [
"Remove",
"the",
"specified",
"root",
"node",
"."
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L280-L301 | |
39,859 | aplib/processor.js | processor.js | function(name, value) {
var parameters = this.parameters;
if (arguments.length < 1)
return parameters[name] || parameters['/' + name];
if (value !== parameters[name]) {
parameters[name] = value;
}
} | javascript | function(name, value) {
var parameters = this.parameters;
if (arguments.length < 1)
return parameters[name] || parameters['/' + name];
if (value !== parameters[name]) {
parameters[name] = value;
}
} | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"var",
"parameters",
"=",
"this",
".",
"parameters",
";",
"if",
"(",
"arguments",
".",
"length",
"<",
"1",
")",
"return",
"parameters",
"[",
"name",
"]",
"||",
"parameters",
"[",
"'/'",
"+",
"name",
"]... | Get or set parameter value.
@param {string} name Parameter name.
@param [value] value Parameter value.
@returns Returns parameter value or this. | [
"Get",
"or",
"set",
"parameter",
"value",
"."
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L709-L718 | |
39,860 | aplib/processor.js | processor.js | function(index, type, /*optional*/ $prime, /*optional*/ args, /*optional*/ callback, /*optional*/ this_arg) {
if (!type)
return;
// normalize arguments
if (typeof $prime === 'function') {
this_arg = args;
callback = $prime;
... | javascript | function(index, type, /*optional*/ $prime, /*optional*/ args, /*optional*/ callback, /*optional*/ this_arg) {
if (!type)
return;
// normalize arguments
if (typeof $prime === 'function') {
this_arg = args;
callback = $prime;
... | [
"function",
"(",
"index",
",",
"type",
",",
"/*optional*/",
"$prime",
",",
"/*optional*/",
"args",
",",
"/*optional*/",
"callback",
",",
"/*optional*/",
"this_arg",
")",
"{",
"if",
"(",
"!",
"type",
")",
"return",
";",
"// normalize arguments",
"if",
"(",
"t... | Create a new component and insert to the component.childs collection at the specified index.
@param {number} index Index in .childs collection.
@param {string} type Type and parameters.
@param [$prime] Prime value is a responsibility of the component. This parameter value can be of simple type or be derived from DataO... | [
"Create",
"a",
"new",
"component",
"and",
"insert",
"to",
"the",
"component",
".",
"childs",
"collection",
"at",
"the",
"specified",
"index",
"."
] | a0accdded562e8d91ba89f0551b63cb396baa39f | https://github.com/aplib/processor.js/blob/a0accdded562e8d91ba89f0551b63cb396baa39f/processor.js#L743-L835 | |
39,861 | McNull/gulp-angular | lib/vendor.js | getIncludeFiles | function getIncludeFiles(glob) {
var folders = settings.folders;
var options = {
read: false,
cwd: path.resolve(folders.dest + '/' + folders.vendor)
};
return gulp.src(glob, options);
} | javascript | function getIncludeFiles(glob) {
var folders = settings.folders;
var options = {
read: false,
cwd: path.resolve(folders.dest + '/' + folders.vendor)
};
return gulp.src(glob, options);
} | [
"function",
"getIncludeFiles",
"(",
"glob",
")",
"{",
"var",
"folders",
"=",
"settings",
".",
"folders",
";",
"var",
"options",
"=",
"{",
"read",
":",
"false",
",",
"cwd",
":",
"path",
".",
"resolve",
"(",
"folders",
".",
"dest",
"+",
"'/'",
"+",
"fo... | - - - - 8-< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | [
"-",
"-",
"-",
"-",
"8",
"-",
"<",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"... | e41b659a4b4ee5ff6e8eecda8395e2e88829162f | https://github.com/McNull/gulp-angular/blob/e41b659a4b4ee5ff6e8eecda8395e2e88829162f/lib/vendor.js#L40-L51 |
39,862 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/node/parentheses.js | ObjectExpression | function ObjectExpression(node, parent) {
if (t.isExpressionStatement(parent)) {
// ({ foo: "bar" });
return true;
}
if (t.isMemberExpression(parent) && parent.object === node) {
// ({ foo: "bar" }).foo
return true;
}
return false;
} | javascript | function ObjectExpression(node, parent) {
if (t.isExpressionStatement(parent)) {
// ({ foo: "bar" });
return true;
}
if (t.isMemberExpression(parent) && parent.object === node) {
// ({ foo: "bar" }).foo
return true;
}
return false;
} | [
"function",
"ObjectExpression",
"(",
"node",
",",
"parent",
")",
"{",
"if",
"(",
"t",
".",
"isExpressionStatement",
"(",
"parent",
")",
")",
"{",
"// ({ foo: \"bar\" });",
"return",
"true",
";",
"}",
"if",
"(",
"t",
".",
"isMemberExpression",
"(",
"parent",
... | Test if ObjectExpression needs parentheses. | [
"Test",
"if",
"ObjectExpression",
"needs",
"parentheses",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/node/parentheses.js#L77-L89 |
39,863 | stadt-bielefeld/mapfile2js | src/build/determineTabs.js | determineTabs | function determineTabs(line, tab){
let tabs = '';
for (let i = 0; i < line.depth; i++) {
tabs += tab;
}
return tabs;
} | javascript | function determineTabs(line, tab){
let tabs = '';
for (let i = 0; i < line.depth; i++) {
tabs += tab;
}
return tabs;
} | [
"function",
"determineTabs",
"(",
"line",
",",
"tab",
")",
"{",
"let",
"tabs",
"=",
"''",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"line",
".",
"depth",
";",
"i",
"++",
")",
"{",
"tabs",
"+=",
"tab",
";",
"}",
"return",
"tabs",
"... | Determines spaces for a line
@param {object} line Line object
@param {string} tab A tab in spaces
@returns {string} Returns a string of spaces | [
"Determines",
"spaces",
"for",
"a",
"line"
] | 08497189503e8823d1c9f26b74ce4ad1025e59dd | https://github.com/stadt-bielefeld/mapfile2js/blob/08497189503e8823d1c9f26b74ce4ad1025e59dd/src/build/determineTabs.js#L8-L16 |
39,864 | JsCommunity/exec-promise | index.spec.js | function (fn) {
var origError = console.error
var origExit = process.exit
var origLog = console.log
console.error = error = jest.fn()
console.log = print = jest.fn()
process.exit = exit = jest.fn()
return execPromise(fn).then(
function (value) {
console.error = origError
... | javascript | function (fn) {
var origError = console.error
var origExit = process.exit
var origLog = console.log
console.error = error = jest.fn()
console.log = print = jest.fn()
process.exit = exit = jest.fn()
return execPromise(fn).then(
function (value) {
console.error = origError
... | [
"function",
"(",
"fn",
")",
"{",
"var",
"origError",
"=",
"console",
".",
"error",
"var",
"origExit",
"=",
"process",
".",
"exit",
"var",
"origLog",
"=",
"console",
".",
"log",
"console",
".",
"error",
"=",
"error",
"=",
"jest",
".",
"fn",
"(",
")",
... | Helper which runs execPromise with spies. | [
"Helper",
"which",
"runs",
"execPromise",
"with",
"spies",
"."
] | ba2f5ed4ac0b591e19bb7d99bc4f8462b9183f70 | https://github.com/JsCommunity/exec-promise/blob/ba2f5ed4ac0b591e19bb7d99bc4f8462b9183f70/index.spec.js#L21-L46 | |
39,865 | Minivera/mithril-hobbit | packages/hobbit-navigator/umd/hobbit-navigator.js | History | function History() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
classCallCheck(this, History);
this.configuration = Object.assign({}, baseConfig, config);
this.supported = checkSupport(window);
var _configuration = this.configu... | javascript | function History() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
classCallCheck(this, History);
this.configuration = Object.assign({}, baseConfig, config);
this.supported = checkSupport(window);
var _configuration = this.configu... | [
"function",
"History",
"(",
")",
"{",
"var",
"config",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"{",
"}",
";",
"classCallCheck",
"(",
"this",
",",
"History"... | Constructor for the history manager that sets the configuration from
the parameter and the base configuration available in the module.
@param {Object} [config={}] - Configuration that may overwrite the
default configuration of the module.
@param {boolean} [config.hashbanged=false] - Sets whether the router
should set t... | [
"Constructor",
"for",
"the",
"history",
"manager",
"that",
"sets",
"the",
"configuration",
"from",
"the",
"parameter",
"and",
"the",
"base",
"configuration",
"available",
"in",
"the",
"module",
"."
] | b3a192e6eadf8ac2e3788492d44114b1799cd34a | https://github.com/Minivera/mithril-hobbit/blob/b3a192e6eadf8ac2e3788492d44114b1799cd34a/packages/hobbit-navigator/umd/hobbit-navigator.js#L116-L146 |
39,866 | webgme/ui-replay | src/routers/UIRecorder/UIRecorder.js | start | function start(callback) {
var dbDeferred = Q.defer();
config = defaultConfig;
if (typeof gmeConfig.rest.components[CONFIG_ID] === 'object' &&
gmeConfig.rest.components[CONFIG_ID].options) {
config = gmeConfig.rest.components[CONFIG_ID].options;
}
mongodb.MongoClient.connect(confi... | javascript | function start(callback) {
var dbDeferred = Q.defer();
config = defaultConfig;
if (typeof gmeConfig.rest.components[CONFIG_ID] === 'object' &&
gmeConfig.rest.components[CONFIG_ID].options) {
config = gmeConfig.rest.components[CONFIG_ID].options;
}
mongodb.MongoClient.connect(confi... | [
"function",
"start",
"(",
"callback",
")",
"{",
"var",
"dbDeferred",
"=",
"Q",
".",
"defer",
"(",
")",
";",
"config",
"=",
"defaultConfig",
";",
"if",
"(",
"typeof",
"gmeConfig",
".",
"rest",
".",
"components",
"[",
"CONFIG_ID",
"]",
"===",
"'object'",
... | Called before the server starts listening.
@param {function} callback | [
"Called",
"before",
"the",
"server",
"starts",
"listening",
"."
] | 0e0ad90b044d92cd508af03246ce0e9cbc382097 | https://github.com/webgme/ui-replay/blob/0e0ad90b044d92cd508af03246ce0e9cbc382097/src/routers/UIRecorder/UIRecorder.js#L245-L265 |
39,867 | florianmaxim/Meta | src/Space/Meta/Graphics/loaders/GLTFLoader.js | GLTFTextureDDSExtension | function GLTFTextureDDSExtension() {
if ( ! THREE.DDSLoader ) {
throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
}
this.name = EXTENSIONS.MSFT_TEXTURE_DDS;
this.ddsLoader = new THREE.DDSLoader();
} | javascript | function GLTFTextureDDSExtension() {
if ( ! THREE.DDSLoader ) {
throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
}
this.name = EXTENSIONS.MSFT_TEXTURE_DDS;
this.ddsLoader = new THREE.DDSLoader();
} | [
"function",
"GLTFTextureDDSExtension",
"(",
")",
"{",
"if",
"(",
"!",
"THREE",
".",
"DDSLoader",
")",
"{",
"throw",
"new",
"Error",
"(",
"'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader'",
")",
";",
"}",
"this",
".",
"name",
"=",
... | DDS Texture Extension
Specification:
https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds | [
"DDS",
"Texture",
"Extension"
] | 917e0b138f9751f02563efd812884577bc1ae8a2 | https://github.com/florianmaxim/Meta/blob/917e0b138f9751f02563efd812884577bc1ae8a2/src/Space/Meta/Graphics/loaders/GLTFLoader.js#L257-L268 |
39,868 | apostle/apostle.js | lib/index.js | send | function send(payload, promise) {
if (typeof apostle.domainKey == 'undefined'){
promise.reject('invalid', [{error: 'No domain key defined. Please set a domain key with `apostle.domainKey = "abc123"`'}])
return;
}
(request || superagent)
.post(apostle.deliveryEndpoint)
.type('json')
.send(payload)
.set('A... | javascript | function send(payload, promise) {
if (typeof apostle.domainKey == 'undefined'){
promise.reject('invalid', [{error: 'No domain key defined. Please set a domain key with `apostle.domainKey = "abc123"`'}])
return;
}
(request || superagent)
.post(apostle.deliveryEndpoint)
.type('json')
.send(payload)
.set('A... | [
"function",
"send",
"(",
"payload",
",",
"promise",
")",
"{",
"if",
"(",
"typeof",
"apostle",
".",
"domainKey",
"==",
"'undefined'",
")",
"{",
"promise",
".",
"reject",
"(",
"'invalid'",
",",
"[",
"{",
"error",
":",
"'No domain key defined. Please set a domain... | Delivery the JSON payload to the delivery endpoint via Request.
@param {object} Recipient Payload
- recipients {object} Email => data object of recipient information
@param {promise} Deferred promise object
@return {null} | [
"Delivery",
"the",
"JSON",
"payload",
"to",
"the",
"delivery",
"endpoint",
"via",
"Request",
"."
] | 17130d88b073ec365bdd14ba920809d6867b0243 | https://github.com/apostle/apostle.js/blob/17130d88b073ec365bdd14ba920809d6867b0243/lib/index.js#L25-L43 |
39,869 | apostle/apostle.js | lib/index.js | function(template, options) {
queue = apostle.createQueue();
queue.push(template, options);
return queue.deliver();
} | javascript | function(template, options) {
queue = apostle.createQueue();
queue.push(template, options);
return queue.deliver();
} | [
"function",
"(",
"template",
",",
"options",
")",
"{",
"queue",
"=",
"apostle",
".",
"createQueue",
"(",
")",
";",
"queue",
".",
"push",
"(",
"template",
",",
"options",
")",
";",
"return",
"queue",
".",
"deliver",
"(",
")",
";",
"}"
] | Delivers a single email.
@param {string} template id
@param {object} payload data, including email address
@param {function} callback
@return {null} | [
"Delivers",
"a",
"single",
"email",
"."
] | 17130d88b073ec365bdd14ba920809d6867b0243 | https://github.com/apostle/apostle.js/blob/17130d88b073ec365bdd14ba920809d6867b0243/lib/index.js#L55-L59 | |
39,870 | apostle/apostle.js | lib/index.js | function(template, options){
var payload = { data: {}, template_id: template };
// Add root attributes to the payload root
for(var attr in rootAttributes){
if(!rootAttributes.hasOwnProperty(attr)){
continue;
}
if(typeof options[attr] === 'undefined'){
continue;
}
var key = rootAt... | javascript | function(template, options){
var payload = { data: {}, template_id: template };
// Add root attributes to the payload root
for(var attr in rootAttributes){
if(!rootAttributes.hasOwnProperty(attr)){
continue;
}
if(typeof options[attr] === 'undefined'){
continue;
}
var key = rootAt... | [
"function",
"(",
"template",
",",
"options",
")",
"{",
"var",
"payload",
"=",
"{",
"data",
":",
"{",
"}",
",",
"template_id",
":",
"template",
"}",
";",
"// Add root attributes to the payload root",
"for",
"(",
"var",
"attr",
"in",
"rootAttributes",
")",
"{"... | Adds a single email to the queue.
@param {string} template id
@param {object} payload data, including email address
@return {null} | [
"Adds",
"a",
"single",
"email",
"to",
"the",
"queue",
"."
] | 17130d88b073ec365bdd14ba920809d6867b0243 | https://github.com/apostle/apostle.js/blob/17130d88b073ec365bdd14ba920809d6867b0243/lib/index.js#L136-L163 | |
39,871 | apostle/apostle.js | lib/index.js | function(){
var payload = { recipients: {} },
invalid = [],
promise = new Promise();
for(var i=0, j=this.mails.length; i < j; i++){
var data = this.mails[i],
email = data.email;
if(!data.template_id){
invalid.push(data)
data.error = "No template provided"
continue;
}
... | javascript | function(){
var payload = { recipients: {} },
invalid = [],
promise = new Promise();
for(var i=0, j=this.mails.length; i < j; i++){
var data = this.mails[i],
email = data.email;
if(!data.template_id){
invalid.push(data)
data.error = "No template provided"
continue;
}
... | [
"function",
"(",
")",
"{",
"var",
"payload",
"=",
"{",
"recipients",
":",
"{",
"}",
"}",
",",
"invalid",
"=",
"[",
"]",
",",
"promise",
"=",
"new",
"Promise",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"this",
".",
"mails... | Delivers all the emails on the queue.
@return {promise} An promise object | [
"Delivers",
"all",
"the",
"emails",
"on",
"the",
"queue",
"."
] | 17130d88b073ec365bdd14ba920809d6867b0243 | https://github.com/apostle/apostle.js/blob/17130d88b073ec365bdd14ba920809d6867b0243/lib/index.js#L170-L201 | |
39,872 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | DeclareModule | function DeclareModule(node, print) {
this.push("declare module ");
print.plain(node.id);
this.space();
print.plain(node.body);
} | javascript | function DeclareModule(node, print) {
this.push("declare module ");
print.plain(node.id);
this.space();
print.plain(node.body);
} | [
"function",
"DeclareModule",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"push",
"(",
"\"declare module \"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"id",
")",
";",
"this",
".",
"space",
"(",
")",
";",
"print",
".",
"plain",
"(",
"... | Prints DeclareModule, prints id and body. | [
"Prints",
"DeclareModule",
"prints",
"id",
"and",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L117-L122 |
39,873 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | _interfaceish | function _interfaceish(node, print) {
print.plain(node.id);
print.plain(node.typeParameters);
if (node["extends"].length) {
this.push(" extends ");
print.join(node["extends"], { separator: ", " });
}
if (node.mixins && node.mixins.length) {
this.push(" mixins ");
print.join(node.mixins, { sepa... | javascript | function _interfaceish(node, print) {
print.plain(node.id);
print.plain(node.typeParameters);
if (node["extends"].length) {
this.push(" extends ");
print.join(node["extends"], { separator: ", " });
}
if (node.mixins && node.mixins.length) {
this.push(" mixins ");
print.join(node.mixins, { sepa... | [
"function",
"_interfaceish",
"(",
"node",
",",
"print",
")",
"{",
"print",
".",
"plain",
"(",
"node",
".",
"id",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"typeParameters",
")",
";",
"if",
"(",
"node",
"[",
"\"extends\"",
"]",
".",
"length",... | Prints interface-like node, prints id, typeParameters, extends, and body. | [
"Prints",
"interface",
"-",
"like",
"node",
"prints",
"id",
"typeParameters",
"extends",
"and",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L209-L222 |
39,874 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | TupleTypeAnnotation | function TupleTypeAnnotation(node, print) {
this.push("[");
print.join(node.types, { separator: ", " });
this.push("]");
} | javascript | function TupleTypeAnnotation(node, print) {
this.push("[");
print.join(node.types, { separator: ", " });
this.push("]");
} | [
"function",
"TupleTypeAnnotation",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"push",
"(",
"\"[\"",
")",
";",
"print",
".",
"join",
"(",
"node",
".",
"types",
",",
"{",
"separator",
":",
"\", \"",
"}",
")",
";",
"this",
".",
"push",
"(",
"\"... | Prints TupleTypeAnnotation, prints types. | [
"Prints",
"TupleTypeAnnotation",
"prints",
"types",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L310-L314 |
39,875 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | TypeAlias | function TypeAlias(node, print) {
this.push("type ");
print.plain(node.id);
print.plain(node.typeParameters);
this.space();
this.push("=");
this.space();
print.plain(node.right);
this.semicolon();
} | javascript | function TypeAlias(node, print) {
this.push("type ");
print.plain(node.id);
print.plain(node.typeParameters);
this.space();
this.push("=");
this.space();
print.plain(node.right);
this.semicolon();
} | [
"function",
"TypeAlias",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"push",
"(",
"\"type \"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"id",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"typeParameters",
")",
";",
"this",
"."... | Prints TypeAlias, prints id, typeParameters, and right. | [
"Prints",
"TypeAlias",
"prints",
"id",
"typeParameters",
"and",
"right",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L329-L338 |
39,876 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | ObjectTypeIndexer | function ObjectTypeIndexer(node, print) {
if (node["static"]) this.push("static ");
this.push("[");
print.plain(node.id);
this.push(":");
this.space();
print.plain(node.key);
this.push("]");
this.push(":");
this.space();
print.plain(node.value);
} | javascript | function ObjectTypeIndexer(node, print) {
if (node["static"]) this.push("static ");
this.push("[");
print.plain(node.id);
this.push(":");
this.space();
print.plain(node.key);
this.push("]");
this.push(":");
this.space();
print.plain(node.value);
} | [
"function",
"ObjectTypeIndexer",
"(",
"node",
",",
"print",
")",
"{",
"if",
"(",
"node",
"[",
"\"static\"",
"]",
")",
"this",
".",
"push",
"(",
"\"static \"",
")",
";",
"this",
".",
"push",
"(",
"\"[\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
... | Prints ObjectTypeIndexer, prints id, key, and value, handles static. | [
"Prints",
"ObjectTypeIndexer",
"prints",
"id",
"key",
"and",
"value",
"handles",
"static",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L417-L428 |
39,877 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js | ObjectTypeProperty | function ObjectTypeProperty(node, print) {
if (node["static"]) this.push("static ");
print.plain(node.key);
if (node.optional) this.push("?");
if (!t.isFunctionTypeAnnotation(node.value)) {
this.push(":");
this.space();
}
print.plain(node.value);
} | javascript | function ObjectTypeProperty(node, print) {
if (node["static"]) this.push("static ");
print.plain(node.key);
if (node.optional) this.push("?");
if (!t.isFunctionTypeAnnotation(node.value)) {
this.push(":");
this.space();
}
print.plain(node.value);
} | [
"function",
"ObjectTypeProperty",
"(",
"node",
",",
"print",
")",
"{",
"if",
"(",
"node",
"[",
"\"static\"",
"]",
")",
"this",
".",
"push",
"(",
"\"static \"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"key",
")",
";",
"if",
"(",
"node",
"... | Prints ObjectTypeProperty, prints static, key, and value. | [
"Prints",
"ObjectTypeProperty",
"prints",
"static",
"key",
"and",
"value",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/flow.js#L434-L443 |
39,878 | caplinked/caplinked-api-node | src/caplinked-utils.js | responseErrorBuilder | function responseErrorBuilder(err, res) {
if (res && res.body && _.isObject(res.body) && res.body.error) {
// pass through error obj from API
return res.body;
} else {
// build custom error
return {
error: {
code: err.status || CL_CONSTANTS.RES_UNKNOWN,
message: (res ? res.text... | javascript | function responseErrorBuilder(err, res) {
if (res && res.body && _.isObject(res.body) && res.body.error) {
// pass through error obj from API
return res.body;
} else {
// build custom error
return {
error: {
code: err.status || CL_CONSTANTS.RES_UNKNOWN,
message: (res ? res.text... | [
"function",
"responseErrorBuilder",
"(",
"err",
",",
"res",
")",
"{",
"if",
"(",
"res",
"&&",
"res",
".",
"body",
"&&",
"_",
".",
"isObject",
"(",
"res",
".",
"body",
")",
"&&",
"res",
".",
"body",
".",
"error",
")",
"{",
"// pass through error obj fro... | Return an Error Object | [
"Return",
"an",
"Error",
"Object"
] | 944bbb6e2f315407f1aac4b9e8a463e9213d3631 | https://github.com/caplinked/caplinked-api-node/blob/944bbb6e2f315407f1aac4b9e8a463e9213d3631/src/caplinked-utils.js#L22-L35 |
39,879 | caplinked/caplinked-api-node | src/caplinked-utils.js | signedRequestHeaders | function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
if (!apiKey || !apiSecretKey || !apiUserToken) {
return false;
}
var apiExpDate = Math.floor(Date.now() / 1000) + 600;
var payload = apiKey + apiUserToken + apiExpDate;
var hash = CryptoJS.HmacSHA256(payload, apiSecretKey);
var... | javascript | function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
if (!apiKey || !apiSecretKey || !apiUserToken) {
return false;
}
var apiExpDate = Math.floor(Date.now() / 1000) + 600;
var payload = apiKey + apiUserToken + apiExpDate;
var hash = CryptoJS.HmacSHA256(payload, apiSecretKey);
var... | [
"function",
"signedRequestHeaders",
"(",
"apiKey",
",",
"apiSecretKey",
",",
"apiUserToken",
",",
"options",
")",
"{",
"if",
"(",
"!",
"apiKey",
"||",
"!",
"apiSecretKey",
"||",
"!",
"apiUserToken",
")",
"{",
"return",
"false",
";",
"}",
"var",
"apiExpDate",... | Return an Object of headers to attach to a request | [
"Return",
"an",
"Object",
"of",
"headers",
"to",
"attach",
"to",
"a",
"request"
] | 944bbb6e2f315407f1aac4b9e8a463e9213d3631 | https://github.com/caplinked/caplinked-api-node/blob/944bbb6e2f315407f1aac4b9e8a463e9213d3631/src/caplinked-utils.js#L38-L52 |
39,880 | jsBoot/gulp-docco | lib/backend.js | function(config){
// Do parse
this.process = function(vinyl){
var data = vinyl.contents.toString('utf8');
// Parse
var sections = parse(vinyl.path, data, config);
// Format
format(vinyl.path, sections, config);
// Compute new title
var first = marked.lexer(sections[... | javascript | function(config){
// Do parse
this.process = function(vinyl){
var data = vinyl.contents.toString('utf8');
// Parse
var sections = parse(vinyl.path, data, config);
// Format
format(vinyl.path, sections, config);
// Compute new title
var first = marked.lexer(sections[... | [
"function",
"(",
"config",
")",
"{",
"// Do parse",
"this",
".",
"process",
"=",
"function",
"(",
"vinyl",
")",
"{",
"var",
"data",
"=",
"vinyl",
".",
"contents",
".",
"toString",
"(",
"'utf8'",
")",
";",
"// Parse",
"var",
"sections",
"=",
"parse",
"(... | Just require extension and languages as far as config is concerned | [
"Just",
"require",
"extension",
"and",
"languages",
"as",
"far",
"as",
"config",
"is",
"concerned"
] | 05ab1bcf76952a5bc8e16713a31d6dd7f3d75517 | https://github.com/jsBoot/gulp-docco/blob/05ab1bcf76952a5bc8e16713a31d6dd7f3d75517/lib/backend.js#L24-L63 | |
39,881 | codius-deprecated/codius-engine | lib/contractrunner.js | ContractRunner | function ContractRunner(config, data) {
events.EventEmitter.call(this);
var self = this;
self.config = config;
if (typeof data !== 'object' ||
typeof data.manifest !== 'object') {
throw new Error('ApiHandler must be instantiated with the manifest');
}
self._manifest = data.manifest;
self._api... | javascript | function ContractRunner(config, data) {
events.EventEmitter.call(this);
var self = this;
self.config = config;
if (typeof data !== 'object' ||
typeof data.manifest !== 'object') {
throw new Error('ApiHandler must be instantiated with the manifest');
}
self._manifest = data.manifest;
self._api... | [
"function",
"ContractRunner",
"(",
"config",
",",
"data",
")",
"{",
"events",
".",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"var",
"self",
"=",
"this",
";",
"self",
".",
"config",
"=",
"config",
";",
"if",
"(",
"typeof",
"data",
"!==",
"'o... | Class to run contracts.
@param {Object} data.manifest
@param {Object} data.apis
@param {String} data.manifest_hash | [
"Class",
"to",
"run",
"contracts",
"."
] | 48aaea3d1a0dd2cf755a1905ff040e1667e8d131 | https://github.com/codius-deprecated/codius-engine/blob/48aaea3d1a0dd2cf755a1905ff040e1667e8d131/lib/contractrunner.js#L33-L66 |
39,882 | preceptorjs/taxi | lib/scripts/screenshot.js | function (needsStitching) {
var initData = {
viewPort: {},
document: {},
bodyTransform: {}
},
de = document.documentElement,
el = document.createElement('div'),
body = document.body;
// Get current scroll-... | javascript | function (needsStitching) {
var initData = {
viewPort: {},
document: {},
bodyTransform: {}
},
de = document.documentElement,
el = document.createElement('div'),
body = document.body;
// Get current scroll-... | [
"function",
"(",
"needsStitching",
")",
"{",
"var",
"initData",
"=",
"{",
"viewPort",
":",
"{",
"}",
",",
"document",
":",
"{",
"}",
",",
"bodyTransform",
":",
"{",
"}",
"}",
",",
"de",
"=",
"document",
".",
"documentElement",
",",
"el",
"=",
"docume... | Initializes screenshots and gathers data to revert changes.
This function will also gather information required for
screenshots like dimensions of document and view-port.
@method init
@param {boolean} needsStitching | [
"Initializes",
"screenshots",
"and",
"gathers",
"data",
"to",
"revert",
"changes",
".",
"This",
"function",
"will",
"also",
"gather",
"information",
"required",
"for",
"screenshots",
"like",
"dimensions",
"of",
"document",
"and",
"view",
"-",
"port",
"."
] | 96ab5a5c5fa9dc50f325ba4de52dd90009073ca3 | https://github.com/preceptorjs/taxi/blob/96ab5a5c5fa9dc50f325ba4de52dd90009073ca3/lib/scripts/screenshot.js#L11-L70 | |
39,883 | preceptorjs/taxi | lib/scripts/screenshot.js | function (initData) {
var body = document.body;
// Reset document height (if changed at all)
body.style.height = initData.document.cssHeight;
// Reset document offset
if (initData.needsStitching) {
body.style[initData.bodyTransform.property] = initData.bodyTransform.value;
}
... | javascript | function (initData) {
var body = document.body;
// Reset document height (if changed at all)
body.style.height = initData.document.cssHeight;
// Reset document offset
if (initData.needsStitching) {
body.style[initData.bodyTransform.property] = initData.bodyTransform.value;
}
... | [
"function",
"(",
"initData",
")",
"{",
"var",
"body",
"=",
"document",
".",
"body",
";",
"// Reset document height (if changed at all)",
"body",
".",
"style",
".",
"height",
"=",
"initData",
".",
"document",
".",
"cssHeight",
";",
"// Reset document offset",
"if",... | Reverts changes done to the document during the screenshot process
@method revert
@param {object} initData Data gathered during init-phase | [
"Reverts",
"changes",
"done",
"to",
"the",
"document",
"during",
"the",
"screenshot",
"process"
] | 96ab5a5c5fa9dc50f325ba4de52dd90009073ca3 | https://github.com/preceptorjs/taxi/blob/96ab5a5c5fa9dc50f325ba4de52dd90009073ca3/lib/scripts/screenshot.js#L78-L88 | |
39,884 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js | compile | function compile(filename) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var result;
opts.filename = filename;
var optsManager = new _transformationFileOptionsOptionManager2["default"]();
optsManager.mergeOptions(transformOpts);
opts = optsManager.init(opts);
va... | javascript | function compile(filename) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var result;
opts.filename = filename;
var optsManager = new _transformationFileOptionsOptionManager2["default"]();
optsManager.mergeOptions(transformOpts);
opts = optsManager.init(opts);
va... | [
"function",
"compile",
"(",
"filename",
")",
"{",
"var",
"opts",
"=",
"arguments",
".",
"length",
"<=",
"1",
"||",
"arguments",
"[",
"1",
"]",
"===",
"undefined",
"?",
"{",
"}",
":",
"arguments",
"[",
"1",
"]",
";",
"var",
"result",
";",
"opts",
".... | Compile a `filename` with optional `opts`. | [
"Compile",
"a",
"filename",
"with",
"optional",
"opts",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js#L110-L148 |
39,885 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js | shouldIgnore | function shouldIgnore(filename) {
if (!ignore && !only) {
return getRelativePath(filename).split(_path2["default"].sep).indexOf("node_modules") >= 0;
} else {
return util.shouldIgnore(filename, ignore || [], only);
}
} | javascript | function shouldIgnore(filename) {
if (!ignore && !only) {
return getRelativePath(filename).split(_path2["default"].sep).indexOf("node_modules") >= 0;
} else {
return util.shouldIgnore(filename, ignore || [], only);
}
} | [
"function",
"shouldIgnore",
"(",
"filename",
")",
"{",
"if",
"(",
"!",
"ignore",
"&&",
"!",
"only",
")",
"{",
"return",
"getRelativePath",
"(",
"filename",
")",
".",
"split",
"(",
"_path2",
"[",
"\"default\"",
"]",
".",
"sep",
")",
".",
"indexOf",
"(",... | Test if a `filename` should be ignored by Babel. | [
"Test",
"if",
"a",
"filename",
"should",
"be",
"ignored",
"by",
"Babel",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js#L154-L160 |
39,886 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js | istanbulLoader | function istanbulLoader(m, filename, old) {
istanbulMonkey[filename] = true;
old(m, filename);
} | javascript | function istanbulLoader(m, filename, old) {
istanbulMonkey[filename] = true;
old(m, filename);
} | [
"function",
"istanbulLoader",
"(",
"m",
",",
"filename",
",",
"old",
")",
"{",
"istanbulMonkey",
"[",
"filename",
"]",
"=",
"true",
";",
"old",
"(",
"m",
",",
"filename",
")",
";",
"}"
] | Replacement for the loader for istanbul. | [
"Replacement",
"for",
"the",
"loader",
"for",
"istanbul",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js#L191-L194 |
39,887 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js | registerExtension | function registerExtension(ext) {
var old = oldHandlers[ext] || oldHandlers[".js"] || require.extensions[".js"];
var loader = normalLoader;
if (process.env.running_under_istanbul) loader = istanbulLoader;
require.extensions[ext] = function (m, filename) {
if (shouldIgnore(filename)) {
old(m, filenam... | javascript | function registerExtension(ext) {
var old = oldHandlers[ext] || oldHandlers[".js"] || require.extensions[".js"];
var loader = normalLoader;
if (process.env.running_under_istanbul) loader = istanbulLoader;
require.extensions[ext] = function (m, filename) {
if (shouldIgnore(filename)) {
old(m, filenam... | [
"function",
"registerExtension",
"(",
"ext",
")",
"{",
"var",
"old",
"=",
"oldHandlers",
"[",
"ext",
"]",
"||",
"oldHandlers",
"[",
"\".js\"",
"]",
"||",
"require",
".",
"extensions",
"[",
"\".js\"",
"]",
";",
"var",
"loader",
"=",
"normalLoader",
";",
"... | Register a loader for an extension. | [
"Register",
"a",
"loader",
"for",
"an",
"extension",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js#L208-L221 |
39,888 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js | hookExtensions | function hookExtensions(_exts) {
_lodashCollectionEach2["default"](oldHandlers, function (old, ext) {
if (old === undefined) {
delete require.extensions[ext];
} else {
require.extensions[ext] = old;
}
});
oldHandlers = {};
_lodashCollectionEach2["default"](_exts, function (ext) {
o... | javascript | function hookExtensions(_exts) {
_lodashCollectionEach2["default"](oldHandlers, function (old, ext) {
if (old === undefined) {
delete require.extensions[ext];
} else {
require.extensions[ext] = old;
}
});
oldHandlers = {};
_lodashCollectionEach2["default"](_exts, function (ext) {
o... | [
"function",
"hookExtensions",
"(",
"_exts",
")",
"{",
"_lodashCollectionEach2",
"[",
"\"default\"",
"]",
"(",
"oldHandlers",
",",
"function",
"(",
"old",
",",
"ext",
")",
"{",
"if",
"(",
"old",
"===",
"undefined",
")",
"{",
"delete",
"require",
".",
"exten... | Register loader for given extensions. | [
"Register",
"loader",
"for",
"given",
"extensions",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js#L227-L242 |
39,889 | datagovsg/datagovsg-plottable-charts | src/helpers.js | monthConfigs | function monthConfigs () {
return [
[{
interval: Plottable.TimeInterval.month,
step: 1,
// full month name
formatter: Plottable.Formatters.time('%B')
}, {
interval: Plottable.TimeInterval.year,
step: 1,
formatter: Plottable.Formatters.time('%Y')
}],
[{
i... | javascript | function monthConfigs () {
return [
[{
interval: Plottable.TimeInterval.month,
step: 1,
// full month name
formatter: Plottable.Formatters.time('%B')
}, {
interval: Plottable.TimeInterval.year,
step: 1,
formatter: Plottable.Formatters.time('%Y')
}],
[{
i... | [
"function",
"monthConfigs",
"(",
")",
"{",
"return",
"[",
"[",
"{",
"interval",
":",
"Plottable",
".",
"TimeInterval",
".",
"month",
",",
"step",
":",
"1",
",",
"// full month name",
"formatter",
":",
"Plottable",
".",
"Formatters",
".",
"time",
"(",
"'%B'... | use the month steps in the orginal plottable library | [
"use",
"the",
"month",
"steps",
"in",
"the",
"orginal",
"plottable",
"library"
] | f08c65c50f4be32dacb984ba5fd916e23d11e9d2 | https://github.com/datagovsg/datagovsg-plottable-charts/blob/f08c65c50f4be32dacb984ba5fd916e23d11e9d2/src/helpers.js#L154-L197 |
39,890 | oscarr-reyes/node-diet-cross-origin | lib/helper.js | parseHeader | function parseHeader(value, name){
// Throw error if value is not array or string
if(value && (!utils.isArray(value) && !utils.isString(value))){
throw new Error(`Default Header for "${name}" must be Array or String`);
}
// In case when no error was threw, check if value is array
// Set all values to UpperCase ... | javascript | function parseHeader(value, name){
// Throw error if value is not array or string
if(value && (!utils.isArray(value) && !utils.isString(value))){
throw new Error(`Default Header for "${name}" must be Array or String`);
}
// In case when no error was threw, check if value is array
// Set all values to UpperCase ... | [
"function",
"parseHeader",
"(",
"value",
",",
"name",
")",
"{",
"// Throw error if value is not array or string",
"if",
"(",
"value",
"&&",
"(",
"!",
"utils",
".",
"isArray",
"(",
"value",
")",
"&&",
"!",
"utils",
".",
"isString",
"(",
"value",
")",
")",
"... | Parses the value for header data in response
@param {String|Array} value The value of the data to be parsed for the header
@param {String} name The name of the header that is going to be parsed
@return {String} The parsed value for the header | [
"Parses",
"the",
"value",
"for",
"header",
"data",
"in",
"response"
] | 3fb5a16a39b740607f4898f1d75d115c4ecfa16d | https://github.com/oscarr-reyes/node-diet-cross-origin/blob/3fb5a16a39b740607f4898f1d75d115c4ecfa16d/lib/helper.js#L65-L90 |
39,891 | myelements/myelements.jquery | lib/elements-event-handler.js | ElementsEventHandler | function ElementsEventHandler(socket) {
var _this = this;
//Call EventEmmiter _contructor_
events.EventEmitter.call(this);
this.socket = socket;
// On every message event received by socket we get
// an message event object like {event:, data:}
// we emit a local event through an EventEmitter interface... | javascript | function ElementsEventHandler(socket) {
var _this = this;
//Call EventEmmiter _contructor_
events.EventEmitter.call(this);
this.socket = socket;
// On every message event received by socket we get
// an message event object like {event:, data:}
// we emit a local event through an EventEmitter interface... | [
"function",
"ElementsEventHandler",
"(",
"socket",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"//Call EventEmmiter _contructor_",
"events",
".",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"socket",
"=",
"socket",
";",
"// On every message ... | Creates an event emitter and forwards every event triggered to client
@param {io.Client} socket A socket.io client instance on which to send messages. | [
"Creates",
"an",
"event",
"emitter",
"and",
"forwards",
"every",
"event",
"triggered",
"to",
"client"
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/elements-event-handler.js#L15-L43 |
39,892 | lethexa/lethexa-geo | lethexa-geo.js | function (m, u) {
return [
m[0][0] * u[0] + m[0][1] * u[1] + m[0][2] * u[2],
m[1][0] * u[0] + m[1][1] * u[1] + m[1][2] * u[2],
m[2][0] * u[0] + m[2][1] * u[1] + m[2][2] * u[2]
];
} | javascript | function (m, u) {
return [
m[0][0] * u[0] + m[0][1] * u[1] + m[0][2] * u[2],
m[1][0] * u[0] + m[1][1] * u[1] + m[1][2] * u[2],
m[2][0] * u[0] + m[2][1] * u[1] + m[2][2] * u[2]
];
} | [
"function",
"(",
"m",
",",
"u",
")",
"{",
"return",
"[",
"m",
"[",
"0",
"]",
"[",
"0",
"]",
"*",
"u",
"[",
"0",
"]",
"+",
"m",
"[",
"0",
"]",
"[",
"1",
"]",
"*",
"u",
"[",
"1",
"]",
"+",
"m",
"[",
"0",
"]",
"[",
"2",
"]",
"*",
"u"... | Multiplies with a matrix with a vector.
@method mulMatrixVector
@param m {Matrix} A matrix
@param u {Vector} A vector
@return The resulting vector | [
"Multiplies",
"with",
"a",
"matrix",
"with",
"a",
"vector",
"."
] | e3b7628d6243aee13e5de8b0cab6dea7aa5937a1 | https://github.com/lethexa/lethexa-geo/blob/e3b7628d6243aee13e5de8b0cab6dea7aa5937a1/lethexa-geo.js#L95-L101 | |
39,893 | lethexa/lethexa-geo | lethexa-geo.js | function (px, py, radius) {
var cx = 0;
var cy = 0;
var dx = cx - px;
var dy = cy - py;
var dd = Math.sqrt(dx * dx + dy * dy);
var a = Math.asin(radius / dd);
var b = Math.atan2(dy, dx);
var t1 = b - a;
var t2 = b + a;
return {
... | javascript | function (px, py, radius) {
var cx = 0;
var cy = 0;
var dx = cx - px;
var dy = cy - py;
var dd = Math.sqrt(dx * dx + dy * dy);
var a = Math.asin(radius / dd);
var b = Math.atan2(dy, dx);
var t1 = b - a;
var t2 = b + a;
return {
... | [
"function",
"(",
"px",
",",
"py",
",",
"radius",
")",
"{",
"var",
"cx",
"=",
"0",
";",
"var",
"cy",
"=",
"0",
";",
"var",
"dx",
"=",
"cx",
"-",
"px",
";",
"var",
"dy",
"=",
"cy",
"-",
"py",
";",
"var",
"dd",
"=",
"Math",
".",
"sqrt",
"(",... | Calculates the tangent from a point to a circle. | [
"Calculates",
"the",
"tangent",
"from",
"a",
"point",
"to",
"a",
"circle",
"."
] | e3b7628d6243aee13e5de8b0cab6dea7aa5937a1 | https://github.com/lethexa/lethexa-geo/blob/e3b7628d6243aee13e5de8b0cab6dea7aa5937a1/lethexa-geo.js#L105-L121 | |
39,894 | Happy0/ssb-embedded-chat | index.js | getChatboxElement | function getChatboxElement() {
var content = h('div', {
});
var keyPressHandler = (e) => {
if (e.charCode === 13) {
var messageText = e.srcElement.value;
if (messageText.length > 0) {
e.srcElement.value = "";
sendMessage(messageText);
}
}
}
... | javascript | function getChatboxElement() {
var content = h('div', {
});
var keyPressHandler = (e) => {
if (e.charCode === 13) {
var messageText = e.srcElement.value;
if (messageText.length > 0) {
e.srcElement.value = "";
sendMessage(messageText);
}
}
}
... | [
"function",
"getChatboxElement",
"(",
")",
"{",
"var",
"content",
"=",
"h",
"(",
"'div'",
",",
"{",
"}",
")",
";",
"var",
"keyPressHandler",
"=",
"(",
"e",
")",
"=>",
"{",
"if",
"(",
"e",
".",
"charCode",
"===",
"13",
")",
"{",
"var",
"messageText"... | Return the scroller HTML DOM element that the consuming code
can attach to the DOM somewhere. | [
"Return",
"the",
"scroller",
"HTML",
"DOM",
"element",
"that",
"the",
"consuming",
"code",
"can",
"attach",
"to",
"the",
"DOM",
"somewhere",
"."
] | 1504df2b132c7667dac61167168185f8c3fa1246 | https://github.com/Happy0/ssb-embedded-chat/blob/1504df2b132c7667dac61167168185f8c3fa1246/index.js#L111-L157 |
39,895 | preceptorjs/taxi | lib/driver.js | setupDebug | function setupDebug (driver, options) {
var indentation = 0;
function stringFill (filler, length) {
var buffer = new Buffer(length);
buffer.fill(filler);
return buffer.toString();
}
function getIndentation (add) {
return stringFill(' ', (indentation + add) * 2);
}
if (options.debug) {
... | javascript | function setupDebug (driver, options) {
var indentation = 0;
function stringFill (filler, length) {
var buffer = new Buffer(length);
buffer.fill(filler);
return buffer.toString();
}
function getIndentation (add) {
return stringFill(' ', (indentation + add) * 2);
}
if (options.debug) {
... | [
"function",
"setupDebug",
"(",
"driver",
",",
"options",
")",
"{",
"var",
"indentation",
"=",
"0",
";",
"function",
"stringFill",
"(",
"filler",
",",
"length",
")",
"{",
"var",
"buffer",
"=",
"new",
"Buffer",
"(",
"length",
")",
";",
"buffer",
".",
"fi... | Setup debug output
@param {Driver} driver
@param {object} options | [
"Setup",
"debug",
"output"
] | 96ab5a5c5fa9dc50f325ba4de52dd90009073ca3 | https://github.com/preceptorjs/taxi/blob/96ab5a5c5fa9dc50f325ba4de52dd90009073ca3/lib/driver.js#L737-L778 |
39,896 | kevoree/kevoree-js | libraries/node/javascript/lib/AdaptationEngine.js | AdaptationEngine | function AdaptationEngine(node) {
this.node = node;
this.modelObjMapper = new ModelObjectMapper();
const factory = new kevoree.factory.DefaultKevoreeFactory();
this.compare = factory.createModelCompare();
this.alreadyProcessedTraces = {};
this.targetModel = null;
} | javascript | function AdaptationEngine(node) {
this.node = node;
this.modelObjMapper = new ModelObjectMapper();
const factory = new kevoree.factory.DefaultKevoreeFactory();
this.compare = factory.createModelCompare();
this.alreadyProcessedTraces = {};
this.targetModel = null;
} | [
"function",
"AdaptationEngine",
"(",
"node",
")",
"{",
"this",
".",
"node",
"=",
"node",
";",
"this",
".",
"modelObjMapper",
"=",
"new",
"ModelObjectMapper",
"(",
")",
";",
"const",
"factory",
"=",
"new",
"kevoree",
".",
"factory",
".",
"DefaultKevoreeFactor... | AdaptationEngine knows each AdaptationPrimitive command available
for JavascriptNode.
Plus, it handles model - object mapping
@type {AdaptationEngine} | [
"AdaptationEngine",
"knows",
"each",
"AdaptationPrimitive",
"command",
"available",
"for",
"JavascriptNode",
".",
"Plus",
"it",
"handles",
"model",
"-",
"object",
"mapping"
] | 7eb62201a3bdf50ab0a6eb7f85424eecb44dbfcd | https://github.com/kevoree/kevoree-js/blob/7eb62201a3bdf50ab0a6eb7f85424eecb44dbfcd/libraries/node/javascript/lib/AdaptationEngine.js#L58-L65 |
39,897 | codius-deprecated/codius-engine | apis/secrets/index.js | SecretGenerator | function SecretGenerator(manifest, instance_id, secrets) {
ApiModule.call(this);
var self = this;
self._manifest = manifest;
self._secrets = secrets;
self._instance_id = instance_id;
} | javascript | function SecretGenerator(manifest, instance_id, secrets) {
ApiModule.call(this);
var self = this;
self._manifest = manifest;
self._secrets = secrets;
self._instance_id = instance_id;
} | [
"function",
"SecretGenerator",
"(",
"manifest",
",",
"instance_id",
",",
"secrets",
")",
"{",
"ApiModule",
".",
"call",
"(",
"this",
")",
";",
"var",
"self",
"=",
"this",
";",
"self",
".",
"_manifest",
"=",
"manifest",
";",
"self",
".",
"_secrets",
"=",
... | Class used to deterministically generate unique contract secrets | [
"Class",
"used",
"to",
"deterministically",
"generate",
"unique",
"contract",
"secrets"
] | 48aaea3d1a0dd2cf755a1905ff040e1667e8d131 | https://github.com/codius-deprecated/codius-engine/blob/48aaea3d1a0dd2cf755a1905ff040e1667e8d131/apis/secrets/index.js#L35-L43 |
39,898 | berkeleybop/bbop-graph-noctua | lib/edit.js | _get_annotations_by_filter | function _get_annotations_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._annotations, function(ann){
var res = filter(ann);
if( res && res === true ){
ret.push(ann);
}
});
return ret;
} | javascript | function _get_annotations_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._annotations, function(ann){
var res = filter(ann);
if( res && res === true ){
ret.push(ann);
}
});
return ret;
} | [
"function",
"_get_annotations_by_filter",
"(",
"filter",
")",
"{",
"var",
"anchor",
"=",
"this",
";",
"var",
"ret",
"=",
"[",
"]",
";",
"each",
"(",
"anchor",
".",
"_annotations",
",",
"function",
"(",
"ann",
")",
"{",
"var",
"res",
"=",
"filter",
"(",... | Get a sublist of annotation using the filter function. The filter
function take a single annotation as an argument, and adds to the
return list if it evaluates to true.
@name get_annotations_by_filter
@function
@param {Function} filter - function described above
@returns {Array} list of passing annotations | [
"Get",
"a",
"sublist",
"of",
"annotation",
"using",
"the",
"filter",
"function",
".",
"The",
"filter",
"function",
"take",
"a",
"single",
"annotation",
"as",
"an",
"argument",
"and",
"adds",
"to",
"the",
"return",
"list",
"if",
"it",
"evaluates",
"to",
"tr... | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L266-L277 |
39,899 | berkeleybop/bbop-graph-noctua | lib/edit.js | _get_annotations_by_key | function _get_annotations_by_key(key){
var anchor = this;
var ret = [];
each(anchor._annotations, function(ann){
if( ann.key() === key ){
ret.push(ann);
}
});
return ret;
} | javascript | function _get_annotations_by_key(key){
var anchor = this;
var ret = [];
each(anchor._annotations, function(ann){
if( ann.key() === key ){
ret.push(ann);
}
});
return ret;
} | [
"function",
"_get_annotations_by_key",
"(",
"key",
")",
"{",
"var",
"anchor",
"=",
"this",
";",
"var",
"ret",
"=",
"[",
"]",
";",
"each",
"(",
"anchor",
".",
"_annotations",
",",
"function",
"(",
"ann",
")",
"{",
"if",
"(",
"ann",
".",
"key",
"(",
... | Get sublist of annotations with a certain key.
@name get_annotations_by_key
@function
@param {String} key - key to look for.
@returns {Array} list of list of annotations with that key | [
"Get",
"sublist",
"of",
"annotations",
"with",
"a",
"certain",
"key",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L287-L298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.