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
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
View gist:4da1a4460caf27024724c5250413c4b3
<?php
class Staged_Sleep_Task extends Updraft_Task_1_0 {
public function initialise() {
$sleep_for = $this->get_random_time_intervals();
$this->update_option('sleep_for', $sleep_for);
}
public function run() {
View gist:14a6eefedf7e78a6bc176c8ea7d42012
$trie = new Trie();
$start = microtime(true);
for ( $i = 0 ; $i < 20000000 ; $i++ ) {
$sid = bin2hex(openssl_random_pseudo_bytes(8));
$collision = $trie->search($sid) ;
if ( is_null($collision) ) {
$trie->add($sid, 1);
} else {
echo "\n" ."Collision with previous Hash" ."\n" ;
}
View gist:c87a3a982b0cdaa2baa8c58330950d20
<?php
$j = 0;
$start = microtime(true);
for ( $i = 0 ; $i < PHP_INT_MAX ; $i++ ) {
$j++;
}
echo $j . "\n" ;
$time_elapsed_secs = microtime(true) - $start;
View gist:2f221a7d978da282dc2a1a833753ad22
19:27:39.793 TypeError: 'insertCell' called on an object that does not implement interface HTMLTableRowElement.
Stack trace:
e@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24986
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24871
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24894
dc/<@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24782
each@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:2:2879
dc@https://updraftplus.com/wp-includes/js/jquery/jquery.js?ver=1.12.4:4:24738
View gist:a31463e2350504472b7cb593ba9cdc3b
add_action( 'wp_footer', function() {
if( 'membership_signup' == $_POST['action'] )
{
$membership_id = $_POST['membership_id'];
$membership = MS_Factory::load( 'MS_Model_Membership', intval( $membership_id ) );
$prefix = str_replace( ' ', '_', strtolower( $membership->name ) ) . '_';
$username = $prefix . rand( 1000 , 9999 );
?>
<script type="text/javascript">
@JudeRosario
JudeRosario / 1-instructions.txt
Created Dec 7, 2016 — forked from bappi-d-great/1-instructions.txt
Add custom field in M2 registration form (Basic) WPMU Membership2
View 1-instructions.txt
### We are adding telephone number as custom field
1. Go to /wp-content/plugins/membership/app/view/templates/ and copy all 4 files.
2. Go to /wp-content/themes/YOUR_CURRENT_THEME/ and create a new folder called membership2, then paste all 4 files inside the new created membership2 folder
3. Open membership_registration_form.php and put the following: membership_registration_form.php
4. Now open the membership_account.php file and put the following: membership_account.php
5. Finally need to add some code: mu-plugin.php
## You can add those codes in your functions.php in the theme,
## if you think your theme won’t be changed. Otherwise mu-plugins is the best solution.
You can’t perform that action at this time.