Skip to content

Instantly share code, notes, and snippets.

View matgargano's full-sized avatar

Mat Gargano matgargano

View GitHub Profile
@matgargano
matgargano / mutlsite instructions
Created February 26, 2020 02:53
multisite instructions
add to wp-config:
Config::define('WP_ALLOW_MULTISITE', true);
deploy site
go to tools > network setup, select subdomains
save , etc.
add to wp-config
Config::define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
Config::define('MULTISITE', true);
Config::define('SUBDOMAIN_INSTALL', true);
Config::define('PATH_CURRENT_SITE', '/wp/');
@seezee
seezee / rating-shortcode.php
Last active November 16, 2021 16:21
WordPress shortcode for accessible "Fontawesome 5" star ratings.
<?php
function my_rating( $atts ) {
$rating = shortcode_atts( array(
'stars' => '',
'half' => 'false',
), $atts );
$star = esc_attr($rating['stars']);
$stars = str_repeat('<i class="fas fa-fw fa-star"></i>', $star);
$half = esc_attr($rating['half']);
@devotoare
devotoare / .user.ini
Created March 21, 2018 00:52
Wordfence for Trellis/Bedrock
; Wordfence WAF
auto_prepend_file = ‘/srv/www/example.com/current/config/wordfence-waf.php’
; END Wordfence WAF
@jaredatch
jaredatch / mailhog-mamp.md
Created January 30, 2018 21:57
Install MailHog with MAMP Pro

Install MailHog with MAMP Pro, using HomeBrew.

MailHog

First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
<?php
/**
* Save Work ID
*
* Save work ID on the fly when adding new post.
*
* @param string $post_id Post ID.
*
* @return array $_POST Post Data.
@cliffordp
cliffordp / functions.php
Last active September 8, 2022 14:31
Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
<?php
/**
* Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
*
* @link https://wordpress.org/plugins/woocommerce-product-dependencies/ May be a better and easier solution !!! !!! !!! (But I haven't tried it.)
*
* !!! Before using, edit the variables in this function according to your needs!!!
* Could maybe also do the inverse (if ticket product is removed from cart, also remove the chained product).
*
* From https://gist.github.com/cliffordp/30481ca323012e298418095476d49337
@nienkedekker
nienkedekker / phpstorm-cs-fixer.md
Last active February 2, 2024 03:09
Set up PHP-CS-Fixer in PHPStorm

Use PHP-CS-Fixer in PHPStorm

  • Install PHP-CS-Fixer on your local machine according to these instructions: https://github.com/FriendsOfPHP/PHP-CS-Fixer
  • Open PHPStorm, Preferences > Tools > External Tools and enter these values: img
  • Program, edit to match your path where PHP-CS-Fixer lives: /.composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
  • Parameters: --rules=@PSR2 --verbose fix $FileDir$/$FileName$. Note that previous verions of PHP-CS-Fixer used --levels instead of --rules.
  • Working directory: $ProjectFileDir$

Click OK and Apply. Now we'll set up a shortcut.

  • Go to Preferences > Keymap and search for "PHP Fixer" (or whatever name you gave it). Add whatever shortcut you like, I'm using ctrl + cmd + ]:
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 7, 2024 01:25
Essential JavaScript Links
@chanified
chanified / twbs-grid-xl
Created October 15, 2014 03:05
Twitter Bootstrap col-xl less file
// XL screen
@screen-xl: 1600px;
@screen-xl-min: @screen-xl;
@screen-xl-hughdesktop: @screen-xl-min;
// So media queries don't overlap when required, provide a maximum
@screen-lg-max: (@screen-xl-min - 1);
//Container sizes
// Large screen / wide desktop
@matgargano
matgargano / gist:fea6c14f694f724a8c6d
Created July 2, 2014 13:26
add local ssh key to remote server
cat ~/.ssh/id_rsa.pub | ssh root@your.ip.address "cat >> ~/.ssh/authorized_keys"