Function to remove link to waitch list

@returns {undefined}
345706
function(link, cb){
            var id = Math.abs(crc32.str(md5(link)));
            
            var options = {
                host: urlArr.hostname,
                port: urlArr.port,
                path: "/delete/"+id,
                method: 'DELETE',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                }
            };
                                    
            var deleteRequest = protocol.request(options, function(res){
                var result = "";
                
                if(res.statusCode === 200){
                    res.on('error', function(error){
                        if(typeof cb === "function")
                            cb(error);
                    });

                    res.on('data', function(chunk){
                        result += chunk;
                    });

                    res.on('end', function(chunk){
                        if(typeof cb === "function"){
                            var resultObj = JSON.parse(result);
                            var err = (resultObj.status === "error") ? resultObj["msg"] : null
                            cb(err, resultObj);
                        }    
                    });
                }
                else{
                    if(typeof cb === "function")
                        cb("Request return HTTP "+res.statusCode);
                }
            });
            
            deleteRequest.end();
        }
251786
function disconnect() {
        var deferred = new $.Deferred(),
            promise = deferred.promise();

        if (_socket && (_socket.readyState === WebSocket.OPEN)) {
            _socket.onclose = function () {
                // trigger disconnect event
                _onDisconnect();

                deferred.resolve();
            };

            promise = Async.withTimeout(promise, 5000);

            _socket.close();
        } else {
            if (_socket) {
                delete _socket.onmessage;
                delete _socket.onopen;
                delete _socket.onclose;
                delete _socket.onerror;

                _socket = undefined;
            }

            deferred.resolve();
        }

        return promise;
    }
724695
function (banner, wait) {
      setTimeout (function() {
        if (banner && banner.parentNode) {
          banner.parentNode.removeChild(banner);
        }
      }, wait);
    }
1058423
function _removeIdle() {
    var removals = [];
    var now = Date.now();

    this._removeIdleScheduled = false;

    // Go through the available (idle) items, check if they have timed out
    var minCount = this._count - this._opts.min;
    var refreshIdle = this._opts.refreshIdle;
    for (
        var i = 0;
        i < this._availableObjects.length && (refreshIdle || (minCount > removals.length));
        ++i
    ) {
        var timeout = this._availableObjects[i].timeout;
        if (now >= timeout) {
            // Client timed out, so destroy it.
            this._log(
                'removeIdle() destroying obj - now:' + now + ' timeout:' + timeout,
                'verbose'
            );
            removals.push(this.destroy(this._availableObjects[i].obj));
            --i;
        }
    }

    // Replace the available items with the ones to keep.
    if (this._availableObjects.length > 0) {
        this._log('availableObjects.length=' + this._availableObjects.length, 'verbose');
        _scheduleRemoveIdle.call(this);
    }
    else {
        this._log('removeIdle() all objects removed', 'verbose');
    }

    // Return a promise for when all the destructions have completed.
    return Promise.all(removals);
}
100483
function removeCachedResult(removedLru) {
	var removedLruLen = removedLru.length,
		currentLru = removedLru[removedLruLen - 1],
		tmp,
		i;

	currentLru.cacheItem.delete(currentLru.arg);

	// walk down the tree removing dead branches (size 0) along the way
	for (i = removedLruLen - 2; i >= 0; i--) {
		currentLru = removedLru[i];
		tmp = currentLru.cacheItem.get(currentLru.arg);

		if (!tmp || !tmp.size) {
			currentLru.cacheItem.delete(currentLru.arg);
		} else {
			break;
		}
	}
}
977000
function(){
		var me = this,
			dispatchArguments = arguments,
			promises = []
		;

		this._promises = [];

		// A closure is needed for the callback id
		Object.keys( this._callbacks ).forEach( function( id ){

			// All the promises must be set in me._promises before trying to resolve
			// in order to make waitFor work ok
			me._promises[ id ] = me._Promise.resolve()
				.then( function(){
					return me._callbacks[ id ].apply( me, dispatchArguments );
				})
				.catch( function( err ){
					console.error( err.stack || err );
				})
			;

			promises.push( me._promises[ id ] );
		});

		//
		var dequeue = function(){
			me._dispatchQueue.shift();
			if( !me._dispatchQueue.length )
				me._currentDispatch = false;
		};

		return this._Promise.all( promises )
			.then( dequeue, dequeue )
		;
	}
1275455
function clear() {
  timeouts.forEach((callback, timeout) => {
    clearTimeout(timeout);

    // reject Promise or execute callback which returns Error
    callback();
  });

  const length = size();
  cache.clear();
  return length;
}
203096
function unlink(path, callback) {
        appshell.fs.unlink(path, function (err) {
            callback(_mapError(err));
        });
    }
702964
function removeById(list, id) {
  return _lodash2.default.filter(list, function (t) {
    return t.id !== id;
  });
}
1267123
function wait_loading(callback) {
		var undefined,
		    events = 0,
		    foreach_loading = true,
		    errors = [];
		
		function do_end() {
			callback( (errors.length === 0) ? undefined : 'Errors:\n * ' + errors.join(' * \n') );
		}
		
		foreach(_dirs_loading).do(function(e, id) {
			events++;
			e.on('end', function(err) {
				if(err) errors.push(err);
				events--;
				if( (!foreach_loading) && (events === 0) ) do_end();
			});
		});
		
		foreach_loading = false;
		if(events === 0) do_end();
	}
1282995
function() {

            var current = this.get('ports') || {};
            var currentItemsMap = {};

            util.toArray(current.items).forEach(function(item) {
                currentItemsMap[item.id] = true;
            });

            var previous = this.previous('ports') || {};
            var removed = {};

            util.toArray(previous.items).forEach(function(item) {
                if (!currentItemsMap[item.id]) {
                    removed[item.id] = true;
                }
            });

            var graph = this.graph;
            if (graph && !util.isEmpty(removed)) {

                var inboundLinks = graph.getConnectedLinks(this, { inbound: true });
                inboundLinks.forEach(function(link) {

                    if (removed[link.get('target').port]) link.remove();
                });

                var outboundLinks = graph.getConnectedLinks(this, { outbound: true });
                outboundLinks.forEach(function(link) {

                    if (removed[link.get('source').port]) link.remove();
                });
            }
        }
156672
function(urls, skipMissing) {
        var i = -1;
        var j;
        var handlers = [];
        var url;
        var resource;

        var urlsLength = urls.length;
        var resourcesLength = this._resources.length;
        var foundHandler;

        // All URLs
        while( ++i < urlsLength ) {
            url = urls[i];
            foundHandler = undefined;   // No handler yet

            j = -1;
            // All resources
            while( ++j < resourcesLength ) {
                resource = this._resources[j];

                if( ! resource.getPattern().matches(url) )
                    continue;

                // If this handler does not want to use cascading
                // we remove every handler that might have been executed
                // before it
                if( false === resource.getOption('cascading') )
                    handlers = [];

                handlers.push({ path: url, handler: resource });
                foundHandler = resource;
                break;
            }

            // One handler missing? Chain is broken, return an error if required
            if( _.isUndefined(foundHandler) && ! skipMissing )
                return null;
        }


        return handlers;
    }
850748
function(){
      if (this.deferredToken)
      {
        this.deferredToken.destroy();
        this.deferredToken = null;
      }

      this.attach = $undef;
      this.detach = $undef;

      var cursor = this;
      while (cursor = cursor.handler)
        if (cursor.destroy)
          cursor.destroy.call(cursor.context);

      this.handler = null;
      this.value = null;
    }
778776
function(filename, callback) {
        fs.unlink(filename, function(err){
            if (err) {
                console.error(err.stack);
                callback(err)
            } else {
                callback(false)
            }
        })
    }
1221320
function () {
    if (!self.connections.length) {
      self.removeListener('remove', remove);
      self.closing = false;
      return callback();
    }
  }
1322823
function removeItem(key, callback) {
	        var self = this;

	        // Cast the key to a string, as that's all we can set as a key.
	        if (typeof key !== 'string') {
	            globalObject.console.warn(key + ' used as a key, but it is not a string.');
	            key = String(key);
	        }

	        var promise = self.ready().then(function () {
	            var dbInfo = self._dbInfo;
	            localStorage.removeItem(dbInfo.keyPrefix + key);
	        });

	        executeCallback(promise, callback);
	        return promise;
	    }
928668
function forcelink(src, dest, options, callback) {
    if (!options || !options.cache) throw new Error('options.cache not defined!');
    if (!callback) throw new Error('callback not defined!');
    // uses relative path if linking to cache dir
    if (path.relative) {
        src = path.relative(options.cache, dest).slice(0, 2) !== '..' ? path.relative(path.dirname(dest), src) : src;
    }
    fs.lstat(dest, function(err, stat) {
        // Error.
        if (err && err.code !== 'ENOENT') {
            return callback(err);
        }

        // Path does not exist. Symlink.
        if (err && err.code === 'ENOENT') {
            if (env == 'development') console.error("[millstone] linking '" + dest + "' -> '"  + src + "'");
            return fs.symlink(src, dest, callback);
        }

        // Path exists and is not a symlink. Do nothing.
        if (!stat.isSymbolicLink()) {
            if (env == 'development') console.error("[millstone] skipping re-linking '" + src + "' because '"  + dest + " is already an existing file");
            return callback();
        }

        // Path exists and is a symlink. Check existing link path and update if necessary.
        // NOTE : broken symlinks will pass through this step
        fs.readlink(dest, function(err, old) {
            if (err) return callback(err);
            if (old === src) return callback();
            fs.unlink(dest, function(err) {
                if (err) return callback(err);
                if (env == 'development') console.error("[millstone] re-linking '" + dest + "' -> '"  + src + "'");
                fs.symlink(src, dest, callback);
            });
        });
    });
}