This file contains hidden or 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
var onemgConsultationWidget = { // eslint-disable-line no-unused-vars | |
init: function (parameters) { | |
function isMobile() { | |
try { | |
if(/Android|webOS|iPhone|iPad|iPod|pocket|psp|kindle|avantgo|blazer|midori|Tablet|Palm|maemo|plucker|phone|BlackBerry|symbian|IEMobile|mobile|ZuneWP7|Windows Phone|Opera Mini/i.test(navigator.userAgent)) { | |
return true; | |
}; | |
return false; | |
} catch(e) { return false; } | |
} |
This file contains hidden or 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 | |
OLDIFS=$IFS | |
IFS=$'\n' | |
for FILE in $(find public -type f -iname '*.css' -o -iname '*.js' -o -iname '*.svg' -o -iname '*.json'); do | |
echo -n "Compressing ${FILE}..." | |
brotli --input ${FILE} --force --output ${FILE}.br; | |
echo "done." | |
done | |
IFS=$OLDIFS |
This file contains hidden or 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 nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
This file contains hidden or 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 nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="mycss1.css"> | |
<script src="myjs1.js"></script> | |
<!-- you can include many js, css here --> | |
</head> | |
<body> | |
<h1>gzip vs brotli</h1> | |
</body> |
This file contains hidden or 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
version: '3' | |
services: | |
nginx_gzip: | |
image: fholzer/nginx-brotli | |
container_name: nginx-gzip | |
ports: | |
- '8080:80' | |
volumes: | |
- '~/nginx_brotli_demo/nginx_gzip_conf/nginx.conf:/etc/nginx/nginx.conf:ro' | |
- '~/nginx_brotli_demo/html_static_files:/usr/share/nginx/html:ro' |
This file contains hidden or 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 file contains hidden or 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
document.canvasSequence = function (options) { | |
var _fontColor = options.fontColor ? options.fontColor : "#ffffff"; | |
var _fontFamily = options.fontFamily ? options.fontFamily : "Arial,Helvetica,sans-serif"; | |
var _fontSize = options.fontSize ? options.fontSize : 30; | |
var _fontWeight = options.fontWeight ? options.fontWeight : "200"; | |
var wrapCanvasText = function(t, canvas, maxW, maxH) { | |
if (typeof maxH === "undefined") { | |
maxH = 0; |
This file contains hidden or 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
# package for generating .htpasswd file | |
sudo apt-get install apache2-utils | |
# create .htpasswd file | |
sudo htpasswd -c /etc/nginx/.htpasswd username (this will prompt you for password) | |
# add following 2 line in nginx config (/etc/nginx/sites-available/test.com) | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/.htpasswd; |
This file contains hidden or 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
Fork the repo and clone | |
1. List the current configured remote repository for your fork: git remote -v | |
2. Specify a new remote upstream repository that will be synced with the fork: git remote add upstream [email protected]:[ORIGINAL_OWNER]/[REPO_NAME].git | |
3. Verify the new upstream repository you haveve specified for your fork: git remote -v | |
# origin [email protected]/YOUR_USERNAME/REPO_NAME.git (fetch) | |
# origin [email protected]/YOUR_USERNAME/REPO_NAME.git (push) | |
# upstream [email protected]/ORIGINAL_OWNER/REPO_NAME.git (fetch) | |
# upstream [email protected]/ORIGINAL_OWNER/REPO_NAME.git (push) | |
Syncing a fork |
NewerOlder