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 () { | |
const initialTeams = Array.prototype.slice.call(document.querySelectorAll('#schedsubnav li')); | |
const scores = []; | |
// gets results based on what is displayed, clicks to change selected team need to happen before this | |
const getResults = () => { | |
const res = document.querySelectorAll('table.Table.Table-interactive tbody tr'); | |
const arr = Array.prototype.slice.call(res); | |
return arr.map(row => { | |
const score = row.querySelector('td span.yfa-score').textContent; |
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
// setup | |
// install if you don't have the below packages already | |
// | |
// $ npm install node-fetch --save | |
// $ npm install jsdom --save | |
// imports | |
const fs = require('fs'); | |
const fetch = require('node-fetch'); | |
const jsdom = require("jsdom"); |
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
(async function() { | |
// Volume,Symbol,Date Acquired,Date Sold,Proceeds,Cost Basis,Gain,Currency | |
const csv = []; | |
const formatDate = dateStr => dateStr.slice(5).replace('-', '/') + '/' + dateStr.slice(0, 4); | |
const rows = csv.map(row => { | |
const [volume, symbol, acquired, sold, proceeds, costBasis, gain, currency] = row.split(","); | |
const description = `${volume} ${symbol}`; |
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
var Path = require('path'); | |
var getRegCommand = function() { | |
var command = 'reg.exe'; | |
if (process.env.SystemRoot) { | |
command = Path.join(process.env.SystemRoot, 'System32', command); | |
} | |
return command; | |
} |
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 test() { | |
var ids = getIds(); | |
var batches = createBatches(ids); | |
for (var id in batches) { | |
if (batches.hasOwnProperty(id)) { | |
var pages = batches[id]; | |
var start = pages[0]; | |
var end = pages[pages.length -1]; |
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
/* @flow */ | |
export type Baz = { | |
bar: number; | |
baz: Array<string>; | |
}; |
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
var Validator = require('simple-validate'); | |
var validateTenantArgs = Validator.validateOrThrow({ | |
title: 'somePred', | |
etc: '...' | |
}); | |
// current style | |
function postTenantToSystemTenant(systemTenant, tenantArgs) { | |
validateTenantArgs(tenantArgs); |
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
/* | |
* Thread configuration for each thread. Make sure it matches the number above. | |
* low_power_mode - This mode will double the cache usage, and double the single thread performance. It will | |
* consume much less power (as less cores are working), but will max out at around 80-85% of | |
* the maximum performance. | |
* | |
* no_prefetch - Some sytems can gain up to extra 5% here, but sometimes it will have no difference or make | |
* things slower. | |
* | |
* affine_to_cpu - This can be either false (no affinity), or the CPU core number. Note that on hyperthreading |
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
hasMatchingBrackets :: String -> Bool | |
hasMatchingBrackets = fst . foldr reducingFn (True, mempty) | |
where | |
reducingFn _ (False, xs) = (False, xs) -- short circuit if already false | |
reducingFn char (True, tokens) | char `elem` openingTokens = (True, char : tokens) | |
reducingFn char (True, []) | char `elem` closingTokens = (False, []) | |
reducingFn char (True, x:xs) | char `elem` closingTokens = if isClosingToken x char then (True, xs) else (False, x:xs) | |
reducingFn _ st = st | |
tokenPairs :: [(Char, Char)] |
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
var DCData = { /* ... */ } | |
var TestData = { /* ... */ } | |
var PanelCodes = { | |
"LABS, Inc": { | |
"CT Panel": "3328", | |
"WU Panel": "3223" | |
}, | |
"ViroMed Laboratories": { | |
"CT Panel": "139467", |
NewerOlder