Skip to content

Instantly share code, notes, and snippets.

@deanohyeah
deanohyeah / close_crucible_reviews.js
Created July 15, 2017 08:19
A js executable script to close all crucible reviews for user.
#!/usr/bin/env node
/* eslint-disable import/no-commonjs */
const request = require('request')
const Promise = require('bluebird')
const FISHEYE_BASE_URL = 'FILL_IN_URL'
const userName = (process.argv[2]).toString()
const password = (process.argv[3]).toString()
let token
import React from 'react';
import { render } from 'react-dom';
const block = () => {
let state = {}
const clearState = () => {
state = {}
}
class RenderBlock extends React.Component {
@deanohyeah
deanohyeah / sequential_promise_list.js
Last active August 5, 2017 22:43
iterate through a list of promises, waiting for the item to resolve before moving to the next item
function seqPromise(){
function* generator() {
let func = () => Promise.resolve()
while(true)
func = yield func()
}
const gen = generator()
return function genPush(list, fn) {
function fnWrap(fn, item) {
return () => fn(item)
@deanohyeah
deanohyeah / make_request.js
Created August 18, 2018 20:53
Js fetch boilerplate
const makeRequest = async function ({
url,
body = {},
method = 'GET',
headers = {},
}) {
const bodyString = JSON.stringify(body)
let json
const response = await fetch(url, {
@deanohyeah
deanohyeah / index.d.ts
Created February 25, 2020 16:51
typescript declarations for parent application from npm module
// ./custom_types/performanceEntry'
declare global {
export interface PerformanceEntry {
transferSize: number,
encodedBodySize: number,
decodedBodySize: number,
responseStart: number,
responseEnd: number,
requestStart: number,
attribution: Array<any>,
@deanohyeah
deanohyeah / bash_flags_and_input_variables.sh
Created March 27, 2020 19:13
Parse flags passed into a script and provide a way to enter info, password username
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "[options] test_file test_file is name of individual test file you want to run"
echo " "
echo "options:"
echo "-h, --help show brief help"
echo "--headless=BOOLEAN for running tests in your chrome browser, only run one test at a time"
exit 0
;;