This section explains that for simple key value pairs we can use a hash to get more memory efficiency. As an example, using the same approach mentioned in the redis topic in the link above, say we have 2,000 key value objects:
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
server { | |
listen 8080; | |
server_name localhost; | |
location / { | |
root /var/www/local.com; | |
index index.html index.htm; | |
} | |
location /api { |
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
.element { | |
-webkit-user-select: none; | |
-moz-user-select: -moz-none; | |
/*IE10*/ | |
-ms-user-select: none; | |
user-select: none; | |
/*You just need this if you are only concerned with android and not desktop browsers.*/ | |
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | |
} |
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
echo "Adding nginx deb and deb-src packages to /etc/apt/sources.list" | |
echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "Downloading nginx_signing.key..." | |
curl -Os https://nginx.org/keys/nginx_signing.key | |
echo "Adding it to the apt program keyring" | |
apt-key add ./nginx_signing.key | |
echo "Installing nginx..." |
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
echo "Adding nginx deb and deb-src packages to /etc/apt/sources.list" | |
echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "Downloading nginx_signing.key..." | |
curl -Os https://nginx.org/keys/nginx_signing.key | |
echo "Adding it to the apt program keyring" | |
apt-key add ./nginx_signing.key | |
echo "Adding postgresql deb packages..." |
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
myPromise.then(function() { | |
// Some error may happen | |
throw('An exception that would be caught'); | |
}).catch(function() { | |
console.log('error'); | |
}); | |
// Is the same as this, the errHandle tries to catch any unhandled error | |
// from previous result. | |
myPromise.then(func, null).then(null, errHandle); |
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
echo "Adding nginx deb and deb-src packages to /etc/apt/sources.list" | |
echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list | |
echo "Downloading nginx_signing.key..." | |
curl -Os https://nginx.org/keys/nginx_signing.key | |
echo "Adding it to the apt program keyring" | |
apt-key add ./nginx_signing.key | |
echo "Installing nginx..." |
You need to have cygwin and its following packages installed
- make (
Devel group -> make
) - rsync (
Net group -> rsync
) - ssh (
Net group -> openSSH
)
NOTE: You may already have ssh installed due to git shell, or other shell installation, but make sure you install the cygwin version of ssh (openSSH)
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 | |
# This script is meant to run in cygwin as a way to sync a Windows host to a Guest Vagrant Machine | |
# So you can edit your code in the host, sync changes to your vagrant machine, and let node/npm | |
# run in a local folder (no more symlink problems!) | |
# | |
# For requirements see: https://gist.github.com/AlexandroPerez/c6122b1f8648273f83b894e5c4436e6a | |
# | |
# Usage: autosync.sh user@host:/path/to/remote/folder | |
# | |
# Optional but recommended: add a .syncignore file to your folder, and add |
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
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
# NOTE: The dollar sign ($) has to be escaped so that the above function is executed every time the prompt is shown | |
# like this: \$(git_branch) | |
export PS1="\[\e]0;\w\a\]\n\[\e[36m\]CygWin:\[\e[33m\]\w\[\e[0m\] \[\e[32m\]\[\e[1m\]\$(git_branch)\[\e[0m\]\n$ " | |
# For WSL | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' |