Skip to content

Instantly share code, notes, and snippets.

View ryangiglio's full-sized avatar

Ryan Giglio ryangiglio

View GitHub Profile
@ryangiglio
ryangiglio / getGradientStops.js
Created May 17, 2016 19:32
Calculate hex values at equally spaced color stops inside a linear gradient
// startHex: starting hex value
// endHex: ending hex value
// numStops: number of equally spaced color stops INCLUDING start/end
function getGradientStops(startHex, endHex, numStops) {
function getSingleColorStops(startHex, endHex, numStops) {
var stops = [startHex],
// Get start/end in decimal
startDec = parseInt(startHex, 16),
@ryangiglio
ryangiglio / gist:4048886
Created November 9, 2012 23:01
Tweet Machine proof of concept
#
# Alias to setTimeout that reverses the parameters, making it much cleaner in code
#
delay = (time, callback) -> setTimeout(callback, time)
#
# SETUP VARS
#
eventSearch = "#puppy"
refreshSpeed = 5000