Skip to content

Instantly share code, notes, and snippets.

View davemac's full-sized avatar

davemac davemac

View GitHub Profile
@lukecav
lukecav / Commands
Last active March 12, 2019 07:58
WordPress Toolkit for Plesk WP-CLI commands to force update WordPress core version and then check the WP core version
plesk ext wp-toolkit --wp-cli -instance-id 1 -- core update --version=5.1 --force
plesk ext wp-toolkit --wp-cli -instance-id 1 -- core version
@davemac
davemac / cloudflare ips for jetpack
Last active March 8, 2019 09:08
cloudflare ips for jetpack
103.21.244.0-103.21.244.22
103.22.200.0-103.22.200.22
103.31.4.0-103.31.4.22
104.16.0.0-104.16.0.12
108.162.192.0-108.162.192.18
131.0.72.0-131.0.72.22
141.101.64.0-141.101.64.18
162.158.0.0-162.158.0.15
172.64.0.0-172.64.0.13
173.245.48.0-173.245.48.20
@mishterk
mishterk / generated-style.css
Last active September 29, 2017 02:55
BEM style example
.Post{}
.Post__title{}
.Post__content{}
.Post--is-highlighted .Post__title{} // now we are using the cascade to override styling when that block is at a particular state
@neilgee
neilgee / acf-js.js
Last active September 5, 2022 13:52
ACF Google Map - Get Directions Link
(function($) {
/*
* new_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0

Raise Open File Limits in OS X

in OS X 10.4 to macOS sierra 10.12 and maybe higher!

Create Launcher Script:

/Library/LaunchDaemons/limit.maxfiles.plist

Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:

@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@amboutwe
amboutwe / yoast_seo_admin_remove_columns.php
Last active February 1, 2024 16:37
Remove Yoast SEO columns from posts and pages
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Columns
* Credit: Andrew Norcross http://andrewnorcross.com/
* Last Tested: Jun 09 2020 using Yoast SEO 14.3 on WordPress 5.4.1
*
* If you have custom post types, you can add additional lines in this format
* add_filter( 'manage_edit-{$post_type}_columns', 'yoast_seo_admin_remove_columns', 10, 1 );
* replacing {$post_type} with the name of the custom post type.
@rosswintle
rosswintle / domain_info.php
Last active September 23, 2016 00:50
Domain Info script - attempts to give you registrar nameservers, basic DNS, actual hostname hosting the domain and MX records
<?php
/*
* This needs comments and command-line arguments and stuff. It's ruff and ready.
*/
global $domain_re;
$domain_re = '([0-9a-zA-Z\-]+\.)+[0-9a-zA-Z\-]+';
function get_nameservers( $whois_out, $domain ) {
@kontikidigital
kontikidigital / functions.php
Last active January 14, 2021 09:42
WooCommerce: Change Select Options Button Text for variable products
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/**
* custom_woocommerce_template_loop_add_to_cart
*/
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->get_type();
switch ( $product_type ) {