Skip to content

Instantly share code, notes, and snippets.

View niftycode's full-sized avatar
🏠
Working from home

Bodo Schönfeld niftycode

🏠
Working from home
View GitHub Profile
@niftycode
niftycode / createPythonProject.sh
Last active March 29, 2024 15:45
Shell script to create a Python project
#!/bin/bash -
#===============================================================================
#
# FILE: createPythonProject.sh
#
# USAGE: ./createPythonProject.sh
#
# DESCRIPTION: Create a new Python project
#
# VERSION: 1.3
@niftycode
niftycode / backup_using_rsync.scpt
Created November 24, 2021 06:57
Backup data on macOS using Apple Script and rsync
-- Backup data using rsync
-- Version 1.0
-- Create a List Menu
set usbList to {"1b", "1c"}
set usbList to choose from list usbList with prompt "Bitte ein Sicherungsziel auswählen:" default items {"1b"}
-- If the user cancels the process, a dialog is displayed
if usbList is false then
beep
@niftycode
niftycode / vscode_settings.json
Created August 5, 2021 07:33
VS Code settings for flake8 and autopep8
{
// Whether to lint Python files
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
// Path to flake8 executable
"python.linting.flake8Path": "/Library/Frameworks/Python.framework/Versions/3.9/bin/flake8",
// Flake8 Arguments
@niftycode
niftycode / pyqt5_second_window.py
Created July 15, 2021 14:43
Create a second window containing QRadioButtons
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Create a second window (QWidget)
Version: 1.0
Python 3.8+
Date created: July 15th, 2021
Date modified: -
@niftycode
niftycode / download_zip_file.py
Created May 12, 2021 07:29
Download and unzip a ZIP file using Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Download and unzip a ZIP file
Version: 1.0
Python 3.7+
Date created: May 12th, 2021
Date modified: -
@niftycode
niftycode / FetchAndParseJSON.java
Last active April 16, 2021 08:58
Example how to fetch and parse JSON data in Java 11+
package de.niftycode;
import org.json.JSONArray;
import org.json.JSONObject;
import java.net.URI;
import java.net.http.HttpClient; // < New in Java 11, can also handle HTTP/2 requests!
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
@niftycode
niftycode / kiel-harbour-passengers.py
Created February 1, 2021 10:10
Use pandas and matplotlib to show the passenger numbers in the port of Kiel
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Passengers - Kiel Harbour (1988-2019)
The data is provided by the City of Kiel, Germany
https://www.kiel.de/opendata/kiel_transport_verkehr_hafen_passagiere_insgesamt.csv
Version: 1.0
Python 3.8+
@niftycode
niftycode / csv_to_excel.py
Created June 4, 2020 08:16
Read a CSV file and save the data as Excel file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Cargo Handling (Port of Kiel, Germany)
For more information see: https://opendata.schleswig-holstein.de/dataset/guterumschlag-im-kieler-hafen
Version: 1.0
Python 3.7+
Date created: 03.06.2020
@niftycode
niftycode / kiel_bankruptcies.py
Created January 5, 2020 13:52
The bankruptcies in Kiel, Germany
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Unternehmensinsolvenzen in Kiel
The data is provided by the Open Data Portal Schleswig-Holstein, Germany
https://opendata.schleswig-holstein.de/dataset/unternehmensinsolvenzen-in-kiel
Version: 1.0
Python 3.8
@niftycode
niftycode / uk_general_election_2019.py
Last active December 29, 2019 10:47
UK General Election 2019 Bar Chart
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
UK General Election 2019
Version: 1.1
Python 3.8
Date created: 28.12.2019
"""