Skip to content

Instantly share code, notes, and snippets.

View atraining's full-sized avatar

Christopher Helm atraining

View GitHub Profile
---
marp: true
paginate: true
header: 'Name | Kunde | Datum'
style: |
section{background:#0d1f2d;color:#f5f0eb;font-family:Georgia,serif;padding:40px 40px 10px 40px;display:grid;grid-template-columns:2fr 1fr;grid-template-rows:auto auto 1fr;gap:0.4rem 1.5rem}section::before{grid-column:1/1}h2{color:#c45c3e;font-size:0.65em;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;margin:1em 1em -1em 0em;grid-column:1/-1;grid-row:1;padding:1em 1em 1em 0em!important}h1{color:#f5f0eb;font-size:1.35em;font-weight:400;margin:0 0 0em 0;grid-column:1/-1;grid-row:2;line-height:1.2}header{color:rgba(255,255,255,0.5);font-size:0.55em}section::after{font-size:0.5em;color:rgba(255,255,255,0.4)}.left{font-size:0.75em;line-height:1.5}.right{font-size:0.55em;display:flex;flex-direction:column;gap:0.35rem}.right h4{color:rgba(255,255,255,0.6);font-size:0.8em;margin:0 0 0.15rem 0;font-weight:400}.box{background:rgba(255,255,255,0.05);padding:0.45rem 0.55rem;border-radius:5px;border-left:3px solid;line-height:1.35}.box.

Invoice

Invoice Number

Invoice Date

Order ID (Prio)

Supplier Order ID (Prio)

Net Amount

Gross Amount

Due Date

allowances/charges (skonto, freight)

Type (invoice or credit note)

@atraining
atraining / combine_json_to_csv.py
Created December 9, 2021 08:01
Combine multiple json files into one csv
import glob
import json
from copy import deepcopy
import pandas
def cross_join(left, right):
new_rows = [] if right else left
for left_row in left:
# Rechnung
## Buchungsinformationen
- Datum
- Betrag
# Poste
- Bezeichnung
library(reshape)
setwd('D:/gdrive/FIM_MA/code')
library(gdata)

# Create urls
urls = c()
for (urlyear in 2012:2016){
 for (urlmonth in 1:12){
  for (urlday in 1:31){

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@atraining
atraining / Django + Ajax dynamic forms .py
Created June 27, 2017 09:29 — forked from goldhand/Django + Ajax dynamic forms .py
Django form with Ajax. A simple Task model that can be updated using a CBV with an AJAX mixin. The view sends post data with ajax then updates the view with a callback to a DetailView with a json mixin.There is an abstract CBV, AjaxableResponseMixin, based on the example form django docs, that is subclassed in the TaskUpdateView CBV. TaskUpdateV…
#models.py
class Task(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
def __unicode__(self):
return self.title
@atraining
atraining / task_update_json.html
Created June 27, 2017 09:29 — forked from goldhand/task_update_json.html
Updates any Task model without reloading using ajax
#views.py
class TaskUpdateView(generic.UpdateView):
model = Task
form_class = TaskForm
@json_view
def dispatch(self, *args, **kwargs):
return super(TaskUpdateView, self).dispatch(*args, **kwargs)
date,open,high,low,close
2015-12-30,21.94,22.72,21.93,22.62
2015-12-29,22.34,22.42,21.71,21.79
2015-12-28,22.22,23.06,22.14,22.61
2015-12-23,21.94,21.95,20.59,20.65
2015-12-22,23.33,24.56,22.63,22.8
2015-12-21,23.79,23.87,22.62,23.8
2015-12-18,23.49,23.96,22.52,23.43
2015-12-17,22.95,23.15,21.69,22.75
2015-12-16,26.85,27.03,25.26,25.58
# TODO - Code Cleaning
#################################
#
# Packages
#
#################################
library(RCurl)
library(reshape)
library(xts)