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
package com.JJ; | |
import java.util.Stack; | |
public class Main { | |
static Stack<Integer> nums; | |
public static void main(String[] args) { | |
binary(11); | |
while(!nums.isEmpty()){ | |
System.out.printf("%d",nums.peek()); |
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 lighthouse = require("lighthouse"); | |
const chromeLauncher = require("chrome-launcher"); | |
function launchChromeAndRunLighthouse(type, page, timestamp, res) { | |
const relativePath = `reports/${type}/${page}/${timestamp}.json`; | |
let opts = { | |
chromeFlags: ["--no-sandbox", "--disable-gpu", "--headless"], | |
extraHeaders: { Cookie: "split_tcv=100" } | |
}; | |
let lighthouse_config_accessibilityOnly = { |
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
Date.prototype.customFormat = function(formatString) { | |
var YYYY, | |
YY, | |
MMMM, | |
MMM, | |
MM, | |
M, | |
DDDD, | |
DDD, | |
DD, |
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
// await execa.shell( | |
// `aws s3 ls way-accessibility/reports/${type}/hp --recursive | sort | tail -n 10 | awk '{ print $4}' >./reports/trendData/label/${type}.txt` | |
// ); |
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 instream = fs.createReadStream( | |
path.join(__dirname, `../reports/trendData`, `${type}.json`) | |
); | |
const outstream = new stream(); | |
const rl = readline.createInterface(instream, outstream); | |
const labels = []; | |
rl.on("line", function(line) { | |
labels.push(line.slice(-19, -5)); | |
}); |
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 get(url) { | |
return new Promise((resolve, reject) => { | |
fetch(url) | |
.then(res => res.json()) | |
.then(data => resolve(data)) | |
.catch(err => reject(err)); | |
}); | |
} | |
#example |
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 getMostRecentLocalFileName(dir) { | |
var files = fs.readdirSync(dir); | |
return _.max(files, function(f) { | |
var fullpath = path.join(dir, f); | |
return fs.statSync(fullpath).ctime; | |
}); | |
} |
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
_getAllStaticRDCData = () => { | |
var self = this; | |
axios | |
.all([ | |
this.getStaticRDCData("hp"), | |
this.getStaticRDCData("srp"), | |
this.getStaticRDCData("ldp") | |
]) | |
.then( | |
axios.spread(function(hp, srp, ldp) { |
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
urls=("http://way-api.rdc-dev.moveaws.com/prod/hptest" "http://way-api.rdc-dev.moveaws.com/prod/srptest" "http://way-api.rdc-dev.moveaws.com/prod/ldptest" "http://way-api.rdc-dev.moveaws.com/beta/hptest" "http://way-api.rdc-dev.moveaws.com/beta/srptest" "http://way-api.rdc-dev.moveaws.com/beta/ldptest") | |
for url in "${urls[@]}" | |
do | |
curl "$url" | |
done |
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 clearFolder = directory => { | |
fs.readdir(directory, (err, files) => { | |
if (err) throw err; | |
for (const file of files) { | |
fs.unlink(path.join(directory, file), err => { | |
if (err) throw err; | |
}); | |
} | |
}); |
NewerOlder