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
# Install linux update, followed by GCC and Make | |
sudo yum -y update | |
sudo yum install -y gcc make | |
# Install Nginx and php56-FPM | |
sudo yum install -y nginx php56-fpm | |
# Install php56 extensions | |
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap |
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/sh | |
# IMPORTANT: Run this script as sudo or else it won't work | |
# Original script: http://my.safaribooksonline.com/book/programming/java/9781449309558/hacking-elastic-beanstalk/hackingelectric#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODE0NDkzMDk1NTgvSV9zZWN0MTRfZDFlMjAyNQ== | |
echo 'Installing nginx...sit tight' | |
yum -y install nginx | |
echo 'Fixing nginx configuration' | |
sed -i 's/ 1;/ 4;/g' /etc/nginx/nginx.conf | |
rm /etc/nginx/conf.d/default.conf |
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
version: '2' | |
services : | |
nginx: | |
image: nginx:stable-alpine | |
container_name: nginx | |
# restart: always | |
links: | |
- php | |
volumes: |
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 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
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
docker run -d -p 8082:80 --mount type=bind,source="$(pwd)",target=/var/www/html php:apache | |
// That's it! If you try this, and it works for you, you're done! | |
// The command does the following: | |
// If the Docker image php:apache is not present in your machine's local Docker registry, it will be downloaded from Docker hub. | |
// It creates a new container based on the image php:apache. | |
// It maps port 80 from the container to port 8082 on your host machine. | |
// It mounts the current directory from your host machine to /var/www/html in the container. |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
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
#!/usr/bin/env bash | |
# Caution is a virtue. | |
set -o nounset | |
set -o errtrace | |
set -o errexit | |
set -o pipefail | |
# ## Global Variables |
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
// Based in: | |
// https://codeburst.io/alternative-to-javascripts-switch-statement-with-a-functional-twist-3f572787ba1c | |
const matched = x => ({ | |
on: () => matched(x), | |
otherwise: () => x, | |
}) | |
const match = x => ({ | |
on: (pred, fn) => (pred(x) ? matched(fn(x)) : match(x)), | |
otherwise: fn => fn(x), |
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
// Using Foreach/Loop Recursive way | |
function traverseArray($array) | |
{ | |
foreach($array as $key => $value) | |
{ | |
if(is_array($value)) | |
{ | |
traverseArray($value); | |
}else{ | |
echo '[' . $key . ']' . ' => ' . $value . PHP_EOL; |
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
"use strict"; | |
//recursive | |
const possibleCombinations = n => { | |
if (n == 0) { | |
return 0; | |
} else { | |
return n + possibleCombinations(n - 1); | |
} |
OlderNewer