Skip to content

Instantly share code, notes, and snippets.

View enricodeleo's full-sized avatar

Enrico Deleo enricodeleo

View GitHub Profile
@enricodeleo
enricodeleo / ios-chrome-devtools.md
Created June 22, 2021 16:55 — forked from james2doyle/ios-chrome-devtools.md
Enable remote debugging on the iOS simulator using Chrome Dev Tools

Install the tools:

brew install ios-webkit-debug-proxy

Run the simulator. And choose an iOS 10 device. The chrome remote debugging doesn't work with iOS 11 yet.

Enable the inspector

@enricodeleo
enricodeleo / my.cnf
Created March 1, 2014 14:15
MySQL optimized my.cnf for Magento store on 1GB ram VPS
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
# MyISAM #
key-buffer-size = 32M
@enricodeleo
enricodeleo / taxonomies.php
Last active December 1, 2022 16:21
Get and list all the taxonomies attached to a custom post type in Wordpress
<?php
$taxonomy_objects = get_object_taxonomies( 'cpt', 'objects' ); // <--- change cpt with the custom post type
$out = array();
foreach ( $taxonomy_objects as $taxonomy_slug => $taxonomy ){
$terms = get_terms( $taxonomy_slug, 'hide_empty=0' );
if ( !empty( $terms ) ) {
$out[] = "<strong>" . $taxonomy->label . "</strong>\n<ul>";
foreach ( $terms as $term ) {
$out[] =
" <li>"