Skip to content

Instantly share code, notes, and snippets.

View matthiasnagel's full-sized avatar

Matthias Nagel matthiasnagel

  • Stuttgart, Germany
View GitHub Profile
@matthiasnagel
matthiasnagel / TaxCalculator2021.ts
Last active December 29, 2020 09:32
Easy to use German income tax calculator for 2021 in Typescript. Implementation according the official flowchart. Einfacher Einkommensteuerrechner (Deutschland) für das Jahr 2021. Nach dem offiziellen Ablaufplan implementiert: https://www.bundesfinanzministerium.de/Content/DE/Downloads/Steuern/Steuerarten/Lohnsteuer/Programmablaufplan/2020-11-09…
//Implementation according to official flowchart. For more details see: https://www.bundesfinanzministerium.de/Content/DE/Downloads/Steuern/Steuerarten/Lohnsteuer/Programmablaufplan/2020-11-09-PAP-2021-anlage-1.pdf?__blob=publicationFile&v=2
const lzz: number = 1; //Lohnzahlungszeitraum: 1 = Jahr, 2 = Monat, 3 = Wochem, 4 = Tag
const gfb: number = 0; //Grundfreibetrag in Euro
const solzfrei: number = 16956; //Freigrenze für den Solidaritätszuschlag in Euro
class TaxCalculator2021 {
zve: number = 100000; //Zu versteuerndes Einkommen in Euro, Cent (2 Dezimalstellen)
kztab: number = 1; //Kennzahl für die Einkommensteuer-Tarifarten. 1 = Grundtarif, 2 = Splittingverfahren
r: number = 0; //Religionsgemeinschaft des Arbeitnehmers lt. elektronischer Lohnsteuerabzugsmerkmale oder der Bescheinigung für den Lohnsteuerabzug 2021 (bei keiner Religionszugehörigkeit = 0)
@matthiasnagel
matthiasnagel / UIImageFixedOrientationExtension.swift
Created January 19, 2017 09:36 — forked from schickling/UIImageFixedOrientationExtension.swift
Extension to fix orientation of an UIImage (Sets orientation to portrait)
import UIKit
extension UIImage {
public func fixedOrientation() -> UIImage {
if imageOrientation == UIImageOrientation.up {
return self
}
bool showAlert = YES;
Category *category = [[curArticle articleCategories] anyObject];
if (category.in_app_purchase.length > 0) {
if ([category.in_app_purchase isEqualToString:@"frei"]) {
category.in_app_purchase = nil;
[self doArticle:curArticle];
showAlert = NO;
{
"id": 227,
"title": "Linked Article",
"photos": [
{
"url": "http://d24w6bsrhbeh9d.cloudfront.net/photo/4477666_700b.jpg",
"width": "300",
"height": "100"
},
{