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
const startedTime = '14:30'; | |
const completedTime = '01:15'; | |
const startedDate = '20/01/2019'; | |
if (completedTime < startedTime) { | |
const [day, month, year] = startedDate.split('/'); | |
const currentDate = new Date(Date.parse(`${year}-${month}-${day}`)); | |
const currentDateUnix = currentDate.valueOf(); | |
const newDateUnix = currentDateUnix + 24*60*60*1000; |
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
function findParentTagId(childClass, parentTag) { | |
var element = document.querySelector(childClass); | |
var tag = element.tagName; | |
// repeat until you get to body | |
while (tag != 'body') { | |
element = element.parentElement; | |
if (element.tagName.toLowerCase() === parentTag.toLowerCase()) { | |
var dataset = element.dataset['id']; | |
return document.querySelector('[data-id="' + dataset + '"]'); |
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
http://example.com/wp-login.php?action=logout |
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
for i in `seq 10`; do openssl rand -base64 16 | colrm 17; done |
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
rsync -avP user@server:/home/servername/website/web/wp-content/uploads/ /Users/yaymark/projects/website/web/wp-content/uploads |
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
UPDATE `wp_users` SET `user_pass`= MD5('tzFuO7YR1ElE85lu3Xmt') WHERE `user_login`='iamtheadminbowbeforeme'; |
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 | |
$template = get_page_template_slug(); | |
$args = array( | |
'post_type' => 'page', | |
'meta_query' => array( | |
array( | |
'key' => '_wp_page_template', | |
'value' => $template | |
) | |
) |
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
// Callback function to remove default bio field from user profile page | |
// https://gist.github.com/dkomando/6214787a8d36d9f13c9b | |
if(!function_exists('remove_bio_box')){ | |
function remove_bio_box($buffer){ | |
$buffer = preg_replace('/<tr class=\"user-description-wrap\"[\s\S]*?<\/tr>/','',$buffer,1); | |
return $buffer; | |
} | |
function user_profile_subject_start(){ ob_start('remove_bio_box'); } | |
function user_profile_subject_end(){ ob_end_flush(); } |
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 | |
function post_type_no_editor() { | |
$post_type = 'insert_post_type_here'; | |
remove_post_type_support($post_type, 'editor'); | |
} | |
add_action('init', 'post_type_no_editor', 100); |
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
(function ($) { | |
$.fn.outline = function(options) { | |
var settings = $.extend({ | |
borderWidth: "1px", | |
borderStyle: "solid", | |
borderColor: "red" | |
}, options); | |
return this.css({ | |
borderWidth: settings.borderWidth, |