Skip to content

Instantly share code, notes, and snippets.

View maxjing's full-sized avatar

Jing Wen maxjing

View GitHub Profile
@maxjing
maxjing / readline.js
Created January 19, 2019 00:27
javascript readline
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));
});
@maxjing
maxjing / awsprint.js
Created January 19, 2019 03:59
awsprint.js
// await execa.shell(
// `aws s3 ls way-accessibility/reports/${type}/hp --recursive | sort | tail -n 10 | awk '{ print $4}' >./reports/trendData/label/${type}.txt`
// );
@maxjing
maxjing / time.js
Created January 23, 2019 19:28
timestamp
Date.prototype.customFormat = function(formatString) {
var YYYY,
YY,
MMMM,
MMM,
MM,
M,
DDDD,
DDD,
DD,
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 = {
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());