- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
| [ | |
| { | |
| "keys": ["ctrl+2"], | |
| "command": "run_macro_file", | |
| "args": { | |
| "file": "Packages/User/to-2.sublime-macro" | |
| } | |
| }, | |
| { | |
| "keys": ["ctrl+4"], |
| <?php | |
| /* | |
| * Plugin Name: Remove crazy counts slowing down my dashboard | |
| * Plugin URI: https://pmgarman.me | |
| * Description: Those comment counts are such a pain when you have a lot of comments | |
| * Author: Patrick Garman | |
| * Author URI: https://pmgarman.me | |
| * Version: 1.0.0 | |
| * License: GPLv2 | |
| */ |
| #!/bin/bash | |
| # Get section | |
| if [[ $1 =~ [0-9]+ ]] | |
| then | |
| section=$1 | |
| shift | |
| fi | |
| # Find the longest set of args that gets a man page |
| /** | |
| * Each of these samples can be used - note that you should pick one rather than add them all. | |
| * | |
| * How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96 | |
| * Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/ | |
| **/ | |
| /** | |
| * Add a content block after all notices, such as the login and coupon notices. | |
| * |
| <?php | |
| /* | |
| * Alters event's archive titles | |
| */ | |
| function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) { | |
| // Modify the titles here | |
| // Some of these include %1$s and %2$s, these will be replaced with relevant dates | |
| $title_upcoming = 'Upcoming Events'; // List View: Upcoming events |
| // Get The Page ID You Need | |
| get_option( 'woocommerce_shop_page_id' ); | |
| get_option( 'woocommerce_cart_page_id' ); | |
| get_option( 'woocommerce_checkout_page_id' ); | |
| get_option( 'woocommerce_pay_page_id' ); | |
| get_option( 'woocommerce_thanks_page_id' ); | |
| get_option( 'woocommerce_myaccount_page_id' ); | |
| get_option( 'woocommerce_edit_address_page_id' ); | |
| get_option( 'woocommerce_view_order_page_id' ); | |
| get_option( 'woocommerce_terms_page_id' ); |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1
| # font color : green | |
| color='\e[0;32m' | |
| # font color : white | |
| NC='\e[0m' | |
| getquote(){ | |
| num_online_quotes=9999 | |
| rand_online=$[ ( $RANDOM % $num_online_quotes ) + 1 ] | |
| quote=$(wget -q -O - "http://www.quotationspage.com/quote/$rand_online.html" | |
| 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->product_type; | |
| switch ( $product_type ) { |
| read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response | |
| if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] | |
| then | |
| wp @development db reset --yes | |
| wp @production db export - > sql-dump-production.sql | |
| wp @development db import sql-dump-production.sql | |
| wp @development search-replace https://example.com https://example.dev | |
| else | |
| exit 0 | |
| fi |