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
<Directory "/home/magento_user/www/html"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
# New directive needed in Apache 2.4.3: | |
Require all granted | |
</Directory> |
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 -x | |
# This scripts assumes that you already have all the correct packages | |
# installed and configured the virtual host for Apache 2.x. Also | |
# assuming that you've added the magento cli to your $PATH. | |
cd ~/www/html/ | |
# "Nuke It From Orbit" - I've screwed up my Magento install and couldn't | |
# seem to back out the change. So I gave up and started over. |
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
/* | |
Good morning! Today's daily programmer is about Array's and sorting. The | |
gist of this question came from a friends recent interview. It may be a | |
relatively familiar task. Feel free to write the solution in two | |
different ways to challenge yourself, or use a different language. | |
Please DM me with idea's for future daily problems. When you have | |
completed it post a link to your solution. *If you have a question about | |
someones solution please use a thread under their posted link.* Happy | |
Monday! | |
*/ |
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
/* | |
Today's daily programmer challenge is to print a marathon finishers | |
place in English. Your program should take an non decimal input | |
`getFinishPosition(11)` and return `11th place`, `getFinishPosition(21)` | |
and return `21st place`, `getFinishPosition(4)` and return `4th place`, | |
and `getFinishPosition(33)` and return `33rd place`. | |
Please DM me with ideas for future problems. When you have completed it | |
post a link to your solution. No need to go over 99 finishers, unless | |
you want to. |
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
function magicSquareCheck(square) { | |
checkIndices = [ | |
[0, 1, 2], | |
[3, 4, 5], | |
[6, 7, 8], | |
[0, 3, 6], | |
[1, 4, 7], | |
[2, 5, 8], | |
[0, 4, 8], | |
[2, 4, 6] |
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
let words = [ | |
'abort', 'times', 'alloy', 'taught', 'arrow', 'know', 'below', 'onscreen', | |
'berry', 'idea', 'cello', 'spoonfeed', 'asked', 'deist', 'worlds', 'feint', | |
'best', 'floss', 'suggest', 'hilly', 'hippy' | |
]; | |
function alphabeticalWord(word) { | |
let letters = word.split('').sort().join(''); | |
// return (word == letters) ? true : false; | |
// Simplifing the return statement after feedback from Brian McElaney |
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
/* | |
Download the data file from: | |
https://github.com/aisflat439/dailyProgrammer/blob/master/data/realEstate.csv | |
0 street | |
1 city | |
2 zip | |
3 state | |
4 beds | |
5 baths |
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
/* | |
There are N+1 parking spots, numbered from 0 to N. There are N cars numbered | |
from 1 to N parked in various parking spots with one left empty. Reorder the | |
cars so that car #1 is in spot #1, car #2 is in spot #2 and so on. Spot #0 will | |
remain empty. The only allowed operation is to take a car and move it to the | |
free spot. | |
*/ | |
function initParking(size) { | |
let parking = (new Array(size)).fill(null); |
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
/* | |
Calculate the Hamming Distance between 2 DNA strands. | |
*/ | |
const dna1 = "GAGCCTACTAACGGGAT"; | |
const dna2 = "CATCGTAATGACGGCCT"; | |
function hammingDistance1(strand1, strand2) { | |
let count = 0; | |
if (strand1 && strand2) { | |
if (strand1.length == strand2.length) { |
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
/* | |
Write a function that counts the number of iterations in Kaprekar's Routine, | |
which is as follows. | |
Given a 4-digit number that has at least two different digits, take that | |
number's descending digits, and subtract that number's ascending digits. For | |
example, given 6589, you should take 9865 - 5689, which is 4176. Repeat this | |
process with 4176 and you'll get 7641 - 1467, which is 6174. | |
Once you get to 6174 you'll stay there if you repeat the process. In this case | |
we applied the process 2 times before reaching 6174, so our output for 6589 is | |
2. |
OlderNewer