Skip to content

Instantly share code, notes, and snippets.

View dougshamoo's full-sized avatar

Doug Shamoo dougshamoo

  • Orange County, CA
View GitHub Profile
@dougshamoo
dougshamoo / calculateGraphTicks.js
Created January 16, 2020 19:51
Calculate graph ticks with upper and lower bound
function getTicks(min, max, numMiddleTicks) {
const delta = (max - min) / (numMiddleTicks + 1);
const middleTicks = Array(numMiddleTicks)
.fill()
.map((_, i) => {
return min + (i + 1) * delta;
})
return [min, ...middleTicks, max];
}
/*
Function - returns function - shortens long numbers, given array of strings
return function
not numerical string (strings, not a number, arrays) --> number string
INPUT
array of string labels, base number
input to the return function, must be validated

Twitch Checker

Uses the Twitch.tv JSON API to display a list of Online and Offline streamers. Now with a search bar!

A Pen by dougtslug on CodePen.

License.

Camper News

Uses FreeCodeCamp's Camper News Hot Stories API to display a stylized version of Camper News.

A Pen by dougtslug on CodePen.

License.

Weather Tether

Yeah, it's a stupid name. I like rhymes.

TODO: implement input for either zipcode or city TODO: °F to °C conversion button

A Pen by dougtslug on CodePen.

License.

The Fact Generator 3

Click the button to get a random Chuck Norris fact. Repeat ad nauseam. *Now with staggered animations using ngAnimate and animate.css! *Now with smoother interactions by preloading JSON for the next click so that it is ready to display. By the time each set animation is done, the next set of jokes should already be loaded.

TODO: Add twitter buttons to tweet awesome Chuck Norris jokes.

A Pen by dougtslug on CodePen.