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
let $clones = {}; | |
$(document).ready(function(){ | |
$(document).on('click', 'input[type="file"]', function($e){ | |
if($(this).val() != ''){ | |
$clones[$e.target.id] = $(this).clone(); | |
} | |
}); | |
$(document).on('change', 'input[type="file"]', function($e){ | |
if($(this).val() == ""){ | |
$clones[$e.target.id].insertBefore($(this)); |
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
# Do NOT run this script if you have existing files and folders! | |
# This is ONLY for new users or fresh macOS installs! | |
# Replace username with your username | |
# Use "\" to escape spaces in usernames | |
rm -rf /Users/username/Documents && | |
rm -rf /Users/username/Downloads && | |
rm -rf /Users/username/Pictures/ && | |
rm -rf /Users/username/Movies && | |
rm -rf /Users/username/Music && |
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 | |
// Add wp_ajax_ and wp_ajax_nopriv_ actions | |
add_action('wp_ajax_locations', 'wp_ajax_get_locations'); | |
add_action('wp_ajax_nopriv_locations', 'wp_ajax_get_locations'); | |
// Get locations function | |
function wp_ajax_get_locations(){ | |
// Latitude and longitude (defaults to Dayton, Ohio) | |
$lat = isset($_POST['lat']) ? $_POST['lat'] : 39.758949; |
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 | |
/********* | |
********* | |
Minify | |
********* | |
*********/ | |
class WP_Minify{ | |
protected $compress_css = true; | |
protected $compress_js = false; |
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
## | |
# Gzip Settings | |
## | |
gzip on; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_http_version 1.1; | |
gzip_disable "msie6"; | |
gzip_static always; |
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 | |
if(isMENA()){ | |
echo '<img src="/images/mena-image.png" alt="MENA Image" />'; | |
} else { | |
echo '<img src="/images/other-image.png" alt="Other Image" />'; | |
} |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> | |
<IfModule mod_deflate.c> |
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 IS OUT OF DATE, PLEASE FIND ANOTHER GIST OR TUTORIAL. | |
# Update Ubuntu and Packages | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get upgrade -y | |
# Install NGINX |