Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
protorob / woocommerce-add-sku-on-order.php
Created Dec 27, 2019
Add SKU to items in order email - woocommerce
View woocommerce-add-sku-on-order.php
function artomultiplo_add_sku_woocommerce_emails( $output, $order ) {
// set a flag so we don't recursively call this filter
static $run = 0;
// if we've already run this filter, bail out
if ( $run ) {
return $output;
protorob /
Created Nov 21, 2019
Scrapper for a website
# Import libraries
import requests
from bs4 import BeautifulSoup
website = ''
output_file = open('bomboniere.csv', 'w+')
counter = 1
protorob / style.css
Last active May 13, 2020
Artomultiplo's Generatepress Woocommerce Starter Child
View style.css
Theme Name: Artomultiplo GP Child
Template: generatepress
Theme URI:
Author: Roberto Enrique Briceno Garcia
Author URI:
Description: A woocommerce optimized GP child
Version: 1.0
License: GNU General Public License v2 or later
License URI:
protorob / cart.php
Created Oct 29, 2019
Artomultiplo's Generatepress Cart Mods (cart.php)
View cart.php
* Cart Page
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php.
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
protorob /
Last active May 14, 2019
A simple Python script to batch remove backgrounds from images in a directory
# This script asumes that you have two directories
# One directory called "origin" with your original images
# Another directory valled "results" that is going to be filled with your processed images :-)
# The name of the directories should be exactly like that "origin" and "results" respectively
# The script also need a API key, so you should get one of those
# it also require "requests" to be installed (see
import requests
import os
protorob /
Last active May 2, 2019
Python scrypt for finding pairs of words that behave in curious ways
#inserire il file del vocabolario
words = open("zingarelli.txt", "r")
# cambiare questo valore per stabilire il numero di lettere delle parole (dev'essere un numero % 2 = 0)
maxlenght = 6
wordarray = []
for word in words:
if len(word) == maxlenght + 1:
import html
just_open = open('art.csv', 'r')
output_file = open('freshnclean.csv', 'w')
i = 0
for row in just_open:
if (i >= 0 and i < 5000):
lariga = html.unescape(row)
View Tampermonkey.js
// ==UserScript==
// @name Get div contents and print it to console on OAM course
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match*
// @require
// ==/UserScript==
protorob /
Last active Jan 28, 2019
Standard Plugin Install for WP-CLI
#!/bin/bash -e
# Defining Database Variables:
echo "=================================================================="
echo "We're going to install the standard plugins and Generatepress:"
echo "Plugins to be installed in no particular order:"
echo " - The Seo Framework"
echo " - SiteOrigin Page Builder with Official Extra Widgets and Livemesh ones"
echo " - Widget CSS Classes"
protorob / processwire_json_page_create.php
Last active Apr 9, 2018
Processwire Page Create From Webtic JSON
View processwire_json_page_create.php
$movies = json_decode(file_get_contents(''));
foreach ($movies->DS->Scheduling->Events as $movie) {
$p = new Page(); // create new page object
$p->template = 'single-movie'; // set template
$p->parent = wire('pages')->get('/programmazione/'); // set the parent
$p->name = $movie->Title; // give it a name used in the url for the page
$p->title = ucfirst($movie->Title); // set page title (not neccessary but recommended)