View get_wpengine_installs_status.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example run: | |
// php -f get_wpengine_installs_status.php > installs.csv | |
// | |
// acquire your username and password from https://my.wpengine.com/profile/api_access | |
define('API_USERNAME',''); | |
define('API_PASSWORD',''); | |
$result_obj = run_query( 'https://api.wpengineapi.com/v1/installs' ); |
View wordpress_disable_comments_pingbacks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disables comments and pingbacks settings for all existing sites in a WordPress network | |
$sites = get_sites(); | |
foreach ( $sites as $site ) { | |
switch_to_blog( $site->blog_id ); | |
update_option( 'default_comment_status', 'closed' ); | |
update_option( 'default_ping_status', 'closed' ); | |
restore_current_blog(); | |
} |
View jbl_find_replace.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Backup site first before using. This adds a menu to wp-admin so you can run the script. | |
*** Visiting this menu will automatically run the script!! *** | |
*/ | |
add_menu_page( | |
'jbl Find Replace', | |
'jbl Find Replace', | |
'manage_options', | |
'jbl-find-replace', | |
'jbl_find_replace' |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function head_fouc_script() { | |
?> | |
<script> | |
document.body.style.setProperty("visibility", "hidden", "important"); | |
</script> | |
<style> | |
#mega-menu-wrap-primary #mega-menu-primary { /* these IDs may differ depending on the name of your menu. */ | |
visibility: inherit; /* mega menu sets visibility visible and shows if you don't set this */ |
View dyndns_linode.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
domainid=000000 | |
recordid=0000000 | |
wanip=`dig @resolver4.opendns.com myip.opendns.com +short` | |
oldip=`linode-cli domains records-view $domainid $recordid --text --no-header --format="target"` | |
if [ $oldip != $wanip ] | |
then | |
linode-cli domains records-update $domainid $recordid --target $wanip |
View usps_accepted_at.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function usps_picked_up( $tracking_number ) { | |
if( empty( $tracking_number ) || !ctype_alnum( $tracking_number ) ) { | |
return false; | |
} | |
$user_id = "YOUR_USER_ID"; | |
$usps_api_uri = "http://production.shippingapis.com/shippingAPI.dll"; | |
$xml = rawurlencode("<TrackRequest USERID=\"". $user_id ."\"> |
View getUrlWithParams.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* getUrlWithParams() | |
* Add/update or remove url parameters from the provided url. | |
* Example: getUrlWithParams({'tab':tab_name},['remove']); | |
*/ | |
var getUrlWithParams = function(url, add_update, remove = []) { | |
var url = new URL(url); | |
var splita = url.search.substr(1).split('&'); | |
var params = {}; | |
var merged = {}; |
View WP-JSON-Parser.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script> | |
const req = new XMLHttpRequest(); | |
req.addEventListener('load', function(e) { | |
var response = JSON.parse( e.target.response ); | |
var page_html = response.content.rendered; | |
View find_invisible_horizontal_scroll_elements.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); |
View off.reg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
; Turn off File Explorer ads | |
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced] | |
"ShowSyncProviderNotifications"=dword:00000000 | |
; Turn off Start Menu suggestions | |
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager] | |
"SystemPaneSuggestionsEnabled"=dword:00000000 |
NewerOlder