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
alias ll='ls -alF' | |
alias ls="ls --color -l -h" # add colors to ls | |
alias grep="grep -n --color" # add line numbers to grep | |
alias rnm="rm -rf node_modules" # remove node_modules | |
alias nlg="npm list -g --depth 0" #list global packages installed | |
alias vc="code" | |
alias vco="code ." # open current directory in vscode | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias c='clear' |
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_action( 'wp_ajax_ajaxcomments', 'ugwps_submit_ajax_comment' ); // wp_ajax_{action} for registered user | |
add_action( 'wp_ajax_nopriv_ajaxcomments', 'ugwps_submit_ajax_comment' ); // wp_ajax_nopriv_{action} for not registered users | |
function ugwps_submit_ajax_comment(){ | |
$comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); | |
if ( is_wp_error( $comment ) ) { | |
$error_data = intval( $comment->get_error_data() ); | |
if ( ! empty( $error_data ) ) { | |
wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $error_data, 'back_link' => true ) ); |
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 isMobileOrTablet = () => { | |
let check = false; | |
(function (a) { | |
if ( | |
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test( | |
a | |
) || | |
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i23 |
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
abusaidm.html-snippets | |
akamud.vscode-theme-onedark | |
alefragnani.Bookmarks | |
alefragnani.project-manager | |
Angular.ng-template | |
anseki.vscode-color | |
anthonydiametrix.ACF-Snippet | |
burkeholland.simple-react-snippets | |
buzatto.ionic-basic-pack | |
christian-kohler.npm-intellisense |
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://forum.webflow.com/t/overflow-hidden-round-corners-not-working-on-safari/67805 | |
The issue is the combination of overflow, border-radius, and transition | |
This is the solution: | |
On the element with overflow: | |
.transitionfix() { | |
-webkit-backface-visibility: hidden; | |
-moz-backface-visibility: hidden; |
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 matchCase(text, pattern, tag = '') { | |
var result = ''; | |
for(var i = 0; i < text.length; i++) { | |
var c = text.charAt(i); | |
var p = pattern.charCodeAt(i); | |
if(p >= 65 && p < 65 + 26) { | |
result += c.toUpperCase(); | |
} else { |
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
// send req after a few seconds have passed since user last wrote in the editor | |
export default function debounce(a,b,c){ | |
let d,e; | |
return function(){ | |
function h(){ | |
d=null; | |
c||(e=a.apply(f,g)); | |
} | |
let f=this,g=arguments; | |
return (clearTimeout(d),d=setTimeout(h,b),c&&!d&&(e=a.apply(f,g)),e) |
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
/** | |
* @param {event} evt = e (from the element) | |
* @param {bool} isZIP=false | |
* @returns {bool} | |
*/ | |
const validateNumberHelper = (evt, isZIP = false) => { | |
var theEvent = evt || window.event; | |
// Handle paste | |
if (theEvent.type === "paste") { |
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 ping_app_fetch_counts(WP_REST_Request $request) | |
{ | |
if (is_request_not_from_the_same_domain()) { | |
wp_send_json_error( "Not authorized", 401 ); | |
return false; | |
} | |
$ping_env_id = get_option('wrwps_ping_env_id'); | |
$base_endpoint = 'https://api.pingone.com/v1/environments/' . $ping_env_id . '/'; | |
$token = get_jwt_token_string(); |
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
// removes ACF data upon field deletion | |
// this action is run by ACF whenever a field is deleted | |
// and is called for every field in a field group when a field group is deleted | |
add_action('acf/delete_field', 'delete_acf_content_on_delete_field'); | |
function delete_acf_content_on_delete_field($field) { | |
// runs when acf deletes a field | |
// find all occurences of the field key in all tables and delete them | |
// and the custom field associated with them | |
global $wpdb; |
NewerOlder