$ cd ~/.virtualenvs
$ virtualenv <projectname>
Using base prefix '/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/melvinlee/.virtualenvs/lambda-digitalgift/bin/python3.6
Also creating executable in /Users/melvinlee/.virtualenvs/lambda-digitalgift/bin/python
Installing setuptools, pip, wheel...done.
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
FROM microsoft/dotnet:2.1-sdk | |
# warmup NuGet package cache | |
COPY packagescache.csproj /tmp/warmup/ | |
RUN dotnet restore /tmp/warmup/packagescache.csproj \ | |
--source https://api.nuget.org/v3/index.json \ | |
--verbosity quiet \ | |
&& rm -rf /tmp/warmup/ | |
WORKDIR / |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
# Install add-on software | |
choco install docker-for-windows -y | |
choco install visualstudio2017community -y | |
choco install dotnetcore-sdk -y | |
# Enable HyperV for Docker | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All | |
# Restart | |
Restart-Computer |
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
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list | |
deb http://apt.kubernetes.io/ kubernetes-xenial main | |
EOF | |
apt-get update | |
apt-get install -y docker.io kubelet kubeadm kubectl | |
systemctl enable docker |
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
[user] | |
name = my name | |
email = [email protected] | |
[core] | |
editor = vi | |
[alias] | |
aa = add --all | |
bv = branch -vv | |
ba = branch -ra | |
bd = branch -d |
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
def findLongestEventWord(sentense): | |
words = sentense.split() | |
event_words = [x for x in words if len(x) % 2 == 0] | |
return sorted(event_words, key=len, reverse=True)[0] | |
print(findLongestEventWord("The code is self explanatory") == 'code') | |
print(findLongestEventWord("Once created , you can click on Test and send a JSON as below") == 'Once') |
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
module.exports.delegate = function(sessionAttributes, slots) { | |
return { | |
sessionAttributes, | |
dialogAction: { | |
type: 'Delegate', | |
slots | |
} | |
}; | |
}; |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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 container ls | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
7fe71e1c7bdd redis "docker-entrypoint.s…" 9 seconds ago Up 21 seconds 6379/tcp unruffled_khorana | |
ad8a33ce3b2b nginx "nginx -g 'daemon of…" 14 minutes ago Up 14 minutes 80/tcp vigorous_meninsky | |
$docker exec -it 7fe /bin/bash | |
or | |
$docker exec -it $(docker ps | awk 'FNR == 2 { print $1; }') /bin/bash |
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'; | |
var fs = require('fs'); | |
exports.get = function(event, context) { | |
let contents = fs.readFileSync("public/index.html"); | |
context.succeed({ | |
statusCode: 200, | |
body: contents.toString(), | |
headers: {'Content-Type': 'text/html'} | |
}); |