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 | |
if ( !class_exists('Primped_Base_Singleton') ): | |
abstract class Primped_Base_Singleton { | |
/** | |
* Parsed options for module | |
* | |
* @var array |
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
(function($) { | |
if ($.fn.style) { | |
return; | |
} | |
// Escape regex chars with \ | |
var escape = function(text) { | |
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | |
}; |
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
//Usage | |
try { | |
$(window).on('load', function() { | |
equalize_height($('#parent'), '.element'); | |
}); | |
$(window).resize(function(){ | |
equalize_height($('#parent'), '.element'); | |
}); | |
} catch(err) {console.log(err);} |
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
function addHourTo(start, duration) { | |
start = start.split(':'); | |
duration = duration.split(':'); | |
totalHours = parseInt(start[0], 10) + parseInt(duration[0], 10); | |
totalMinutes = parseInt(start[1], 10) + parseInt(duration[1], 10); | |
if (totalMinutes >= 60) { | |
totalMinutes -= 60; | |
totalHours += 1; |
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
functions.php | |
<?php | |
function my_custom_queries($query) { | |
//Never in admin mode, only the main query(the URL one) and in this case on custom post 'event' | |
if ( !is_admin() && $query->is_main_query() && $query->is_post_type_archive('event')) { | |
$paged = ( get_query_var( 'page' ) ) ? absint( get_query_var( 'page' ) ) : 1; //URL /page | |
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
$( "#sortable" ).sortable({ | |
forcePlaceholderSize: true, | |
tolerance: 'pointer', | |
cursor: 'pointer', | |
over: function () { | |
removeIntent = false; | |
}, | |
out: function () { | |
removeIntent = true; | |
}, |
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
## /private/etc/hosts | |
# | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
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 | |
$datetime = '01/06/1985 15:45'; | |
$timestamp = DateTime::createFromFormat('d/m/Y H:i', $datetime)->getTimestamp(); | |
echo $timestamp; | |
$datetime = date('d-m-Y H:i', $timestamp); | |
var_dump($datetime); |
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
<?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>BackgroundAlphaInactive</key> | |
<real>0.73665552745664742</real> | |
<key>BackgroundBlur</key> | |
<real>0.091763005780346824</real> | |
<key>BackgroundColor</key> | |
<data> |
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
function codeAddress(address) { | |
geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({ | |
'address': address | |
}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
var myOptions = { | |
zoom: 14, | |
center: results[0].geometry.location, | |
disableDoubleClickZoom: true, //not zoom |