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
Pre-reqs | |
a) install VirtualBox and Vagrant | |
b) add homestead box (once vagrant is installed) - vagrant box add laravel/homestead | |
1) create local directory (source code would be placed there) | |
mkdir ~/prj/Commer/v2/lac2-magento.dev | |
1.a) cd ~/prj/Commer/v2/lac2-magento.dev/ |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
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
<?php | |
function get_combinations($arrays) { | |
$result = array(array()); | |
foreach ($arrays as $property => $property_values) { | |
$tmp = array(); | |
foreach ($result as $result_item) { | |
foreach ($property_values as $property_value) { | |
$tmp[] = array_merge($result_item, array($property => $property_value)); | |
} |
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
const isOpen = (parenthesisChar, pts) => pts.filter(pt => pt[0] === parenthesisChar).length | |
const matches = (topOfStack, closed, pts) => pts.filter(pt => pt[0] === topOfStack && pt[1] === closed).length | |
const getValidCharacters = patterns => patterns.map(p => p.join('')).join('') | |
const verify = string => { | |
const charactersArr = string.split('') | |
const patterns = [ |
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
const ceasarCipher = (str, num) => { | |
const alphabetArr = 'abcdefghijklmnopqrstuvwxyz'.split('') | |
let myNum = num % alphabetArr.length | |
const strArr = str.toLowerCase().split('') | |
let resArr = [] | |
for (let c in strArr) { |
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
const harmlessRansomNote = (search, text) => { | |
let result = true | |
const textArr = text.toLowerCase().split(' ') | |
const searchArr = search.toLowerCase().split(' ') | |
const hash = {} | |
for (let idx in textArr) { | |
const word = textArr[idx] | |
if (!hash[word]) hash[word] = 0 |
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
const fizzBuzz = num => { | |
for(let i = 1; i <= num; i++) { | |
if (i % 15 === 0) { | |
console.log('FizzBuzz') | |
continue | |
} | |
let val = i | |
if (i % 3 === 0) val = 'Fizz' |
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
const reverseWords = string => { | |
const wordsArr = string.split(' ') | |
let result = [] | |
wordsArr.forEach(el => { | |
result.push(el.split('').reverse().join('')) | |
}) | |
return result.join(' ') |
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
const reverseArrayInPlace = arr => { | |
for(let i = 0; i < (arr.length / 2)+1; i++) { | |
const first = arr.shift() | |
arr.splice(arr.length - i, 0, first) | |
} | |
return arr | |
} |
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
const getMedian = arr => { | |
const arrLen = arr.length | |
if (arrLen % 2 !== 0) { | |
return arr[Math.floor(arrLen / 2)] | |
} else { | |
const m1 = arr[(arrLen / 2) - 1] | |
const m2 = arr[arrLen / 2] | |
return (m1 + m2) / 2 | |
} |