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 | |
/* | |
Plugin Name: Retroactive BP User Acticity | |
Plugin URI: https://gist.github.com/3953927 | |
Description: Makes all BuddyPress users visible immediately on user creation and retroactively adjust users to allow for their display before logging in. | |
Author: Aaron Brazell | |
Version: 1.0 | |
Author URI: http://technosailor.com | |
License: MIT | |
License URI: http://opensource.org/licenses/MIT |
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
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
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 | |
/** | |
* Plugin name: WP Trac #42573: Fix for theme template file caching. | |
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
* Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
* Author: Weston Ruter, XWP. | |
* Author URI: https://weston.ruter.net | |
*/ | |
function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
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_filter( 'bp_get_member_avatar', 'my_add_user_level_to_avatars', 10, 2 ); | |
/** | |
* @param string $value Formatted HTML <img> element, or raw avatar URL based on $html arg. | |
* @param array $r Array of parsed arguments. See {@link bp_get_member_avatar()}. | |
*/ | |
function my_add_user_level_to_avatars( $value, $r ) { | |
global $members_template; | |
// The args have already been parsed in bp_get_member_avatar. We'll use them except for the css class. |
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 | |
/** | |
* Authentication customizations. | |
* | |
* @package BJ\Auth | |
*/ | |
/** | |
* Filters the duration of the authentication cookie expiration period. | |
* |
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 | |
/** | |
* BuddyPress - Members Single Messages Compose | |
* | |
* @package BuddyPress | |
* @subpackage bp-legacy | |
*/ | |
?> |
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 (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
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 // phpcs:disable WordPress.Files.FileName.InvalidClassFileName | |
/* | |
* Plugin Name: Non-Handling Shutdown Handler | |
* Description: Disable WSOD protection so that plugins will not auto-suspend during development while errors often occur. | |
* Plugin URI: https://gist.github.com/westonruter/583a42392a0b8684dc268b40d44eb7f1 | |
* Plugin Author: Weston Ruter | |
*/ | |
/** |
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 | |
/** | |
* Filters wp_remote_get() to: | |
* 1. Return a value from the cache when it's available. | |
* 2. Write a value to the cache when it's been fetched. | |
* | |
* Requires the WP_IMPORT_CACHE constant to be set to a writable directory. | |
*/ | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
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
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |