Skip to content

Instantly share code, notes, and snippets.

Jude Rosario JudeRosario

Block or report user

Report or block JudeRosario

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JudeRosario
JudeRosario / image-sizes.php
Created Sep 13, 2019
Custom code for image-sizes myotspot
View image-sizes.php
add_image_size( 'home-thumbnail', 374, 211 );
function pexeto_get_recent_posts_column_layout_html($recent_posts, $columns, $show_content = true, $thumb_height = null){
$html='';
$img_size = pexeto_get_image_size_options($columns, 'blog');
if($thumb_height!==null){
$img_size['height'] = $thumb_height;
}
View gist:55be77820e7c427ef89ee9a91217b1f8
alter table wp_ZxXPA_options change option_name option_name VARBINARY(64);
alter table wp_ZxXPA_options change option_name option_name VARCHAR(64) character set utf8mb4 not null default '';
alter table wp_ZxXPA_options change option_value option_value LONGBLOB;
alter table wp_ZxXPA_options change option_value option_value LONGTEXT character set utf8mb4 not null;
alter table wp_ZxXPA_options change autoload autoload VARBINARY(20);
alter table wp_ZxXPA_options change autoload autoload VARCHAR(20) character set utf8mb4 not null default 'yes';
alter table wp_ZxXPA_options character set utf8mb4 COLLATE utf8mb4_unicode_ci;
@JudeRosario
JudeRosario / custom.js
Last active Aug 19, 2019
Private - Custom code for Healthjobs.ch
View custom.js
jQuery(document).ready(function($){
if (window.location.href.indexOf("unternehmens-profil") > -1) {
$('.upme-fire-editor-view').trigger('click');
$('.upme-profile-edit-bar').hide();
$('.gt3-page-title.gt3-page-title__dashboard').hide();
$('#billing_email-1, #billing_email-2-1').on('blur', function(){
if($.trim($('#billing_email-1').val()) !== $.trim($('#billing_email-2-1').val())) {
$('#billing_email-1, #billing_email-2-1').addClass('error');
$('#billing_email-1').after('<div id="upme-match-email-msg" class="upme-input-text-inline-error" ><i id="upme-reg-email-img" original-title="Invalid" class="upme-icon upme-icon-remove upme-input-text-font-cancel" ></i>' + 'Email addresses should match' + '</div>');
@JudeRosario
JudeRosario / custom-fixes.php
Created Jun 22, 2019
Product Data Tabs Fix
View custom-fixes.php
/**
* Remove broken product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
@JudeRosario
JudeRosario / gist.js
Created Jun 4, 2019
Private jQuery W3 Tag fixes
View gist.js
jQuery(document).ready(function($){
$.fn.renameTag = function(replaceWithTag){
this.each(function(){
var outerHtml = this.outerHTML;
var tagName = $(this).prop("tagName");
var regexStart = new RegExp("^<"+tagName,"i");
var regexEnd = new RegExp("</"+tagName+">$","i")
outerHtml = outerHtml.replace(regexStart,"<"+replaceWithTag)
outerHtml = outerHtml.replace(regexEnd,"</"+replaceWithTag+">");
$(this).replaceWith(outerHtml);
View keyy-custom.css
.keyy-login-wrapper .keyy-switch-label,
form#loginform {
border-color: #E91E63;
}
.keyy-wave rect.anim {
fill:#E91E63;
}
img.keyy-login-logo {
@JudeRosario
JudeRosario / keyy-woo-emails.php
Last active Mar 5, 2019
Send Keyy code on Woo signups
View keyy-woo-emails.php
<?php
add_action('user_register', 'keyy_auto_send_qr_on_signup', 10, 1);
function keyy_auto_send_qr_on_signup($user) {
$keyy = Keyy_Login_Plugin_Premium();
$user_obj = get_user_by('id', $user);
$keyy->user_send_connection_code($user_obj, 30);
}
@JudeRosario
JudeRosario / jetpack.php
Last active Jun 18, 2018
Jetpack + Keyy
View jetpack.php
<?php
/*
Plugin Name: Keyy compat fix for Jetpack
*/
add_action('plugins_loaded', 'keyy_compat');
function keyy_compat() {
if ( is_multisite() && ! is_main_site() ) {
switch_to_blog( $this->get_main_blog_id() );
View sample.php
class PRELOAD_FULLPAGE_CACHE
{
function __construct() {
add_action( 'wp_insert_post', array( $this, 'preload_desktop' ), 900, 3 ); // let's fetch the post very late
add_action( 'wp_insert_post', array( $this, 'preload_mobile' ), 990, 3 ); // let's fetch mobile version even later
add_action( 'wp_insert_post', array( $this, 'preload_amp' ), 999, 3 ); // let's fetch AMP version at last; only works on posts
}
// verison to fetch: desktop
// user-agent: Chrome 62 on a macOS Sierra 10.12.6
You can’t perform that action at this time.