Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
package awss3 | |
import ( | |
"context" | |
"crypto/tls" | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"path/filepath" |
#!/bin/bash | |
# Program: | |
# EC2 initially install node.js, git for development environment. | |
# You can modify nodev and nvmv for changing node and nvm version. | |
# Set permission to ec2-user install above. | |
# History: | |
# 2017/07/25 Hans First release | |
home=/home/ec2-user | |
nodev='8.11.2' | |
nvmv='0.33.11' |
#!/bin/bash | |
apt-get -y update | |
cat > /tmp/subscript.sh << EOF | |
# START UBUNTU USERSPACE | |
echo "Setting up NodeJS Environment" | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash | |
echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc | |
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc | |
# Dot source the files to ensure that variables are available within the current shell | |
. /home/ubuntu/.nvm/nvm.sh |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
As we knew that 'let & const' are not coming in ES5, those are coming in ES6 since 2015. | |
So to make these work like in latest version ECMA Scripts 2015, we can define it by ourself. | |
'const' - ES6 | |
const a = 1; | |
'const' - ES5 | |
var a = (function(){ | |
var a = 1; | |
return function(){ |
<?php | |
$fileName = $_FILES['afile']['name']; | |
$fileType = $_FILES['afile']['type']; | |
$fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
$json = json_encode(array( | |
'name' => $fileName, | |
'type' => $fileType, | |
'dataUrl' => $dataUrl, |