I hereby claim:
- I am dan-coulter on github.
- I am danco (https://keybase.io/danco) on keybase.
- I have a public key whose fingerprint is C277 80F1 FCF5 4474 467B 0457 C51A AC19 EA6E 3928
To claim this, I am signing this object:
const { readFile } = require('node:fs/promises'); | |
const filename = 'input.txt'; | |
const firstDigitRegex = /\d/; | |
const lastDigitRegex = /\d[a-z]*$/; | |
const parseCalibrationFile = async (file) => { | |
const data = (await readFile('input.txt', 'utf8')).split('\n'); | |
const sum = data.reduce((acc, line) => { | |
const firstDigit = parseInt(line.match(firstDigitRegex) ?? '0'); |
export const truncate = (source: string, n: number): string => source.replace(new RegExp(`([a-z]{${n}})[a-z]+`, 'gi'), '$1'); |
// Find the longest common prefix | |
const longestPrefix = (arr) => { | |
// Handle a couple of invalid inputs | |
if (!arr || !Array.isArray(arr) || arr.length === 0) { | |
return ''; | |
// Bypass the loop if there's only one element in the array | |
} else if (arr.length === 1) { | |
return arr[0]; | |
} | |
// Create the test | |
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal"; | |
.. | |
// Pass it along through GA | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); | |
// --- IMPORTANT LINE! | |
// params: event method, custom variable slot, variable name, variable value, scope level |
I hereby claim:
To claim this, I am signing this object: