Skip to content

Instantly share code, notes, and snippets.

@jjeaton
jjeaton / content.js
Created February 23, 2023 01:48
Arc boost to redirect to WordPress login using Option + Shift + A
document
.body
.addEventListener("keydown", function(event) {
// Å = option + shift + A
if (event.key === "Å") {
redirectToAdmin();
}
});
function redirectToAdmin() {
@jjeaton
jjeaton / .gitignore_global
Created April 12, 2022 18:21
Example .gitignore_global
# Global .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
@jjeaton
jjeaton / Customfile
Created July 5, 2017 12:59
Customfile to share specific host key auth with Vagrant VM.
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 et:
# Add github to known hosts for private repo provisioners
config.vm.provision "shell", run: "always" do |s|
s.inline = <<-SHELL
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/known_hosts
if ! grep -Fxq "github.com" ~/.ssh/known_hosts; then
@jjeaton
jjeaton / Customfile
Created July 5, 2017 12:58
Customfile to share specific host key auth with Vagrant VM.
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 et:
# Add github to known hosts for private repo provisioners
config.vm.provision "shell", run: "always" do |s|
s.inline = <<-SHELL
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/known_hosts
if ! grep -Fxq "github.com" ~/.ssh/known_hosts; then
@jjeaton
jjeaton / Customfile
Created July 5, 2017 12:58
Customfile to share specific host key auth with Vagrant VM.
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 et:
# Add github to known hosts for private repo provisioners
config.vm.provision "shell", run: "always" do |s|
s.inline = <<-SHELL
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/known_hosts
if ! grep -Fxq "github.com" ~/.ssh/known_hosts; then
@jjeaton
jjeaton / deactivate.sh
Created July 27, 2016 19:50
Sometimes in multisite a plugin can be network deactivated, but was originally active on a single site, so it remains active on that site. This command will ensure that a plugin is deactivated at the network level and on each individual site in the network.
# Using disable-emails as an example
wp plugin deactivate --network disable-emails && wp site list --field=url | xargs -n1 -I % wp --url=% plugin deactivate disable-emails
@jjeaton
jjeaton / wpcli-per-site.sh
Created July 27, 2016 19:28
Check the plugin status on each site in a multisite network
wp site list --field=url | xargs -n1 -I % wp --url=% plugin status
@jjeaton
jjeaton / coworkers.json
Created March 15, 2016 20:48
Test data
[{
"name": "Milhouse Van Houten",
"desk": 2
}, {
"name": "Homer Simpson",
"desk": 4
}, {
"name": "Disco Stu",
"desk": 5
}]
@jjeaton
jjeaton / run_tests.sh
Last active January 14, 2016 14:18
Laravel debug phpunit within homestead
# Laravel debug phpunit within homestead
# Get remote_host value by running `netstat -rn` and choosing the gateway
# serverName must match the server name configured in PHPSTORM
XDEBUG_CONFIG="idekey=PHPSTORM remote_host=10.0.2.2" PHP_IDE_CONFIG="serverName=api.dev" vendor/bin/phpunit
@jjeaton
jjeaton / .htaccess
Created October 20, 2015 19:49
Apache rewrite to send non-HTTPS traffic to HTTPS URLs
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
</IfModule>