Skip to content

Instantly share code, notes, and snippets.

Mike Langone mlangone

  • Gilbert, Arizona
Block or report user

Report or block mlangone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlangone
mlangone / functions.php
Created Dec 30, 2019 — forked from maddisondesigns/functions.php
WooCommerce Custom Fields for Simple & Variable Products
View functions.php
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@mlangone
mlangone / disable-comments.sh
Created Sep 11, 2019 — forked from jplhomer/disable-comments.sh
Disable all comments/pings in WordPress with WP-CLI
View disable-comments.sh
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
@mlangone
mlangone / sane-caching.nginx.conf
Created Apr 3, 2019 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
View sane-caching.nginx.conf
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@mlangone
mlangone / function.php
Last active Feb 21, 2019 — forked from tessak22/function.php
Hero ACF Block (Requires ACF Pro 5.8) - Big Thanks to https://github.com/tessak22 @tessak22
View function.php
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
@mlangone
mlangone / config
Created Sep 6, 2018 — forked from justinpawela/config
AWS CodeCommit Multiple Account Config
View config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region
@mlangone
mlangone / schema-org-structured-data-markup-using-microdata.html An example of how to mark up a HTML5 webpage using the schema.org schemas and microdata.
View schema-org-structured-data-markup-using-microdata.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Site Title</title>
<link rel="stylesheet" href="/assets/css/style.min.css">
@mlangone
mlangone / http-to-https.php
Created Mar 28, 2018 — forked from danielbachhuber/http-to-https.php
Update a specific site from 'http://' to 'https://'.
View http-to-https.php
<?php
/**
* Update a specific site from 'http://' to 'https://'.
*
* Only touches the 'home' and 'siteurl' options.
* Depending on plugins, etc., you may need to update other options too.
*
* Run on WordPress multisite with:
*
* wp site list --field=url | xargs -I % wp eval-file http-to-https.php --url=%
@mlangone
mlangone / _mediaQueries.scss
Last active Mar 22, 2018
Zurb Foundation6 Media Queries default breakpoints and custom devices - WIP
View _mediaQueries.scss
/************************************************
Stylesheet: Media Queries
*************************************************/
// Media Queries
$screen: "only screen" !default;
$breakpoints: (
small: 480px,
medium: 640px,
large: 1024px,
xlarge: 1200px,
@mlangone
mlangone / gravity_forms_validation.php
Created Feb 26, 2018 — forked from BronsonQuick/gravity_forms_validation.php
Change the default validation message and add validation on default values in Gravity Forms
View gravity_forms_validation.php
<?php
//This is a filter to change the default validation message that Gravity Forms generates
add_filter('gform_validation_message', 'change_validation_message', 10, 2);
function change_validation_message($message, $form)
{
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>";
}
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back
@mlangone
mlangone / gravity_forms_validation.php
Created Feb 26, 2018 — forked from BronsonQuick/gravity_forms_validation.php
Change the default validation message and add validation on default values in Gravity Forms
View gravity_forms_validation.php
<?php
//This is a filter to change the default validation message that Gravity Forms generates
add_filter('gform_validation_message', 'change_validation_message', 10, 2);
function change_validation_message($message, $form)
{
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>";
}
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back
You can’t perform that action at this time.