This file contains hidden or 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 | |
iatest=$(expr index "$-" i) | |
####################################################### | |
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me | |
####################################################### | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc |
This file contains hidden or 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
"" Vim commands e: $MYVIMRC | |
" Not compatible with vi | |
set nocompatible " required | |
filetype off " required | |
" ---------- VUNDLE ----------- | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
"call vundle#begin('~/some/path/here') |
This file contains hidden or 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
function telephoneCheck(str) { | |
let numbersOnly = str.replace(/[-\s]/g, ""); | |
let numberLength = numbersOnly.length; | |
let hasBraces = /[)(]/g; | |
let bracesVal = str.match(hasBraces); | |
if(str.indexOf(")") == str.length-1) return false; | |
if(str[0] == '-') return false; |
This file contains hidden or 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
function rot13(str) { | |
//65-90 A-Z | |
return str.split("").map(item=>{ | |
let charCode = item.charCodeAt(item[0]); | |
if( charCode >= 65 && charCode <= 90 ){ | |
let shift = 13; | |
if(charCode - shift < 65){ | |
let minusBy = 65 - (charCode - shift); |
This file contains hidden or 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
function convertToRoman(num) { | |
let roman = ""; | |
let numCollection = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]; | |
let romanCollection = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]; | |
while(num != 0){ | |
num = solver(num); | |
} | |
function solver(num){ |
This file contains hidden or 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
function palindrome(str) { | |
let filterThese = /[^-_.,)(\s/]/g; | |
let newString = str.match(filterThese).map(item=> item.toLowerCase()); | |
let reverseString = [...newString].reverse(); | |
return newString.every((item, index)=>{ | |
return item == reverseString[index]; |
This file contains hidden or 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
function orbitalPeriod(arr) { | |
var GM = 398600.4418; | |
var earthRadius = 6367.4447; | |
return arr.map(item=>{ | |
// we need r which is the earthRadius + altitude | |
let r = item.avgAlt + earthRadius; | |
// time(t) = sqrt((4PI^2 r^3)/GM); |
This file contains hidden or 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
var Person = function(firstAndLast) { | |
// Complete the method below and implement the others similarly | |
let firstName = firstAndLast.split(" ")[0]; | |
let lastName = firstAndLast.split(" ")[1]; | |
this.getFullName = function() { | |
return firstName + " " + lastName; | |
}; | |
this.getFirstName = function(){ |
This file contains hidden or 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
function addTogether(a, b) { | |
if(b){ | |
return typeof b!= 'number' ? undefined : a + b; | |
}else{ | |
if(typeof a != 'number'){ | |
return undefined; | |
} | |
return function(b){ | |
return typeof b!= 'number' ? undefined : a + b; | |
} |
This file contains hidden or 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
function truthCheck(collection, pre) { | |
let truthy = true; | |
collection.forEach(item=>{ | |
if(!item[pre]){ | |
truthy = false; | |
} | |
}); | |
return truthy; |