Skip to content

Instantly share code, notes, and snippets.

#!/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>"
@thauber
thauber / .js
Last active May 19, 2020 21:20
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);
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
@thauber
thauber / NetflixBookmarks.html
Last active February 1, 2016 10:02
Chrome: Download this file. Then in chrome select Hamburger Menu > Bookmarks > Bookmark Manager. Click on the Chevron next to "Organize" then select "Import Bookmarks from HTML File...". Select the the downloaded version of this gist. It will create a folder called "Imported". Rename it to "Netflix" and move it where ever you would like.
<!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>
# 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'
}