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 arr = [1,[6,7],3,[1,2,3,4, [2,3,4]]]; | |
function unfoldArray(arr) { | |
let arrNew = []; | |
for (let i = 0; i < arr.length; i++) { | |
if (arr[i].length === undefined) { | |
arrNew.push(arr[i]); | |
} else { | |
arrNew = arrNew.concat(unfoldArray(arr[i])); |
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
Vagrant.configure(2) do |config| | |
config.ssh.insert_key = false | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024"] | |
end | |
config.vm.define "dns" do |dns| | |
dns.vm.box = "ubuntu/trusty64" | |
dns.vm.network :private_network, ip: "10.12.10.5" | |
end |
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
## Default config for each machine | |
Vagrant.configure(2) do |config| | |
config.ssh.insert_key = false | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024"] | |
end | |
## Per machine config | |
config.vm.define "haproxy1" do |haproxy1| | |
haproxy1.vm.hostname = "lb01.example.com" |
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 | |
set -e | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <namespace>" | |
echo "For example: $0 dev" | |
exit 1 | |
else | |
NAMESPACE=$1 | |
fi |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"S3JarBucket": { | |
"Description": "The name of the S3 bucket that contains the source code of Lambda function.", | |
"Type": "String" | |
}, | |
"Namespace": { | |
"Description": "The environment name (dev)", | |
"Type": "String", |
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
</exec> | |
<echo message="Installing composer..." /> | |
<exec dir="${dir}" executable="php" description="Installing composer." failonerror="true"> | |
<arg value="composer.phar" /> | |
<arg value="install" /> | |
</exec> |