Skip to content

Instantly share code, notes, and snippets.

View matteosuppo's full-sized avatar

Matteo "triex" Suppo matteosuppo

  • siena
View GitHub Profile
"""
Feature: Events API
"""
from datetime import datetime, timedelta
import json
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
@matteosuppo
matteosuppo / gist:7558338
Created November 20, 2013 05:46
PHP integration with TNT (that doesn't work)
$this->template = 'sale/xml/tnt_r.tpl';
$xml_ = $this->render(); // build the xml with the order data
try {
$gsearch = new SoapClient('https://www.mytnt.it/ResiService/ResiServiceImpl.wsdl');
$result = $gsearch->__soapCall('getPDFLabel', array(array('inputXml'=>$xml_)));
$result2 = $result->getPDFLabelReturn;
if ($result2->documentCorrect == 1 && strlen($result2->binaryDocument)>0){
// sparare il pdf $result2->binaryDocument;
@matteosuppo
matteosuppo / main.go
Created March 23, 2017 13:23
A simple redirect manager
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"github.com/alecthomas/template"
@matteosuppo
matteosuppo / contoarancio.go
Created July 1, 2019 13:06
A simple way to convert the stupid .xls of Contoarancio to a more sensible .csv
package main
import (
"encoding/csv"
"os"
"golang.org/x/net/html"
)
func main() {