Skip to content

Instantly share code, notes, and snippets.

Eating or thinking about eating

Shane Cavaliere shanecav

Eating or thinking about eating
Block or report user

Report or block shanecav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View zpreztorc
# Sets Prezto options.
# Authors:
# Sorin Ionescu <>
# General
shanecav / cloudSettings
Last active May 26, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
shanecav / flatten.js
Created Sep 30, 2016
A function that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers
View flatten.js
// recursively flatten arbitrarily nested array(s) of integers
const flatten = (arr) => {
// Reduce nested array(s) into a flat array (starting with empty array)
return arr.reduce((prev, cur) => {
if (Array.isArray(cur)) {
// if it's an array, concat its flattened result
return prev.concat(flatten(cur))
if (Number.isInteger(cur)) {
// if it's an integer, concat the value
shanecav / server.js
Created Jul 19, 2016
Flowtype error on node http Server listen method
View server.js
const createServer = require('http').createServer
const app = require('./http/app') // Express app
const server = createServer(app)
* ^ This is where I'm getting the Flow error:
* call of method `listen`: /Users/shane/projects/blockpop/server/src/server.js:22
You can’t perform that action at this time.