_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q43800 | requestHypemKey | train | function requestHypemKey(hypemId, callback) {
var options = {
method: "GET",
url: HYPEM_TRACK_URL + hypemId,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
if (!error && re... | javascript | {
"resource": ""
} |
q43801 | requestMp3Url | train | function requestMp3Url(hypemId, hypemKey, callback) {
var options = {
method: "GET",
url: HYPEM_SERVE_URL + hypemId + "/" + hypemKey,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
... | javascript | {
"resource": ""
} |
q43802 | getNormalizedSoundcloudUrl | train | function getNormalizedSoundcloudUrl(soundcloudUrl) {
var parsedUrl = url.parse(soundcloudUrl);
var protocol = parsedUrl.protocol;
var host = parsedUrl.host;
| javascript | {
"resource": ""
} |
q43803 | train | function(options) {
this.DelOptions = $.extend({}, defaults, this.DelOptions, options);
this.dName = this.DelOptions.dName || this._name;
this.selector = this.selector || '.' | javascript | {
"resource": ""
} | |
q43804 | train | function(el) {
return (el instanceof $ ? el : $(el)).find(this.makeSelector.apply(t | javascript | {
"resource": ""
} | |
q43805 | parse | train | function parse (code) {
Object.keys(syntax).forEach((s) => {
code = code.replace(syntax[s], (_, m) => {
// ensure if the regex only matches part of the string that we keep the leftover
let leftOver = _.replace(m, '')
// encode the string and class
let parsed = `{#${s}#${encode(m)}#}`
... | javascript | {
"resource": ""
} |
q43806 | encode | train | function encode (str) {
return str.split('').map((s) => {
if (s.charCodeAt(0) > 127) return s
return | javascript | {
"resource": ""
} |
q43807 | decode | train | function decode (str) {
return str.trim().split(' ').map((s) => {
if (s.charCodeAt(0) - 0x2800 > 127) return s
| javascript | {
"resource": ""
} |
q43808 | runBrowsersBail | train | function runBrowsersBail(location, remote, platforms, options) {
var throttle = options.throttle || function (fn) { return fn(); };
var results = [];
results.passedBrowsers = [];
results.failedBrowsers = [];
return new Promise(function (resolve) {
function next(i) {
if (i >= platforms.length) {
... | javascript | {
"resource": ""
} |
q43809 | train | function() {
var bear = this;
// don't bind until we're ready
var srv = bear.ready.then( function() {
var dfd = _.Deferred();
// only make once
if ( !bear.githInstance ) {
bear.githInstance = bear.gith({
repo: bear.settings.repo,
}).on( | javascript | {
"resource": ""
} | |
q43810 | train | function( payload ) {
var bear = this;
var dfd = _.Deferred();
var action = dfd.promise();
// ok to launch live?
if ( payload.branch === bear.settings.liveBranch ) {
// can we just upload master without worrying about tags?
if ( !bear.settings.deployOnTag ) {
action = action.th... | javascript | {
"resource": ""
} | |
q43811 | train | function() {
return dexec( 'cd ' + this.settings.git + '; npm install' ).done(function( stdout, | javascript | {
"resource": ""
} | |
q43812 | textStream | train | function textStream() {
var start = randomInt(0, config.size - bufferSize)
return | javascript | {
"resource": ""
} |
q43813 | SocketioHandler | train | function SocketioHandler(io, options) {
/**
* Emit 'data' to all sockets for the provided User or array of Users.
*
* @param {*} channelName
* @param {*} users
* @param {*} data
*/
function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users)... | javascript | {
"resource": ""
} |
q43814 | emitToUsers | train | function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users) ? users : [users];
usersArray.map(function (user) {
Object.keys(io.sockets.sockets).filter(function (key) {
| javascript | {
"resource": ""
} |
q43815 | emitToEveryone | train | function emitToEveryone(channelName, data) {
Object.keys(io.sockets.sockets).filter(function (key) {
| javascript | {
"resource": ""
} |
q43816 | updatePos | train | function updatePos( pos, prop, val ) {
floatSpace.setStyle( prop, pixelate( val ) );
| javascript | {
"resource": ""
} |
q43817 | changeMode | train | function changeMode( newMode ) {
var editorPos = editable.getDocumentPosition();
switch ( newMode ) {
case 'top':
updatePos( 'absolute', 'top', editorPos.y - spaceHeight - dockedOffsetY );
break;
case 'pin':
updatePos( 'fixed', 'top', pinnedOffsetY );
| javascript | {
"resource": ""
} |
q43818 | train | function(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : (e.returnValue = false);
var eTarget = e.target || e.srcElement;
// find root element of slide
var clickedListItem = closest(eTarget, function(el) {
//console.log(el.getAttribute('ui-gallery-item'));
return el... | javascript | {
"resource": ""
} | |
q43819 | handleUncaughtExceptions | train | function handleUncaughtExceptions(error) {
if (!error || !error.stack) {
console.log('Uncaught exception:', error);
process.exit();
}
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
if (match) {
var cache = {};
var position = mapSourcePosition(cache, {
source: match[1]... | javascript | {
"resource": ""
} |
q43820 | broadcastMonitors | train | function broadcastMonitors(records, moduleId, msg) {
msg = protocol.composeRequest(null, moduleId, msg);
if (records instanceof Array) {
for (let i = 0, l = records.length; i < l; i++) {
| javascript | {
"resource": ""
} |
q43821 | getChar | train | function getChar (bits) {
var index = parseInt(bits,2);
if (isNaN(index) || index < 0 || index > 63) throw | javascript | {
"resource": ""
} |
q43822 | indexOfBits | train | function indexOfBits (char) {
var index = ALPHABET.indexOf(char);
if (index | javascript | {
"resource": ""
} |
q43823 | encode | train | function encode (bits) {
if (!bitString.isValid(bits)) throw new Error('baseURL#encode: bits not valid bitstring');
if (bits.length % 6 !== 0) throw new Error('baseURL#encode: bits must be a multiple of 6');
var result = | javascript | {
"resource": ""
} |
q43824 | decode | train | function decode (str) {
if (!isValid(str)) throw new Error('baseURL#decode: str not valid baseURL string');
var bits = '';
// Decode
for (var i = | javascript | {
"resource": ""
} |
q43825 | simpleComponent | train | function simpleComponent(elementName, elementClass, elementClassToExtend) {
elementClass = elementClass || {}
elementClassToExtend = elementClassToExtend || HTMLElement
elementClass.prototype = Object.create(elementClassToExtend.prototype)
assign(elementClass.prototype, elementClass)
elementClass._... | javascript | {
"resource": ""
} |
q43826 | fill | train | function fill(toElement, templateElement) {
var templateContentClone = templateElement.content.cloneNode(true)
var slot
var i
if (toElement.childNodes.length) {
slot = templateContentClone.querySelector('slot')
if | javascript | {
"resource": ""
} |
q43827 | makeRequire | train | function makeRequire(m, self) {
function _require(_path) {
return m.require(_path);
}
_require.resolve = function(request) {
return _module._resolveFilename(request, self);
};
| javascript | {
"resource": ""
} |
q43828 | _connectionFailureHandler | train | function _connectionFailureHandler(self) {
return function() {
if (this._connectionFailHandled) return;
this._connectionFailHandled = true;
// Destroy the connection
this.destroy();
// Count down the number of reconnects
self.retriesLeft = self.retriesLeft - 1;
... | javascript | {
"resource": ""
} |
q43829 | _connectHandler | train | function _connectHandler(self) {
return function() {
// Assign
var connection = this;
// Pool destroyed stop the connection
if (self.state === DESTROYED || self.state === DESTROYING) {
return connection.destroy();
}
// Clear out all handlers
hand... | javascript | {
"resource": ""
} |
q43830 | authenticateStragglers | train | function authenticateStragglers(self, connection, callback) {
// Get any non authenticated connections
var connections = self.nonAuthenticatedConnections.slice(0);
var nonAuthenticatedConnections = self.nonAuthenticatedConnections;
self.nonAuthenticatedConnections = [];
// Establish if th... | javascript | {
"resource": ""
} |
q43831 | authenticateLiveConnections | train | function authenticateLiveConnections(self, args, cb) {
// Get the current viable connections
var connections = self.allConnections();
// Allow nothing else to use the connections while we authenticate them
self.availableConnections = [];
self.inUseConnections = [];
self.connectingConnections = [... | javascript | {
"resource": ""
} |
q43832 | waitForLogout | train | function waitForLogout(self, cb) {
if (!self.loggingout) return cb();
setTimeout(function() {
| javascript | {
"resource": ""
} |
q43833 | train | function(_connection) {
return function() {
// Destroyed state return
if (self.state === DESTROYED || self.state === DESTROYING) {
// Remove the connection from the list
removeConnection(self, _connection);
return _connection.destroy();
}
// Destroy all event emitter... | javascript | {
"resource": ""
} | |
q43834 | Miscue | train | function Miscue(code, data) {
if (!(this instanceof Miscue))
return | javascript | {
"resource": ""
} |
q43835 | createLint | train | function createLint(inPath, opts = {}) {
if (!inPath) {
throw new Error('Input path argument is required');
} | javascript | {
"resource": ""
} |
q43836 | getStartEndRowsFromBoardSize | train | function getStartEndRowsFromBoardSize(boardSize) {
const endRow = boardSize.y - 1;
return {
white: getStartEndRow(endRow, | javascript | {
"resource": ""
} |
q43837 | getJumpPosition | train | function getJumpPosition(from, toJump, board) {
const jumpXY = getJumpXY(from, toJump);
if (!hasPosition(board, jumpXY))
return;
const jumpPosition = getPositionFromBoard(board, | javascript | {
"resource": ""
} |
q43838 | isValid | train | function isValid (path, entry) {
var isValid = valid(path)
if (isValid) {
log.verbose('extracted file from tarball', path)
extractCount++
} else {
| javascript | {
"resource": ""
} |
q43839 | get | train | function get(path) {
var conf = this;
if (typeof path !== 'string') {
throw new Error('path should be a string!');
} else if (path.length === 0) {
throw new Error('path cannot be empty!');
}
var result = baseGet(conf, getPathArray(path));
if (result === undefined) {
| javascript | {
"resource": ""
} |
q43840 | addProperty | train | function addProperty(sourceData, propertiesGroups, filePath) {
var group = propertiesUtils.getGroup(sourceData[2], propertiesGroups),
propertyName,
data,
propertyDefinitionWithoutObjectName;
if (!group) {
grunt.log.error('Object ' + sourceData[2] + ' wit... | javascript | {
"resource": ""
} |
q43841 | addJSONProperties | train | function addJSONProperties(jsonData, propertiesGroups, filePath, currentNamesPath) {
var i,
group,
propertyDefinition,
propertyDefinitionWithoutObjectName,
propertyName,
data;
if (currentNamesPath === undefined) {
currentNamesPath... | javascript | {
"resource": ""
} |
q43842 | onChunk | train | function onChunk(count) {
// If chunk read has no bytes than there is nothing left, so end a
// collection.
if (count === 0) return next(end)
// Move a offset `position` with `count` towards the end unless
// position was a `null` in which case we just keep it (`null` means
// from ... | javascript | {
"resource": ""
} |
q43843 | onDrain | train | function onDrain(value) {
state = value
// If value is marked as `reduced` no further reads should take place,
// as consumer has finished consumption.
if (isReduced(value)) return next(end)
// If current `position` has reached or passed `finish` mark end a
// collection.
else ... | javascript | {
"resource": ""
} |
q43844 | train | function(objects) {
if (!_.isArray(objects)) {
objects = [objects];
}
var change = new Parse.Op.Relation(objects, []);
| javascript | {
"resource": ""
} | |
q43845 | train | function() {
var targetClass;
var query;
if (!this.targetClassName) {
targetClass = Parse.Object._getSubclass(this.parent.className);
query = new Parse.Query(targetClass);
query._extraOptions.redirectClassNameForKey = this.key; | javascript | {
"resource": ""
} | |
q43846 | train | function(s_line, s_close_delim, z_merge_delim) {
// open block
add(
s_line || '',
z_merge_delim,
true
);
// set close delim
s_close = ('string' === typeof | javascript | {
"resource": ""
} | |
q43847 | trimHtml | train | function trimHtml(html) {
function trimSpaces(all, s1, s2) {
// WebKit meant to preserve multiple spaces but instead inserted around all inline tags,
// including the spans with inline styles created on paste
if (!s1 && !s2) {
return ' ';
}
return '\u00a0'... | javascript | {
"resource": ""
} |
q43848 | getDataTransferItems | train | function getDataTransferItems(dataTransfer) {
var items = {};
if (dataTransfer) {
// Use old WebKit/IE API
if (dataTransfer.getData) {
var legacyText = dataTransfer.getData('Text');
if (legacyText && legacyText.length > 0) {
if (legacyText.index... | javascript | {
"resource": ""
} |
q43849 | train | function (originalIt) {
return function it(desc, cb) {
if (cb.length === 0) {
originalIt(desc, cb);
| javascript | {
"resource": ""
} | |
q43850 | mount | train | function mount(mountLocation, tagname, props) {
// return riot.mount(mountLocation, tagname, props)[0];
const id = makeUID(`riotjs_mount_${tagname}`);
const fauxTag = `<${tagname} data-elmoed-editor="${tagname}" id="${id}">
</${tagname}>`;
// Loop through all sub-mounted editors that might alre... | javascript | {
"resource": ""
} |
q43851 | train | function( editor, name, isIndent ) {
this.name = name;
this.editor = editor;
/**
* An object of jobs handled by the command. Each job consists
* of two functions: `refresh` and `exec` as well as the execution priority.
*
* * The `refresh` function determines whether a job is doable for... | javascript | {
"resource": ""
} | |
q43852 | train | function( editor, commands ) {
editor.on( 'pluginsLoaded', function() {
for ( var name in commands ) {
( function( editor, command ) {
var relatedGlobal = editor.getCommand( command.relatedGlobal );
for ( var priority in command.jobs ) {
// Observe generic exec event and execute c... | javascript | {
"resource": ""
} | |
q43853 | train | function( editor, priority ) {
var job = this.jobs[ priority ];
if ( job.state != | javascript | {
"resource": ""
} | |
q43854 | setupGenericListeners | train | function setupGenericListeners( editor, command ) {
var selection, bookmarks;
// Set the command state according to content-specific
// command states.
command.on( 'refresh', function( evt ) {
// If no state comes with event data, disable command.
var states = [ TRISTATE_DISABLED ];
for ( va... | javascript | {
"resource": ""
} |
q43855 | train | function (event, fn, context) {
this._events = this._events || | javascript | {
"resource": ""
} | |
q43856 | train | function (obj, event, fn, context) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || | javascript | {
"resource": ""
} | |
q43857 | train | function (event, fn) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < l; i++) { | javascript | {
"resource": ""
} | |
q43858 | train | function (obj, event, fn) {
var listeningTo = this._listeningTo;
if (!listeningTo) {
return;
}
var remove = !event && !fn;
if (!fn && typeof event === 'object') { | javascript | {
"resource": ""
} | |
q43859 | train | function (event/*, args... */) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < | javascript | {
"resource": ""
} | |
q43860 | Property | train | function Property (initValue) {
if (arguments.length) {
this.set(initValue);
}
else {
| javascript | {
"resource": ""
} |
q43861 | train | function (newValue) {
var oldValue = this._value;
if (oldValue !== newValue) {
this._value = newValue;
| javascript | {
"resource": ""
} | |
q43862 | deleteUser | train | function deleteUser(id, callback) {
orionAccount.findByUsername(id, function(err, user) {
if(err) {
callback(err);
}
const userPath = path.join(this.options.workspaceDir, id.substring(0,2));
fs.access(userPath, (err) => {
if(err) {
callback(err);
}
//TODO should a delete failure preve... | javascript | {
"resource": ""
} |
q43863 | isDirective | train | function isDirective(node) {
return node.type === "ExpressionStatement" | javascript | {
"resource": ""
} |
q43864 | TaskList | train | function TaskList(options) {
var parent = lib.node(options.parent);
if (!parent) { throw messages['no parent']; }
if (!options.serviceRegistry) {throw messages["no service registry"]; }
this._parent = parent;
this._registry = options.serviceRegistry;
this._description = options.description;
this._tasks | javascript | {
"resource": ""
} |
q43865 | train | function() {
/** All events from last tick */
var pendingEvents = this._annotationChangedContext.events;
var pendingLocations = this._annotationChangedContext.locations;
var pendingModels = this._annotationChangedContext.textModels;
/** All unique events from last tick */
var handlingEvents = [];
var hand... | javascript | {
"resource": ""
} | |
q43866 | train | function(serviceRegistry, setup) {
this._setup = setup;
this._projectClient = serviceRegistry.getService("orion.project.client");
serviceRegistry.registerService("orion.edit.hover", this, {
name: 'Hover Evaluation',
| javascript | {
"resource": ""
} | |
q43867 | train | function(editorContext, ctxt) {
var promise = new Deferred();
var launchConf = this._setup.runBar.getSelectedLaunchConfiguration();
if (launchConf) {
this._projectClient.getProjectDeployService(launchConf.ServiceId, launchConf.Type).then(function(service){
if (service && service.computeHoverInfo) {
se... | javascript | {
"resource": ""
} | |
q43868 | StringField | train | function StringField(type, options) {
Field.call(this, type, options);
this.arg = new Argument();
this.element = util.createElement(this.document, 'input');
this.element.type = 'text';
this.element.classList.add('gcli-field');
this.onInputChange | javascript | {
"resource": ""
} |
q43869 | BooleanField | train | function BooleanField(type, options) {
Field.call(this, type, options);
this.name = options.name;
this.named = options.named;
this.element = util.createElement(this.document, 'input');
this.element.type = 'checkbox';
this.element.id = 'gcliForm' + this.name;
this.onInputChange = this.onInputChange.bind... | javascript | {
"resource": ""
} |
q43870 | DelegateField | train | function DelegateField(type, options) {
Field.call(this, type, options);
this.options = options;
this.requisition.onAssignmentChange.add(this.update, | javascript | {
"resource": ""
} |
q43871 | train | function() {
this._createSettingsCommand();
this._createGotoLineCommnand();
this._createFindCommnand();
this._createBlameCommand();
this._createDiffCommand();
this._createShowTooltipCommand();
this._createUndoStackCommands();
this._createClipboardCommands();
this._createDelimiterCommands();
... | javascript | {
"resource": ""
} | |
q43872 | ASTManager | train | function ASTManager(serviceRegistry, jsProject) {
this.cache = new LRU(10); | javascript | {
"resource": ""
} |
q43873 | CommandRegistry | train | function CommandRegistry(options) {
this._commandList = {};
this._contributionsByScopeId = {};
this._activeBindings = | javascript | {
"resource": ""
} |
q43874 | train | function(url) {
for (var id in this._urlBindings) {
if (this._urlBindings[id] && this._urlBindings[id].urlBinding && this._urlBindings[id].command) {
var match = this._urlBindings[id].urlBinding.match(url);
if (match) {
var urlBinding = this._urlBindings[id];
var command = urlBinding.comman... | javascript | {
"resource": ""
} | |
q43875 | train | function(commandId, item, handler, parameters, userData, parent) {
var self = this;
if (item) {
var command = this._commandList[commandId];
var enabled = command && (command.visibleWhen ? command.visibleWhen(item) : true);
if (enabled && command.callback) {
var commandInvocation = new Commands.Co... | javascript | {
"resource": ""
} | |
q43876 | train | function(node, fillFunction, onClose, name) {
if (this._parameterCollector) {
this._parameterCollector.close();
| javascript | {
"resource": ""
} | |
q43877 | train | function(node, message, yesString, noString, modal, onConfirm) {
this._popupDialog(modal,"CONFIRM", node, message, | javascript | {
"resource": ""
} | |
q43878 | train | function(node, message, yesString, onConfirm) {
this._popupDialog(false, | javascript | {
"resource": ""
} | |
q43879 | train | function(node, message, yesString, noString, defaultInput, modal, onConfirm, positionString) {
var position = null;
if(positionString === "below"){position = ["below", "right", "above", "left"];} | javascript | {
"resource": ""
} | |
q43880 | train | function(keyAssist) {
var scopes = {};
var binding;
// see commands.js _processKey
function execute(activeBinding) {
return function() {
Commands.executeBinding(activeBinding);
};
}
var bindings = [];
for (var aBinding in this._activeBindings) {
binding = this._activeBindings[a... | javascript | {
"resource": ""
} | |
q43881 | train | function(command) {
this._commandList[command.id] = command;
// Resolve any pending key/url bindings against this command
var pending = this._pendingBindings[command.id];
if (pending) {
var _self = this;
| javascript | {
"resource": ""
} | |
q43882 | train | function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId, extraClasses) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parent... | javascript | {
"resource": ""
} | |
q43883 | train | function(scopeId, selectionService) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
| javascript | {
"resource": ""
} | |
q43884 | train | function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parentPath) {
parentTable = this._createEntryFor... | javascript | {
"resource": ""
} | |
q43885 | train | function(commandId, type, binding, bindingOnly) {
this._pendingBindings[commandId] = this._pendingBindings[commandId] || [];
this._pendingBindings[commandId].push({
| javascript | {
"resource": ""
} | |
q43886 | train | function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) {
if (typeof(scopeId) !== "string") { //$NON-NLS-0$
throw "a scope id for rendering must be specified"; //$NON-NLS-0$
}
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
var contri... | javascript | {
"resource": ""
} | |
q43887 | train | function(parent) {
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
while (parent.hasChildNodes()) {
var node = parent.firstChild;
if (node.commandTooltip) {
node.commandTooltip.destroy();
| javascript | {
"resource": ""
} | |
q43888 | train | function (url) {
//ensure this is only the hash portion
var params = PageUtil.matchResourceParameters(url);
if (typeof params[this.token] !== "undefined") { | javascript | {
"resource": ""
} | |
q43889 | CommandParameter | train | function CommandParameter (name, type, label, value, lines, eventListeners, validator) {
this.name = name;
this.type = type;
this.label = label;
this.value = value;
this.lines = lines || 1;
this.validator = validator; | javascript | {
"resource": ""
} |
q43890 | ParametersDescription | train | function ParametersDescription (parameters, options, getParameters) {
this._storeParameters(parameters);
this._hasOptionalParameters = options && options.hasOptionalParameters;
this._options = options; // saved for making a copy
this.optionsRequested = false;
this.getParameters = getParameters;
this.client... | javascript | {
"resource": ""
} |
q43891 | train | function(func) {
for (var key in this.parameterTable) {
if (this.parameterTable[key].type | javascript | {
"resource": ""
} | |
q43892 | train | function() {
var parameters = [];
this.forEach(function(parm) {
var newParm = new CommandParameter(parm.name, parm.type, parm.label, parm.value, parm.lines, parm.eventListeners, parm.validator);
parameters.push(newParm);
});
var copy = new ParametersDescription(parameters, this._options, | javascript | {
"resource": ""
} | |
q43893 | xhrJson | train | function xhrJson(method, url, options) {
if (options && typeof options.data !== 'undefined') {
options.data = JSON.stringify(options.data); | javascript | {
"resource": ""
} |
q43894 | flashNode | train | function flashNode(node, match) {
if (!node.__gcliHighlighting) {
node.__gcliHighlighting = true;
var original = node.style.background;
| javascript | {
"resource": ""
} |
q43895 | removeWorkspaceAccess | train | function removeWorkspaceAccess(userAccessRights, workspaceId) {
var newAccessRights = [];
if(Array.isArray(userAccessRights)) {
userAccessRights.forEach(function(accessRight) {
if(!new RegExp("/" + workspaceId + | javascript | {
"resource": ""
} |
q43896 | hasAccess | train | function hasAccess(access, res, err, next, uri){
if (err) {
api.writeError(404, res, err); | javascript | {
"resource": ""
} |
q43897 | wildCardMatch | train | function wildCardMatch(text, pattern){
var cards = pattern.split("*");
if (!pattern.startsWith("*") && !text.startsWith(cards[0])) { //$NON-NLS-1$
return false;
}
if (!pattern.endsWith("*") && !text.endsWith(cards[cards.length - 1])) { //$NON-NLS-1$
return | javascript | {
"resource": ""
} |
q43898 | getAuthorizationData | train | function getAuthorizationData(metadata, store){
var properties;
var workspaceIDs;
var isPropertyString;
if (typeof metadata.properties === "string") {
isPropertyString = true;
properties = JSON.parse(metadata.properties); // metadata.properties need to be parse when using MongoDB
workspaceIDs = metadata.works... | javascript | {
"resource": ""
} |
q43899 | train | function() {
if (this.capabilities && this.capabilities.textDocumentSync) {
var kind = this.capabilities.textDocumentSync;
if (this.capabilities.textDocumentSync.change) {
kind = this.capabilities.textDocumentSync.change;
}
switch (kind) {
case | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.