Skip to content

Instantly share code, notes, and snippets.

View elcolumbio's full-sized avatar

Florian Benkö elcolumbio

View GitHub Profile
@elcolumbio
elcolumbio / metatable.sql
Created October 6, 2020 11:51
Get Column names and Datatypes from PostgreSQL with SQL
select column_name,data_type
from information_schema.columns
where table_name = 'customerorderposition';
@elcolumbio
elcolumbio / jtl_stats.sql
Last active August 16, 2018 09:16
jtl statistic view
/******
Skript für Select neueste Bestellungen
Die Keys sind genauso für viele andere Tabellen verwendbar.
******/
SELECT TOP (1000) B.kBestellung
,V.cName as 'Versandart'
,W.fWert/W.fFaktor as 'Betrag Bestellung in Euro' /* veraltete Wechselkurse */
,P.cName as 'Plattform'
,B.nStorno
,B.dBezahlt
@elcolumbio
elcolumbio / reportenum.py
Last active May 27, 2018 00:06
maybe of some help, probably missing a couple
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
class AllReports(Enum):
"""Format: meaningful_name = (report, isutf8, date) ."""
# Listing Reports
@elcolumbio
elcolumbio / example_feed.py
Created April 18, 2018 00:20
mws api feeds
from luigipipe.mws import mws
def make_feed_row(feed_row_template, product, update_type):
return feed_row_template.format(product, '32.00')
def create_feed():
feed_header = 'sku\tprice\n'
feed_row_template = '{}\t{}'
@elcolumbio
elcolumbio / mws api python, flatten response dict
Created September 1, 2017 19:51
mws api python, flatten response dict
# maybe its helpful or you see improvements
# i get lots of latin-1 encoded text fields, so i use this try block
def flatten_dict(d):
def items():
for key, value in d.items():
if isinstance(value, dict):
for subkey, subvalue in flatten_dict(value).items():
try:
subvalue = subvalue.encode('latin-1').decode('utf-8')
except: