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 January 20, 2024 00:21
Shell script to create a Python project
View createPythonProject.sh
#!/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
View backup_using_rsync.scpt
-- 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
View vscode_settings.json
{
// 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
View pyqt5_second_window.py
#!/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
View download_zip_file.py
#!/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+
View FetchAndParseJSON.java
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
View kiel-harbour-passengers.py
#!/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
View csv_to_excel.py
#!/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
View kiel_bankruptcies.py
#!/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
View uk_general_election_2019.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
UK General Election 2019
Version: 1.1
Python 3.8
Date created: 28.12.2019
"""