Skip to content

Instantly share code, notes, and snippets.

View kwhitejr's full-sized avatar

Kevin White kwhitejr

  • Wayfair, Inc.
  • Portland, OR
View GitHub Profile
@kwhitejr
kwhitejr / gist:ed74d21025e007a0ed22
Created November 21, 2015 19:03 — forked from jaywon/gist:c76abc57dc33e1679c02
Circular String Brain Bender

###Good Morning Agents

Your challenge this morning is to create a function that implements an algorithm using the concepts we've covered this week.

###Challenge

  1. Write an algorithm that takes in 2 strings as parameters (source, find).
  2. Your function should return true if the string passed in as the find parameter is found in the source parameter if source were circular in nature. Meaning there is no end to the source string.
  3. Important: A match would be true if the word to find is partially at the end of the word and at the beginning in sequence.

Ex.

@kwhitejr
kwhitejr / Ruh-Roh.md
Last active December 12, 2015 21:38 — forked from jaywon/Ruh-Roh.md
Email Hell

###Email Hell

We just found out that there is a bug in production that our e-mail function was iterating errantly and sending duplicate e-mails to many users. We need to fix this quickly but we don't want to send out a mass apology letter to all of our users.

Our sysadmin gave us the SMTP logs and we need to process the logs and identify which users received multiple e-mails so that we can directly send them a follow up e-mail explaining the situation and offer super cool swag to keep them on as customers.

Also, the boss wants this done ASAP, we don't have time to do this manually...HAAALLLLPPP!

###The Fix

@kwhitejr
kwhitejr / gulp-scss-livereload.md
Created December 20, 2015 00:24 — forked from kellishouts/gulp-scss-livereload.md
Gulp + SCSS + LiveReload - Updated 12/18/2015

Gulp + SCSS + LiveReload

This Gist outlines the gulp workflow that will:

  1. watch for any scss changes, then compiles scss source into css
  2. watch for any changes in the public directory, and trigger live-reload
  3. serve static content in public/

This Gist also assumes you already know how to install npm modules, gitignore, create directories and create files via the command line.

@kwhitejr
kwhitejr / README.md
Last active January 19, 2016 00:41 — forked from thgaskell/README.md
Sequelize + Express Starter Guide
@kwhitejr
kwhitejr / Kevin White - Resume.md
Last active January 5, 2017 05:32
Kevin's Living Resume
@kwhitejr
kwhitejr / cli-basics.md
Last active December 9, 2016 02:45
DevLeaguePrep -- Command Line Basics

CLI Basics

Basic Commands

Let's read about a couple of the most common commands that you're going to use.

ls = "list directory"; lists all files and folders in the present working directory (where you currently are).

pwd = "present working directory"; tells you where you currently are!

cd foldername = "change directory"; switches to the directory named 'foldername'. 'foldername' is always a child of the pwd (present working directory).

@kwhitejr
kwhitejr / aws_solutions_architect.cribsheet.md
Last active January 5, 2019 17:17
Crib Sheet for AWS Solutions Architect Exam

Crib Sheet for AWS Solutions Architect Exam

Identity and Access Management (IAM)

Official Resources

Main Features

@kwhitejr
kwhitejr / Login.js
Created May 12, 2019 01:04
A hideous but stateful React Class Component for AWS Amplify authorization
import React, { Component } from "react";
import { withRouter, Redirect } from "react-router-dom";
import { Authenticator } from "aws-amplify-react";
import { Auth, Logger, JS } from "aws-amplify";
import {
CustomSignIn,
CustomSignUp,
CustomConfirmSignIn,
CustomConfirmSignUp,
@kwhitejr
kwhitejr / FirstName.js
Last active October 7, 2019 03:24
Complex Form with React Hooks
// Example component that utilizes FormContext
import React, { useContext } from "react";
import { FormContext } from "contexts.js";
export default function FirstNameInput() {
const { form, setForm } = useContext(FormContext);
const handleChange = key => event => {
setForm({ ...form, [key]: event.target.value });
};