Skip to content

Instantly share code, notes, and snippets.

View edoardo-mb's full-sized avatar
🎯
Focusing

Edoardo Armandi M&B edoardo-mb

🎯
Focusing
View GitHub Profile
@edoardo-mb
edoardo-mb / laravellocal.md
Created June 29, 2019 08:37 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@edoardo-mb
edoardo-mb / functions.php
Created January 22, 2019 11:45 — forked from lmartins/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@edoardo-mb
edoardo-mb / edit-woocommerce-checkout-template.php
Created December 6, 2018 15:42 — forked from bekarice/edit-woocommerce-checkout-template.php
Add content and notices to the WooCommerce checkout - sample code
/**
* 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.
*
@edoardo-mb
edoardo-mb / wordpress-escaping.md
Created November 5, 2018 14:58 — forked from windyjonas/wordpress-escaping.md
Most of the escaping functions in WordPress, with a short explanation and example.

WordPress escaping functions

By: Jonas Nordström, @windyjonas
Date: 2013-04-16

esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:

@edoardo-mb
edoardo-mb / fix-wordpress-permissions.sh
Created June 4, 2018 08:53 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@edoardo-mb
edoardo-mb / province.txt
Created March 21, 2018 14:11 — forked from iamlucamilan/province.txt
Lista province italiane
Agrigento
Alessandria
Ancona
Aosta
Arezzo
Ascoli Piceno
Asti
Avellino
Bari
Barletta-Andria-Trani

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup