This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################## FUNCTIONS | |
# Function: sanitize_inputs | |
# Description: Sanitizes the user input, ensuring the existence of the launchsite name | |
function sanitize_inputs() { | |
LAUNCHSITE=$1 | |
function usage { | |
echo "Genesis <launchsite>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('underscore'); | |
const machineData = [1,2,3,2,3,2,3,4,5,5,5,6,5,4,4,3,1]; | |
const info = _.reduce(machineData, (memo, current, index) => { | |
const { last, lastSlope, minIndexes, maxIndexes } = memo | |
const slope = last ? current-last : 0; | |
if (slope != 0 && lastSlope && Math.sign(slope) != Math.sign(lastSlope)) { | |
if (slope > 0) { | |
minIndexes.push(index-1); | |
} else { | |
maxIndexes.push(index-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const info = _.reduce(list (memo, item) => { | |
if (item.data > memo.max.data) memo.max = item | |
if (item.data < memo.min.data) memo.min = item | |
return memo | |
}) | |
console.log(infom.max) // item with max .data | |
console.log(info.min) //item with min .data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
DO NOT EDIT! --> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
<DT><A ADD_DATE="1452301889" HREF="http://netflix.com/browse/genre/1365">Action & Adventure</A> | |
<DT><A ADD_DATE="1452301889" HREF="http://netflix.com/browse/genre/43040">Action Comedies</A> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your .bashrc | |
source ~/.make_ps1 | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
parse_virtualenv() { | |
echo '['$(basename $VIRTUAL_ENV 2> /dev/null)']' | sed -e '/\[\]/d' | |
} |