Skip to content

Instantly share code, notes, and snippets.

View imhvost's full-sized avatar

Oleksandr Marchuk imhvost

View GitHub Profile
@pgilad
pgilad / Instructions.md
Last active March 27, 2024 12:59
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@johnbillion
johnbillion / wp_mail.md
Last active May 12, 2024 14:19
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@skydriver
skydriver / first-title-letter-query.php
Created April 18, 2014 12:13
WordPress List Posts by First Title Letter
<?php
global $wpdb;
$first_char = esc_attr($_GET[$search_key]);
$postids = $wpdb->get_col($wpdb->prepare("
SELECT ID
FROM $wpdb->posts
WHERE SUBSTR($wpdb->posts.post_title,1,1) = %s
AND $wpdb->posts.post_type = 'product'
@excalq
excalq / gist:2961415
Last active March 19, 2024 17:45
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams]
export function createQueryString2(name: string, value: string, searchParams: any) {
const params = new URLSearchParams(searchParams);
params.set(name, value.toLowerCase());
return params.toString();
}
// ---- Original 2012 version, when browsers really sucked ----
// Explicitly save/update a url parameter using HTML5's replaceState().