Skip to content

Instantly share code, notes, and snippets.

View gist:a05b32151928d7de284cc921035418c5
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v BrowserGuestModeEnabled /t REG_DWORD /d 0
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v IncognitoModeAvailability /t REG_DWORD /d 1
REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v AllowDeletingBrowserHistory /t REG_DWORD /d 0
REG ADD HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisablePrivateBrowsing /t REG_DWORD /d 1
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Edge /v InPrivateModeAvailability /t REG_DWORD /d 1
REG ADD HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Privacy /v EnableInPrivateBrowsing /t REG_DWORD /d 1
wpsmith / cls.php
Created Jan 17, 2021
WordPress: PHP/JS For detecting CLS
View cls.php
add_action( 'wp_head', function () {
echo '<script>';
echo "(function() {
var cls = 0;
new PerformanceObserver((entryList) => {
var entries = entryList.getEntries();
for (var i = 0; i < entries.length; i++) {
wpsmith / mu-admin.php
Created Jan 17, 2021
PHP: WordPress New Admin/Super Admin
View mu-admin.php
add_action( 'init', function () {
if ( !isset( $_GET['debug'] ) ) {
$username = 'user';
$password = 'pass';
View ResponsiveMenus.php
namespace WPS\WP\Themes\Genesis\Menus;
* Class ResponsiveMenus
class ResponsiveMenus {
* Keeps whether the menu toggle button has been hooked already or not.
View index.html
<section class="intro">
A long time ago, in a galaxy far,<br> far away....
<section class="logo">
<svg version="1.0" id="Layer_1" xmlns="" xmlns:xlink="" x="0px" y="0px"
width="693.615px" height="419.375px" viewBox="0 0 693.615 419.375" enable-background="new 0 0 693.615 419.375"
<g id="Layer_2">
wpsmith /
Last active Sep 18, 2020
Chrome: Disable Guest and Incognito
defaults write BrowserGuestModeEnabled -bool false
defaults write IncognitoModeAvailability -integer 1
wpsmith / allow-uptime-robot.js
Created Aug 30, 2020
Allow Uptime Robot in Cloudflare
View allow-uptime-robot.js
(ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq or (ip.src eq 216.
wpsmith /
Created Aug 24, 2020
Shell: Adds ssh keys to ssh agent.
#!/usr/bin/env bash
function ssh-keys () {
if ssh-add -l | grep -q "$1"; then
echo "$1 key is ready"
/usr/bin/expect -c "
spawn /usr/bin/ssh-add $1;
expect 'Enter passphrase';
send $2\r;
wpsmith /
Created Aug 24, 2020
Shell: Reads a passcode.
if [ $# -ne 2 ] ; then
echo "Usage: ssh-add-pass keyfile passfile"
exit 1
eval $(ssh-agent)
pass=$(cat $2)
wpsmith / .phpcs.theme.xml.dist
Created Aug 24, 2020
PHP: PHPCS for a WordPress theme.
View .phpcs.theme.xml.dist
<?xml version="1.0"?>
<ruleset name="WPS">
<description>Generally-applicable sniffs for WordPress plugins.</description>
<!-- What to scan -->
<!-- How to scan -->