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
https://stackoverflow.com/questions/7772825/how-to-get-length-of-a-vimeo-video | |
echo vimeoVideoDuration('https://vimeo.com/115134273'); | |
// output: 63 (video duration in seconds) | |
/** | |
* Vimeo video duration in seconds | |
* | |
* @param $video_url | |
* @return integer|null Duration in seconds or null on error |
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
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* | |
* Replace Disallow with Allow Generated Robots.txt | |
* Credit: Unknown | |
* Last Tested: Unknown | |
*/ | |
add_filter('robots_txt','custom_robots'); |
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
$(window).on("beforeunload", function() { | |
return confirm("Do you really want to close?"); | |
}) | |
let formChanged = false; | |
myForm.addEventListener('change', () => formChanged = true); | |
window.addEventListener('beforeunload', (event) => { | |
if (formChanged) { | |
event.returnValue = 'You have unfinished changes!'; |
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
(is_page() && !is_page_template()) |
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
mysql -u root -proot -f local < /app/backup.sql | |
wp search-replace 'http://yoursite.com' 'http://yourlocalsite.local' |
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
/** | |
* Add a widget to the dashboard. | |
* | |
* This function is hooked into the 'wp_dashboard_setup' action below. | |
*/ | |
function dewploy_add_dashboard_widgets() { | |
// Add function here | |
wp_add_dashboard_widget( | |
'dewploy_dashboard_widget', // Widget slug. | |
esc_html__( 'Holiday Sitters Widget', 'dewploy' ), // Title. |
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
While others have correctly suggested the use of array_multisort(), | |
for some reason no answer seems to acknowledge the existence of array_column(), | |
which can greatly simplify the solution. So my suggestion would be: | |
array_multisort(array_column($inventory, 'price'), SORT_DESC, $inventory); |
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
?php | |
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ | |
/*:: :*/ | |
/*:: This routine calculates the distance between two points (given the :*/ | |
/*:: latitude/longitude of those points). It is being used to calculate :*/ | |
/*:: the distance between two locations using GeoDataSource(TM) Products :*/ | |
/*:: :*/ | |
/*:: Definitions: :*/ | |
/*:: South latitudes are negative, east longitudes are positive :*/ |
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
Thanks! That’s very helpful. | |
Based on the output, Apache appears to be running. Heads-up, if you’re using it for another project, the commands below will temporarily stop Apache. | |
Can you try the following? | |
Try running sudo service apache2 stop. If it results in an error, you may need to find a different stop command for Apache from this blog post: http://www.learn4master.com/programming-language/shell/start-restart-and-stop-apache-on-linux | |
Run netstat -ltnp | grep -w ':80' again after a few seconds and see if Apache stops listening on port 80. |
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 markers = []; | |
var markersListeners = []; | |
var LatLngList=[]; | |
var infowindow = new google.maps.InfoWindow(); | |
var marker, i; | |
var locations = $.parseJSON(data); | |
var bounds = new google.maps.LatLngBounds(); | |
var initial_coordinates = {lat: locations[0]['lat'], lng: locations[0]['lng']}; | |
var map = new google.maps.Map(document.getElementById('small_map_directions'), { |