Skip to content

Instantly share code, notes, and snippets.

@kaelri
kaelri / wordpress-smtp.php
Created June 29, 2021 16:22
Make WordPress use an SMTP server for all outgoing email notifications.
<?php
class mdgSMTP {
public static function setup() {
add_action( 'phpmailer_init', [ __CLASS__, 'configure_php_mailer' ] );
if ( class_exists('WP_CLI') ) {
WP_CLI::add_command( 'send-test-email', [ __CLASS__, 'send_test_email' ] );
@kaelri
kaelri / obsidian-dataview-project-cards.css
Last active April 9, 2022 04:22
Obsidian Project List
.project-cards {
margin: 2em 0;
}
.project-card {
margin: .5em 0;
/* border: 1px solid #444; */
background: hsla(0, 0%, 0%, .1);
padding: .5em .5em .5em 2em;
position: relative;
<?php
namespace RunThroughHistory\WPGraphQL\Type\Object;
use WPGraphQL\Model\User as UserModel;
use RunThroughHistory\Interfaces\Hookable;
class User implements Hookable {
public function register_hooks() {
@kaelri
kaelri / hak-mystery-mondays-2021-02-15.js
Last active February 19, 2021 03:20
My solution to this week’s Hunt a Killer “Mystery Mondays” cipher.
// https://www.facebook.com/groups/huntakiller/permalink/2867593840175865/
function decode( encodedPhrase = '' ) {
let key = [
[ 'A', 'B', 'C', 'D', 'E' ],
[ 'F', 'G', 'H', 'IJ', 'K' ],
[ 'L', 'M', 'N', 'O', 'P' ],
[ 'Q', 'R', 'S', 'T', 'U' ],
[ 'V', 'W', 'X', 'Y', 'Z' ]
@kaelri
kaelri / acf-block-with-inner-block-template.php
Last active January 29, 2021 17:27
ACF Block with Inner Blocks Template
<?php
class myBlock {
public static function setup() {
add_action('acf/init', [ __CLASS__, 'register' ] );
}
@kaelri
kaelri / dynalist.css
Last active September 29, 2020 18:17
Dynalist CSS
/* Add a background image. */
.AppContainer {
background-image: url(https://localhost/dynalist_background.jpg);
background-size: cover;
background-position: right center;
}
/* Darken the background image. */
.main-container {
background-color: rgba(24,24,24,0.95);
@kaelri
kaelri / wp_upgrade_jquery.php
Last active June 17, 2020 20:05
Upgrade jQuery in WordPress #wordpress
<?php
add_action( 'wp_enqueue_scripts', 'update_jquery' );
function update_jquery() {
wp_deregister_script ( 'jquery' );
wp_register_script ( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', [], '3.5.1' );
}