Skip to content

Instantly share code, notes, and snippets.

add_action( 'update_option', function( $option, $old_value, $value ) {
if ( 'cron' !== $option ) {
return;
}
$json_old = wp_json_encode( $old_value );
$json_new = wp_json_encode( $value );
$old_contains = strpos( $json_old, 'boldgrid_backup_wp_cron_run_jobs' ) !== false;
$new_contains = strpos( $json_new, 'boldgrid_backup_wp_cron_run_jobs' ) !== false;
add_filter( 'pre_clear_scheduled_hook', function( $null, $hook, $args, $wp_error ) {
$core = apply_filters( 'boldgrid_backup_get_core', false );
$logger = new Boldgrid_Backup_Admin_Log( $core );
$logger->init( 'pre_clear_scheduled_hook.log' );
// We want to include the trace to see what is clearing the schedule.
$e = new \Exception();
$e = explode( "\n", $e->getTraceAsString() );
const double TAX_RATE_IN_TEXAS = 1.08;
total = TAX_RATE_IN_TEXAS * price;
constant int deckSize := 52
for i from 1 to deckSize
j := i + randomInt(deckSize + 1 - i) - 1
a.swapEntries(i, j)
for i from 1 to 52
j := i + randomInt(53 - i) - 1
a.swapEntries(i, j)
public class Foo {
public static final int MAX_PASSWORD_SIZE = 7;
public void setPassword(String password) {
if (password.length() > MAX_PASSWORD_SIZE) {
throw new InvalidArgumentException("password");
}
}
}
public class Foo {
public void setPassword(String password) {
if (password.length() > 7) {
throw new InvalidArgumentException("password");
}
}
}
Add this:
```php
wp_insert_user( array(
'user_email' => $userinfo->email,
'first_name' => $userinfo->givenName,
'last_name' => $userinfo->familyName,
'role' => 'author',
'user_pass' => md5( $userinfo->email . time() ),
'user_login' => explode( '@', $userinfo->email )[0],
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "2.8.31",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "64fa4b07f056e338a5f0f29eece75babaa83af68"
},
"dist": {