Skip to content

Instantly share code, notes, and snippets.

@jaruesink
jaruesink / tailwind.config.js
Created January 30, 2023 21:50
Example Tailwind Config using CSS Vars for color theme
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind');
const colors = require('tailwindcss/colors');
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./app/**/*.{ts,tsx,jsx,js}', ...createGlobPatternsForDependencies(__dirname)],
theme: {
extend: {
fontFamily: {
@jaruesink
jaruesink / findUniquePairsThatSumTo.js
Last active December 4, 2019 21:17
RainforestQA Interview Question
const sampleData = [0, 1, 100, 99, 0, 10, 90, 30, 55, 50, 33, 49, 49, 55, 75, 51, 49, 50, 51, 50, 49, 51];
const findUniquePairsThatSumToA = (summedValue, data) => {
const usedValues = new Map([]);
return data.reduce((acc, dataValue) => {
const matchingPairUsedCount = usedValues.get(summedValue - dataValue) || 0;
const matchingPairUsed = usedValues.has(summedValue - dataValue);
if (matchingPairUsed && matchingPairUsedCount === 1) acc.push([dataValue, summedValue - dataValue]);
usedValues.set(summedValue - dataValue, matchingPairUsedCount + 1);