This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Endpoints | |
metadata: | |
name: cloudtower-perf | |
namespace: prometheus | |
subsets: | |
- addresses: | |
- ip: 1.2.3.5 | |
nodeName: tower.smartx.com | |
- ip: 1.2.3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name i18n editor | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include /?i18n-editor/ | |
// @grant none | |
// @require https://cdn.jsdelivr.net/npm/jszip@3.6.0/dist/jszip.min.js | |
// @require https://raw.githubusercontent.com/eligrey/FileSaver.js/master/dist/FileSaver.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lastOf(arr) { | |
return arr[arr.length - 1]; | |
} | |
function getCurrentStatement(ast) { | |
if (ast.body.length === 0) { | |
throw new Error("No statement found"); | |
} | |
return lastOf(ast.body); | |
} | |
function getCurrentFrom(ast) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sessionId = Cypress.env('sessionId'); | |
const appFrame = window.parent.document.querySelectorAll('iframe')[0]; | |
Cypress.on('window:load', () => { | |
appFrame.contentWindow.eval(` | |
const request = new XMLHttpRequest(); | |
request.open('GET', 'https://cdn.jsdelivr.net/npm/rrweb@0.7.4/dist/rrweb.min.js', false); | |
request.send(''); | |
const script = document.createElement('script'); | |
script.type = 'text/javascript'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> callback here | |
added element type node <body>…</body> | |
[found with selector "div p"] | |
added element type node <div>…</div> | |
[found with selector "div p"] | |
added element type node <p></p> | |
added element type node <script></script> | |
>>> callback here | |
added element type node <a></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function longTask(int, callback) { | |
if (int < 0) { | |
callback(new Error('less than 0')); | |
} else { | |
callback(null, 'done'); | |
} | |
} | |
// callback | |
longTask(1, (err, result) => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -i \ | |
--rm \ | |
--name node-test \ | |
-v "$PWD":/code \ | |
-w /code node:latest \ | |
/bin/bash -c "npm i --silent --progress=false --registry=https://registry.npm.taobao.org && npm run test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lodash = require('lodash'); | |
const toArray = require('../utils/toArray'); | |
const { CONSTANTS: C } = require('../globals'); | |
const NAME_ALIAS = '名称'; | |
function hint(options) { | |
const rules = ['Check your selector value.']; | |
if (!options.debug) { | |
rules.push('Add { debug: true } to your options to get more info.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const argv = require('minimist')(process.argv.slice(2)); | |
const lodash = require('lodash'); | |
const setUrl = require('./utils/setUrl'); | |
const flattenArgs = args => { | |
let argsArr; | |
if (!args) { | |
argsArr = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rm -f $(docker ps -a -q | awk '{if($1!~/92033adc934d/) print}') | |
docker network rm $(docker network ls | awk '{if($2~/-network/) print $2}') |
NewerOlder