Skip to content

Instantly share code, notes, and snippets.

View mizner's full-sized avatar

Michael Mizner mizner

View GitHub Profile
@mizner
mizner / hide-woocommerce-updater-notfication.php
Created August 2, 2016 20:38
Hide Woocommerce Updater Notification
<?php
remove_action('admin_notices', 'woothemes_updater_notice');
@mizner
mizner / dashboard-menu-page-subpage.php
Created August 7, 2016 03:47
Wordpress add dashboard menu, page, and subpage
<?php
add_action( "admin_menu", "example_admin_menus" );
function example_admin_menus() {
add_menu_page(
"Plugin Page", // $page_title
"Plugin Page", // $menu_title
"manage_options", // $capability
"plugin_page", // $menu_slug
"plugin_render_page", // $function
@mizner
mizner / save-csv-folder.php
Created August 7, 2016 22:39
PHP Create & Save CSV to Folder
<?php
$data_array = array (
array ('1','2'),
array ('2','2'),
array ('3','6'),
array ('4','2'),
array ('6','5')
);
$csv = "col1,col2 \n";//Column headers
@mizner
mizner / iterm.scpt
Created August 12, 2016 03:51 — forked from gnachman/iterm.scpt
Fix docker quickstart terminal for iTerm2 version 2.9 and later
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
@mizner
mizner / docker-wordpress.sh
Created August 16, 2016 10:03 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
my-wpdb:
image: mariadb
ports:
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@mizner
mizner / docker-compose.yml
Created August 24, 2016 15:00
Base Docker Compose File (change ports: 4301 & ports:8001)
version: '2'
services:
db:
image: mysql:5.6
ports:
- "4301:3306"
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
@mizner
mizner / docker_composeV2_static.yml
Last active August 24, 2016 15:14 — forked from RafPe/docker_composeV2_static.yml
Docker compose V2 static addressing (example?)
services:
haproxy:
image: haproxy:latest
ports:
- "80:80"
- "443:443"
volumes:
- ${PWD}/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
restart: always
networks:
@mizner
mizner / scotchboxphp7.txt
Last active August 23, 2021 10:45
Scotchbox PHP 7
List of PHP 7 Packages: https://launchpad.net/ubuntu/+source/php7.0
Disclaimer: I get unreliable results when I don't run these commands seperately and in order.
vagrant ssh
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get update
@mizner
mizner / webpack.php
Created September 4, 2016 09:59 — forked from raphaelkross/webpack.php
Enqueue our dynamic webpack code
if(false == IVAN_OFFSET_DEBUG) {
// Register main theme styles and enqueue it.
// Hint: you can unregister it and replace by your own compiled version in a child theme.
wp_enqueue_style( 'ivan-theme-styles', get_template_directory_uri() . '/css/theme-styles'.$prefix.'.css', array(), '1' );
} else {
wp_enqueue_script( 'webpack-dev-server', 'http://localhost:3002/webpack-dev-server.js', array(), null, false );
wp_enqueue_script( 'webpack-bundle', 'http://localhost:3002/hmr/bundle.js', array(), null, false );
}