New solution | Old solution | |
---|---|---|
Cached | 30ms - 250ms | 60ms - 1s |
Not cached | 250ms - 1.4s | 700ms - 6s |
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
const response = event.Records[0].cf.response; | |
// ... | |
Sharp(imageBuffer, { | |
sequentialRead: true, | |
limitInputPixels: 2684026890, // raise default limit to 10x | |
}) | |
.resize({ | |
width: width, |
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 | |
# Latest versions of each package. | |
export NGINX_VERSION=1.11.12 | |
export VERSION_NGINX=nginx-$NGINX_VERSION | |
export VERSION_PCRE=pcre-8.40 | |
export VERSION_ZLIB=zlib-1.2.11 | |
export VERSION_OPENSSL=openssl-1.1.0e | |
#export VERSION_LIBRESSL=libressl-2.5.1 | |
export HMORE_VERSION=0.32 |
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
export LANGUAGE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LC_TYPE=en_US.UTF-8 |
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
# This script aims to fix errors similar to below: | |
# | |
# /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file ... | |
# from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require' | |
# | |
# The error is commonly stumbled upon in Mac OS X El Capitan. | |
# fix access permission issue with the new Mac's SIP process | |
sudo chown -R $(whoami):admin /usr/local |
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
- Create a temporary branch, switch to it | |
- Edit multiple files, commit each file separately | |
- Make pull request | |
- Merge pull request and delete temporary branch |
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
https://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally |
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
# read in username and password for system http(s) proxy settings | |
read -s -p "Username: " USERNAME; echo '' | |
read -s -p "Password: " PASSWORD; echo '' | |
read -s -p "HTTP(S) Proxy (host:port): " HTTP_PROXY_HOST_PORT; echo '' | |
export {http_proxy,https_proxy}="http://$USERNAME:$PASSWORD@$HTTP_PROXY_HOST_PORT" | |
# update http(s) proxy settings for git | |
git config --global http.proxy $http_proxy | |
git config --global https.proxy $https_proxy |
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
(defun get-ip-address (&optional dev) | |
"Get the IP-address for device DEV (default: eth0) of the current machine." | |
(let ((dev (if dev dev "eth0"))) | |
(format-network-address (car (network-interface-info dev)) t))) |
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
http://backreference.org/2013/05/22/send-email-with-attachments-from-script-or-command-line/ |
NewerOlder