Skip to content

Instantly share code, notes, and snippets.

View TioBorracho's full-sized avatar

Dario Guzik TioBorracho

  • Google UK
  • London
View GitHub Profile
@TioBorracho
TioBorracho / adding_new_webhook_topics.php
Created September 14, 2023 10:27 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@TioBorracho
TioBorracho / adding_new_webhook_topics.php
Created September 14, 2023 10:27 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import pickle
# Setup the browser. Could be headless, just testing.
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--test-type")
options.binary_location = "/usr/bin/chromium"
@TioBorracho
TioBorracho / data.csv
Created February 22, 2017 15:54 — forked from eightysteele/data.csv
Unicode DictReader and DictWriter
id name age
0 aaron 34
1 tina 36
2 noah ©
@TioBorracho
TioBorracho / data.csv
Last active February 22, 2017 15:56 — forked from eightysteele/data.csv
Unicode DictReader and DictWriter
0 aaron 34
1 tina 36
2 noah ©
@TioBorracho
TioBorracho / gist:8546624
Created January 21, 2014 19:30
Bug de GPars
import groovyx.gpars.GParsPool
def set = (1..10)
def cnt = 0
def r = new java.util.Random()
def baseThreads = Thread.activeCount()
GParsPool.withPool(3) {
println "Only 3 \"Starting thread\" call should exists until one \"Closing\""
set.eachParallel{ aa ->
synchronized(this.class) {
@TioBorracho
TioBorracho / CriteriaReportTest.xml
Created February 8, 2013 15:43
XML para reporting de criteria (la idea es obtener las negatives)
<reportDefinition>
<selector>
<fields>CampaignId</fields>
<fields>CampaignName</fields>
<fields>Criteria</fields>
<fields>CriteriaType</fields>
<fields>ExternalCustomerId</fields>
<fields>Id</fields>
<fields>IsNegative</fields>
<fields>Status</fields>
@TioBorracho
TioBorracho / PHP-All-Categories.php
Created September 21, 2012 18:39
Opening gzipped json for all categories in MELI (MLA)
<?php
ini_set("memory_limit","500M"); //less should be enough, but I came to this number checking
$options = array('http'=>array('header'=>"Accept-Encoding: gzip\r\n"));
$context = stream_context_create($options);
$results = file_get_contents('compress.zlib://https://api.mercadolibre.com/sites/MLA/categories/all', 0, $context);
$results = json_decode($results);
//print_r($results);