e.g. 0-dev.20170707
335026
function getNightlyPatch(plainPatch) {
    // We're going to append a representation of the current time at the end of the current version.
    // String.prototype.toISOString() returns a 24-character string formatted as 'YYYY-MM-DDTHH:mm:ss.sssZ',
    // but we'd prefer to just remove separators and limit ourselves to YYYYMMDDHHmmss.
    // UTC time will always be implicit here.
    const now = new Date();
    const timeStr = now.toISOString().replace(/:|T|\.|-/g, "").slice(0, 14);

    return `${plainPatch}-dev.${timeStr}`;
}
514906
function yy_r187(){
    $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor;
    }
804369
def bump(oldversion, level)
      major = minor = patch = 0
      if oldversion =~ /^(\d+)\.(\d+)\.(\d+)$/
        major = Regexp.last_match(1).to_i
        minor = Regexp.last_match(2).to_i
        patch = Regexp.last_match(3).to_i
      end
      case level.to_sym
      when :major
        major += 1
        minor = 0
        patch = 0
      when :minor
        minor += 1
        patch = 0
      when :patch
        patch += 1
      end
      version = [major, minor, patch].compact.join('.')
      version
    end
211192
function (tmplPath) {
  var text = fs.readFileSync(tmplPath)
    .toString()
    .replace(/^\s*|\s*$/g, "");

  return ejs.compile(text);
}
102487
function update_modifier_state(e) {

        // Get state
        var state = Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);

        // Release alt if implicitly released
        if (guac_keyboard.modifiers.alt && state.alt === false) {
            guac_keyboard.release(0xFFE9); // Left alt
            guac_keyboard.release(0xFFEA); // Right alt
            guac_keyboard.release(0xFE03); // AltGr
        }

        // Release shift if implicitly released
        if (guac_keyboard.modifiers.shift && state.shift === false) {
            guac_keyboard.release(0xFFE1); // Left shift
            guac_keyboard.release(0xFFE2); // Right shift
        }

        // Release ctrl if implicitly released
        if (guac_keyboard.modifiers.ctrl && state.ctrl === false) {
            guac_keyboard.release(0xFFE3); // Left ctrl 
            guac_keyboard.release(0xFFE4); // Right ctrl 
        }

        // Release meta if implicitly released
        if (guac_keyboard.modifiers.meta && state.meta === false) {
            guac_keyboard.release(0xFFE7); // Left meta 
            guac_keyboard.release(0xFFE8); // Right meta 
        }

        // Release hyper if implicitly released
        if (guac_keyboard.modifiers.hyper && state.hyper === false) {
            guac_keyboard.release(0xFFEB); // Left hyper
            guac_keyboard.release(0xFFEC); // Right hyper
        }

        // Update state
        guac_keyboard.modifiers = state;

    }
783665
function addDetected(app, pattern, type, value, key) {
  app.detected = true;

  // Set confidence level
  app.confidence[`${type} ${key ? `${key} ` : ''}${pattern.regex}`] = pattern.confidence === undefined ? 100 : parseInt(pattern.confidence, 10);

  // Detect version number
  if (pattern.version) {
    const versions = [];
    const matches = pattern.regex.exec(value);

    let { version } = pattern;

    if (matches) {
      matches.forEach((match, i) => {
        // Parse ternary operator
        const ternary = new RegExp(`\\\\${i}\\?([^:]+):(.*)$`).exec(version);

        if (ternary && ternary.length === 3) {
          version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
        }

        // Replace back references
        version = version.trim().replace(new RegExp(`\\\\${i}`, 'g'), match || '');
      });

      if (version && versions.indexOf(version) === -1) {
        versions.push(version);
      }

      if (versions.length) {
        // Use the longest detected version number
        app.version = versions.reduce((a, b) => (a.length > b.length ? a : b));
      }
    }
  }
}
249337
function default_versionCode(version) {
    var nums = version.split('-')[0].split('.');
    var versionCode = 0;
    if (+nums[0]) {
        versionCode += +nums[0] * 10000;
    }
    if (+nums[1]) {
        versionCode += +nums[1] * 100;
    }
    if (+nums[2]) {
        versionCode += +nums[2];
    }
    return versionCode;
}
85788
function packageVersion (rangeString) {
  if (!rangeString || typeof rangeString !== 'string') {
    // 默认装 latest
    return 'latest'
  }

  const range = semverUtils.parseRange(rangeString)[0]
  const version = [
    range.major,
    range.minor,
    range.patch
  ].join('.')

  return range.release
    ? `${version}-${range.release}`
    : version
}
821368
function parseFlashVersion(desc) {
      var matches = desc.match(/[\d]+/g);
      matches.length = 3;
      return matches.join(".");
    }
343688
function genTaskOptions(env) {
	var mp = env.pluginName + ': ';
	return {
		name : '<%= commit.versionTag %>',
		pkgCurrVerBumpMsg : mp
				+ 'Updating <%= env.pkgPath %> version to match release version <%= commit.version %> <%= commit.skipTaskGen(options.releaseSkipTasks) %>',
		pkgNextVerBumpMsg : mp
				+ 'Bumping <%= env.pkgPath %> version to <%= commit.next.version %> <%= commit.skipTaskGen(options.releaseSkipTasks) %>',
		distBranchPubMsg : mp + 'Publishing <%= commit.version %> <%= commit.skipTaskGen(options.releaseSkipTasks) %>',
		pkgJsonReplacer : null,
		pkgJsonSpace : 2,
		gitHostname : github.hostname,
		repoName : 'origin',
		repoUser : env.pluginName,
		repoEmail : env.pluginName + '@' + (process.env.TRAVIS_BUILD_NUMBER ? 'travis-ci.org' : 'example.org'),
		chgLog : 'HISTORY.md',
		authors : 'AUTHORS.md',
		chgLogLineFormat : '  * %s',
		chgLogRequired : true,
		chgLogSkipRegExps : [ mp ],
		authorsRequired : false,
		authorsSkipLineRegExp : null,
		distBranch : 'gh-pages',
		distDir : 'dist',
		distBranchCreateRegExp : /Couldn't find remote ref/i,
		distExcludeDirRegExp : /.?node_modules.?/gmi,
		distExcludeFileRegExp : /.?\.zip|tar.?/gmi,
		distAssetCompressRatio : 9,
		distAssetDir : '..',
		distAssetUpdateFunction : null,
		distAssetUpdateFiles : [],
		distBranchUpdateFunction : null,
		distBranchUpdateFiles : [],
		rollbackStrategy : 'queue',
		rollbackAsyncTimeout : 60000,
		asyncTimeout : 60000,
		releaseSkipTasks : [ 'ci' ],
		npmTag : '',
		npmRegistryURL : 'https://registry.npmjs.org'
	};
}
497203
function b64tob64u(s) {
    s = s.replace(/\=/g, "");
    s = s.replace(/\+/g, "-");
    s = s.replace(/\//g, "_");
    return s;
}
1056146
function gdversion($full = false) {
        static $gd_version = null;
        static $gd_full_version = null;
        if ($gd_version === null) {
            if ($this->function_enabled('gd_info')) {
                $gd = gd_info();
                $gd = $gd["GD Version"];
                $regex = "/([\d\.]+)/i";
            } else {
                ob_start();
                phpinfo(8);
                $gd = ob_get_contents();
                ob_end_clean();
                $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i";
            }
            if (preg_match($regex, $gd, $m)) {
                $gd_full_version = (string) $m[1];
                $gd_version = (float) $m[1];
            } else {
                $gd_full_version = 'none';
                $gd_version = 0;
            }
        }
        if ($full) {
            return $gd_full_version;
        } else {
            return $gd_version;
        }
    }
446967
def release_date(version = Origen.app.version.prefixed)
      time = release_time(version)
      time ? time.to_date : nil
    end
1358955
function (e) {
		const key = extractKey(e);
		if (key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT) {
			ipc.send('vscode:toggleDevTools');
		} else if (key === RELOAD_KB) {
			ipc.send('vscode:reloadWindow');
		}
	}
1194410
function ensureGagarinVersionsMatch(pathToApp, verbose) {

  var pathToMeteorPackages = path.join(pathToApp, '.meteor', 'packages');
  var nodeModuleVersion    = require('../../package.json').version;

  return new Promise(function (resolve, reject) {

    utils.getGagarinPackageVersion(pathToApp).then(function (packageVersion) {

      if (packageVersion === nodeModuleVersion) {
        logs.system("node module and smart package versions match, " + packageVersion);
        return resolve();
      }

      tools.getReleaseVersion(pathToApp).then(function (meteorReleaseVersion) {

        if (meteorReleaseVersion < "0.9.0") {
          // really, we can do nothing about package version
          // without a decent package management system
          logs.system("meteor version is too old to automatically fix package version");
          return resolve();
        }

        logs.system("meteor add anti:gagarin@=" + nodeModuleVersion);

        var meteor = spawn('meteor', [ 'add', 'anti:gagarin@=' + nodeModuleVersion ], {

          stdio: verbose ? 'inherit' : 'ignore', cwd: pathToApp
        });

        /*
        meteor.stdout.on('data', function (data) {
          if (!verbose) {
            return;
          }
          process.stdout.write(chalk.gray(stripAnsi(data)));
        });
        */

        meteor.on('error', reject);

        meteor.on('exit', function (code) {
          if (code > 0) {
            return reject(new Error('meteor exited with code ' + code));
          }
          logs.system("anti:gagarin is now in version " + nodeModuleVersion);
          resolve();
        });

      }).catch(reject);

    }).catch(reject);

  }); // Promise
}
618957
function(mod, modName, rawCode, done) {
  var resolveModule = function(requiredName) {
    return mod.getModuleIDByOrigin(requiredName);
  };
  try {
    var transformedCode = fixReactTransform(transform(rawCode, {harmony: true}));
    var modularizedCode =
      Modularizer.modularize(modName, transformedCode, resolveModule);
    originalSourceCache[modName] = rawCode;
    transformCache[modName] = modularizedCode;
    transformTimes[modName] = Date.now();
    done(null, transformCache[modName]);
  } catch (e) {
    // Original error only includes esprima trace!
    var parseError =
      new Error('Syntax Error: ' + mod.path + ' ' + e.toString());
    done(parseError);
  }
}
662
function () {
/*Line 35 - 'AtomBrowser.js' */        var nVer = navigator.appVersion;
/*Line 36 - 'AtomBrowser.js' */        var nAgt = navigator.userAgent;
/*Line 37 - 'AtomBrowser.js' */        this.userAgent = nAgt;
/*Line 38 - 'AtomBrowser.js' */        var browserName = navigator.appName;
/*Line 39 - 'AtomBrowser.js' */        var fullVersion = "" + parseFloat(navigator.appVersion);
/*Line 40 - 'AtomBrowser.js' */        var majorVersion = parseInt(navigator.appVersion, 10);
/*Line 41 - 'AtomBrowser.js' */        var nameOffset, verOffset, ix;

/*Line 43 - 'AtomBrowser.js' */        // In Opera, the true version is after "Opera" or after "Version"
/*Line 44 - 'AtomBrowser.js' */        if ((verOffset = nAgt.indexOf("Opera")) != -1) {
/*Line 45 - 'AtomBrowser.js' */            browserName = "Opera";
/*Line 46 - 'AtomBrowser.js' */            fullVersion = nAgt.substring(verOffset + 6);
/*Line 47 - 'AtomBrowser.js' */            if ((verOffset = nAgt.indexOf("Version")) != -1) {
/*Line 48 - 'AtomBrowser.js' */                fullVersion = nAgt.substring(verOffset + 8);
/*Line 49 - 'AtomBrowser.js' */            }
/*Line 50 - 'AtomBrowser.js' */        }
/*Line 51 - 'AtomBrowser.js' */            // In MSIE, the true version is after "MSIE" in userAgent
/*Line 52 - 'AtomBrowser.js' */        else if ((verOffset = nAgt.indexOf("MSIE")) != -1) {
/*Line 53 - 'AtomBrowser.js' */            browserName = "Microsoft Internet Explorer";
/*Line 54 - 'AtomBrowser.js' */            fullVersion = nAgt.substring(verOffset + 5);
/*Line 55 - 'AtomBrowser.js' */        }
/*Line 56 - 'AtomBrowser.js' */                // In Chrome, the true version is after "Chrome"
/*Line 57 - 'AtomBrowser.js' */        else if ((verOffset = nAgt.indexOf("Chrome")) != -1) {
/*Line 58 - 'AtomBrowser.js' */            browserName = "Chrome";
/*Line 59 - 'AtomBrowser.js' */            fullVersion = nAgt.substring(verOffset + 7);
/*Line 60 - 'AtomBrowser.js' */        }
/*Line 61 - 'AtomBrowser.js' */                // In Safari, the true version is after "Safari" or after "Version"
/*Line 62 - 'AtomBrowser.js' */        else if ((verOffset = nAgt.indexOf("Safari")) != -1) {
/*Line 63 - 'AtomBrowser.js' */            browserName = "Safari";
/*Line 64 - 'AtomBrowser.js' */            this.isMobile = nAgt.indexOf("iPhone") != -1;
/*Line 65 - 'AtomBrowser.js' */            fullVersion = nAgt.substring(verOffset + 7);
/*Line 66 - 'AtomBrowser.js' */            if ((verOffset = nAgt.indexOf("Version")) != -1) {
/*Line 67 - 'AtomBrowser.js' */                fullVersion = nAgt.substring(verOffset + 8);
/*Line 68 - 'AtomBrowser.js' */            }
/*Line 69 - 'AtomBrowser.js' */        }
/*Line 70 - 'AtomBrowser.js' */                // In Firefox, the true version is after "Firefox"
/*Line 71 - 'AtomBrowser.js' */        else if ((verOffset = nAgt.indexOf("Firefox")) != -1) {
/*Line 72 - 'AtomBrowser.js' */            browserName = "Firefox";
/*Line 73 - 'AtomBrowser.js' */            fullVersion = nAgt.substring(verOffset + 8);
/*Line 74 - 'AtomBrowser.js' */        }
/*Line 75 - 'AtomBrowser.js' */                // In most other browsers, "name/version" is at the end of userAgent
/*Line 76 - 'AtomBrowser.js' */        else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) <
/*Line 77 - 'AtomBrowser.js' */              (verOffset = nAgt.lastIndexOf('/'))) {
/*Line 78 - 'AtomBrowser.js' */                  browserName = nAgt.substring(nameOffset, verOffset);
/*Line 79 - 'AtomBrowser.js' */                  fullVersion = nAgt.substring(verOffset + 1);
/*Line 80 - 'AtomBrowser.js' */                  if (browserName.toLowerCase() == browserName.toUpperCase()) {
/*Line 81 - 'AtomBrowser.js' */                      browserName = navigator.appName;
/*Line 82 - 'AtomBrowser.js' */                  }
/*Line 83 - 'AtomBrowser.js' */              }
/*Line 84 - 'AtomBrowser.js' */        // trim the fullVersion string at semicolon/space if present
/*Line 85 - 'AtomBrowser.js' */        if ((ix = fullVersion.indexOf(";")) != -1) {
/*Line 86 - 'AtomBrowser.js' */            fullVersion = fullVersion.substring(0, ix);
/*Line 87 - 'AtomBrowser.js' */        }
/*Line 88 - 'AtomBrowser.js' */        if ((ix = fullVersion.indexOf(" ")) != -1) {
/*Line 89 - 'AtomBrowser.js' */            fullVersion = fullVersion.substring(0, ix);
/*Line 90 - 'AtomBrowser.js' */        }

/*Line 92 - 'AtomBrowser.js' */        majorVersion = parseInt('' + fullVersion, 10);
/*Line 93 - 'AtomBrowser.js' */        if (isNaN(majorVersion)) {
/*Line 94 - 'AtomBrowser.js' */            fullVersion = '' + parseFloat(navigator.appVersion);
/*Line 95 - 'AtomBrowser.js' */            majorVersion = parseInt(navigator.appVersion, 10);
/*Line 96 - 'AtomBrowser.js' */        }

/*Line 98 - 'AtomBrowser.js' */        this.browserName = browserName;
/*Line 99 - 'AtomBrowser.js' */        this.majorVersion = majorVersion;
/*Line 100 - 'AtomBrowser.js' */        this.isMobile = /android|mobile|ios|iphone/gi.test(nAgt);
/*Line 101 - 'AtomBrowser.js' */    }