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://cloud.google.com/community/tutorials/nginx-reverse-proxy-docker | |
//Run the proxy, but this time declaring volumes so that the Let's Encrypt companion can populate them with certificates | |
docker run -d -p 80:80 -p 443:443 \ | |
--name nginx-proxy \ | |
-v $HOME/certs:/etc/nginx/certs:ro \ | |
-v $HOME/nginx/etc/nginx/vhost.d:/etc/nginx/vhost.d \ | |
-v $HOME/nginx/usr/share/nginx/html:/usr/share/nginx/html \ | |
-v /var/run/docker.sock:/tmp/docker.sock:ro \ | |
--restart=always \ | |
--net reverse-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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>PATH</key> | |
<string>/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/[email protected]/bin/mysql:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/admin/go/bin</string> | |
</dict> | |
<key>Label</key> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- Launch Daemon do not always have access to all the path variables | |
As a results, scripts will sometimes fail if the you are using path variables inside them | |
To enable the script to have access to all path variables, open up a terminal and type in --> | |
<!-- echo $PATH --> | |
<!-- You can opt to filter out some of the path variables which are not required by script--> | |
<key>EnvironmentVariables</key> |
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 Auto Evaluate Machine | |
VM_STATUS="$(docker-machine status default 2>&1)" | |
if [ "${VM_STATUS}" == "Running" ]; then | |
eval "$(docker-machine env --shell=bash default)" | |
fi |
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
<?php | |
// chdir to the correct directory before calling the script | |
//Ref: https://stackoverflow.com/questions/11052162/run-bash-command-from-php#answer-11052453 | |
$old_path = getcwd(); | |
chdir('/path/to/file'); | |
//make sure to make the shell file executeable first before running the shell_exec function | |
$output = shell_exec('./shell-script.sh'); | |
chdir($old_path); | |
echo $output; |
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://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery#answer-3540295 | |
function isMobileUserAgent(){ | |
var isMobile = false; //initiate as false | |
// device detection | |
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
isMobile = true; | |
} | |
return isMobile; | |
} |
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
//Check up or down scrolls | |
function isScrollTopOrDown(){ | |
var lastScrollTop = 0, delta = 5; | |
$(window).scroll(function(){ | |
var nowScrollTop = $(this).scrollTop(); | |
if(Math.abs(lastScrollTop - nowScrollTop) >= delta){ | |
if (nowScrollTop > lastScrollTop){ | |
if(debug){ | |
// console.log('Scrolling Down'); |