/*!
\return all old and completed scripts
164745
static function fetchScriptsToPurge( $asObject = true, $offset = false, $limit = false )
    {
        $conditions = array( 'last_report_timestamp' => array( '<', time() - self::STATUS_PURGE_TIMEOUT ),
                             'progress' => 100 );

        $limitation = null;
        if ( $offset !== false or $limit !== false )
        {
            $limitation = array( 'offset' => $offset, 'length' => $limit );
        }

        return eZPersistentObject::fetchObjectList( eZScheduledScript::definition(),
                                                    null, $conditions, null, $limitation, $asObject );
    }
1239024
function js($flush = true) {
        $js = $this->_js;
        if ($flush) $this->_js = [];
        $html = '';
        foreach ($js as $url => $inc) {
            $html .= '<script src="'.$url.'"></script>'.PHP_EOL;
        }
        if (!empty($this->_scripts)) {
            $scripts = $this->_scripts;
            if ($flush) $this->_scripts = [];
            $html .= '<script>'.PHP_EOL;
            foreach ($scripts as $script) {
                $html .= $script . PHP_EOL;
            }
            $html .= '</script>';
        }
        return $html;
    }
469014
def _complete_history(self, cmd, args, text):
        """"""
        if args:
            return
        return [ x for x in { 'clear', 'clearall' } \
                if x.startswith(text) ]
896969
static function fetchNotStartedScripts( $asObject = true, $offset = false, $limit = false )
    {
        $conditions = array( 'progress' => array( '<', 0 ) );

        $limitation = null;
        if ( $offset !== false or $limit !== false )
        {
            $limitation = array( 'offset' => $offset, 'length' => $limit );
        }

        return eZPersistentObject::fetchObjectList( eZScheduledScript::definition(),
                                                    null, $conditions, null, $limitation, $asObject );
    }
628218
public function getScriptFiles()
	{
		$return = array();
		//$return = $this->coreScripts;
		//print_r($this->coreScripts);
		if(!empty($this->coreScripts)) {
			foreach($this->coreScripts as $key=>$val) {
				if((is_string($key) && $key != 'jquery') && is_array($val)) {
				//if((is_string($key)) && is_array($val))
					if($val['baseUrl'] != null)
						$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$val['baseUrl'].'/'.$val['js'][0];
					else 
						$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$this->getCoreScriptUrl().'/'.$val['js'][0];
				}
			}
		}
		//echo '===========================================';
		
		//$return = $this->scriptFiles;
		//print_r($this->scriptFiles);
		if(!empty($this->scriptFiles)) {
			foreach($this->scriptFiles as $key=>$val) {
				if((is_string($key)) || is_array($val)) {
					if(!empty($val)) {
						foreach($val as $key=>$row)
							if($key == $row || $row==null)
								$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$key;
					}
				}
			}
		}
		return $return;
	}
132975
function getScriptElements($typeLazy) {
        var scripts;
        var src = $typeLazy.attr("src");
        if ("js" === getExtension(src).toLowerCase()) {
            return $typeLazy;
        } else {
            src = path.join(grunt.config.get('tmpdir'), src);
            if (fs.existsSync(src)) {
                scripts = jsdom.jsdom(fs.readFileSync(src).toString());
                return $(scripts).find("script");
            } else {
                return $();
            }
        }
    }
1224715
protected function listScripts($scripts)
    {
        if (!$scripts) {
            $this->out()->out('No custom scripts.');

            return;
        }

        $this->out()->out('<comment>Available Scripts</comment>')
            ->out('-----------------------------');

        foreach ($scripts as $name => $script) {
            $this->out(sprintf('<info>%s</info>', $name));

            foreach ($script as $cmd) {
                if (!is_array($cmd)) {
                    $cmd = ['cmd' => $cmd, 'in' => null];
                }

                $input = Arr::get($cmd, 'in');
                $cmd   = Arr::get($cmd, 'cmd');

                $this->out('    <comment>$</comment> ' . $cmd, false);

                if ($input !== null) {
                    $this->out(sprintf('  <option>(Input: %s)</option>', preg_replace('/\s+/', ' ', $input)), false);
                }

                $this->out();
            }

            $this->out();
        }
    }
634674
function archive() {
            vm.error = undefined;
            var promises = [];
            vm.todos.filter(function (todo) {
                return todo.completed;
            }).forEach(function (todo) {
                promises.push(_archive(todo));
            });

            $q.all(promises).then(function () {
                _fetch();
            }).catch(function () {
                vm.error = 'An error occurred when archiving completed todos';
            });
        }
1114282
public function findRollbackScripts()
    {
        $path = sprintf('%s/%s/rollback', $this->path, $this->release);

        return $this->getFiles($path);
    }
930680
public function getDeafultHandlers()
	{
		return [

			// return hash of input file

			'contenthash' => function ($file) {

				if ( ! isset($this->hasher))
				{
					$this->hasher = new Hasher;
				}

				return $this->hasher->file($file);
			},

			// return ext of input file

			'ext' => function ($file) {

				return $file->getClientOriginalExtension();
			}

		];
	}
916606
public function find_standard_scripts() {
        global $PAGE;

        $plugindir = $this->plugin_dir();
        $plugindirrel = 'question/type/' . $this->name();

        if (file_exists($plugindir . '/script.js')) {
            $PAGE->requires->js('/' . $plugindirrel . '/script.js');
        }
        if (file_exists($plugindir . '/script.php')) {
            $PAGE->requires->js('/' . $plugindirrel . '/script.php');
        }
    }
442791
@Override
	public List<String> getScripts() {
		final String sourceMethod = "getScripts"; //$NON-NLS-1$
		if (isTraceLogging) {
			log.entering(RequestedModuleNames.class.getName(), sourceMethod);
			log.exiting(RequestedModuleNames.class.getName(), sourceMethod, scripts);
		}
		return scripts;
	}
1369710
def getScriptNames(self):
		""""""

		if self._db == '':
			raise FMError, 'No database was selected'

		request = []
		request.append(uu({'-db': self._db }))
		request.append(uu({'-scriptnames': '' }))

		result = self._doRequest(request)
		result = FMResultset.FMResultset(result)

		scriptNames = []
		for scriptName in result.resultset:
			scriptNames.append(string.lower(scriptName['SCRIPT_NAME']))

		return scriptNames
912940
function cleanup (dirs) {
  return function (mode, pass, callback) {
    var done = after(dirs.length, callback)

    dirs.forEach(function (dir) {
      rimraf(dir, done)
    })
  }
}
508681
public function getScripts(): string
    {
        $str = '';

        if(isset($this->scripts))
            foreach($this->scripts as $script)
                if(isset($script['content']))
                    $str .= '<script type="'.$script['type'].'">'.$script['content'].'</script>';
                elseif(isset($script['href']))
                    $str .= '<script type="'.$script['type'].'" src="'.$script['href'].'"'.(($script['defer']) ? ' defer async' : '').'></script>';
                elseif(isset($script['raw']))
                    $str .= $script['raw'];

        return $str;
    }
429750
private function getCompleteTypoScriptSetup()
    {
        $pageUid = \Tx_Oelib_PageFinder::getInstance()->getPageUid();
        if ($pageUid === 0) {
            return [];
        }

        if ($this->existsFrontEnd()) {
            return $this->getFrontEndController()->tmpl->setup;
        }

        /** @var TemplateService $template */
        $template = GeneralUtility::makeInstance(TemplateService::class);
        $template->tt_track = 0;
        $template->init();

        /** @var PageRepository $page */
        $page = GeneralUtility::makeInstance(PageRepository::class);
        $rootline = $page->getRootLine($pageUid);
        $template->runThroughTemplates($rootline, 0);
        $template->generateConfig();

        return $template->setup;
    }
89502
function outputAll(cb) {
    cb = u.maybe(cb);

    var count = u.size(self.file$);
    var result = [];

    if (!defaultOutput || !count) return cb(log('statics.outputAll: no output'));

    var done = u.after(count, function() {
      log('output %s %s static files', defaultOutput.path, result.length);
      cb(result);
    });

    var omit = defaultOutput.omitRoutes;
    if (omit && !u.isArray(omit)) { omit = [omit]; }

    // TODO: re-use similar filter in generator.output and serve-scripts.outputAll
    var filterRe = new RegExp('^(/admin/|/server/' +
                (opts.editor ? '' : '|/pub/') +
                       (omit ? '|' + u.map(omit, u.escapeRegExp).join('|') : '') +
                              ')');

    u.each(self.file$, function(spo, reqPath) {
      if (filterRe.test(reqPath)) return done();

      var src = path.join(spo.sp.src.path, spo.file);
      var dest = path.join(defaultOutput.path, spo.sp.route, spo.file);

      // copy will create dirs if necessary
      fs.copy(src, dest, function(err) {
        if (err) return done(log(err));
        result.push(dest);
        done();
      });

    });
    return self; // chainable
  }