Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Agustin Mouratoglou amouratoglou

🎯
Focusing
Block or report user

Report or block amouratoglou

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
@amouratoglou
amouratoglou / woocommerce_sql_scripts.sql
Last active Sep 11, 2019
Woocommerce product management SQL scripts
View woocommerce_sql_scripts.sql
/*
Make sure you execute the script in the right database!
- Delete all products -
Description: This script deletes all WooCommerce products
and their associations (categories/taxonomies and terms info)
*/
DELETE relations.*, taxes.*, terms.*
@amouratoglou
amouratoglou / wordpress_taxonomy_term_title_and_slug
Last active Aug 19, 2019
Wordpress Show Taxonomy Term Title and Slug inside loop #wordpress
View wordpress_taxonomy_term_title_and_slug
<?php
// Print term slug
$terms = get_the_terms( $post->ID , 'oil' );
if ( $terms != null ){
foreach( $terms as $term ) {
print $term->slug ;
unset($term);
} }
// Get term title
@amouratoglou
amouratoglou / wordpress-ajax-load-posts.php
Last active Aug 3, 2019
Get AJAX posts in Wordpress #ajax #wordpress #javascript
View wordpress-ajax-load-posts.php
// the function returns HTML directly using a custom template
// add this to your functions.php or create a plugin
function get_ajax_posts()
{
// Query Arguments
$args = array(
'post_type' => 'post',
View rename_woocommerce_name_dashboard_menu_wordpress.php
// Rename WooCommerce to Store in the dashboard
// add this function to your functions.php file
// or create a plugin with it.
add_action( 'admin_menu', 'rename_woocoomerce', 999 );
function rename_woocoomerce()
{
global $menu;
@amouratoglou
amouratoglou / function_query_woocommerce_subcategory_thumbnail_featured_image.php
Last active Jul 11, 2019
Wp Woocommerce Subcategory Loop showing featured image in tumbnail size
View function_query_woocommerce_subcategory_thumbnail_featured_image.php
View mongo.txt
MONGO SHELL
---------------------------
mongo "mongodb+srv://clustertest-rrpc1.mongodb.net/test" --username m001-student
password
show dbs
use [databasename]
@amouratoglou
amouratoglou / docker.JS
Last active Aug 13, 2019
Docker commands #docker
View docker.JS
// How To Remove Docker Containers, Images, Volumes, and Networks
// docker stop
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@amouratoglou
amouratoglou / isMobile.js
Created Apr 29, 2019
Detect if is mobile and do something #javascript
View isMobile.js
function isMobile() {
if (navigator.userAgent.match(/Mobi/)) {
return true;
}
if ('screen' in window && window.screen.width < 1366) {
return true;
}
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
@amouratoglou
amouratoglou / smooth-scroll.js
Created Apr 27, 2019
smooth scroll on click to anchor link jquery #js #jquery #smoothscroll
View smooth-scroll.js
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
You can’t perform that action at this time.