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 July 6, 2024 19:45
Shell script to create a Python project
#!/bin/bash -
#===============================================================================
#
# FILE: createPythonProject.sh
#
# USAGE: ./createPythonProject.sh
#
# DESCRIPTION: Create a new Python project
#
# VERSION: 1.4
@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 / big-o-notation.py
Last active January 21, 2024 04:29
big-o-notation graph with Python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
big-o-notation.py:
Version: 0.2
Python 3.6
Date created: 22/03/2017
'''
@niftycode
niftycode / CALayerPlaygroundExample.swift
Last active January 18, 2023 00:03
How to create a basic CALayer object in a playground (Swift 4)
//: # Introduction to CALayer
//: (Xcode 9 and Swift 4)
import UIKit
import PlaygroundSupport
//: From Apples's Support Documentation:
//:
//: > The CALayer class manages image-based content and allows you to perform animations on that content. Layers are often used to provide the backing store for views but can also be used without a view to display content.
//:
@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 / koalition.py
Last active December 1, 2021 18:01
This is an example how to count words in a text file using Python 3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Author: @niftycode
Version: 1.3
Python 3.10
Date created: February 14th, 2018
Date modified: December 1st, 2021
@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 / 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 / traffic_accidents_kiel.py
Last active June 19, 2021 16:35
Use Kiel's OpenData to visualize traffic accidents with Python and Pandas
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Traffic Accidents in Kiel, Germany
Python 3.6
last edited: May 19th, 2021
The data is provided by the City of Kiel, Germany
https://www.kiel.de/
@niftycode
niftycode / kiel_unfaelle.py
Last active June 19, 2021 15:49
Traffic Accidents in Kiel
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
kiel_unfaelle.py
version: 1.3
last edited: June 19th, 2021
The data is provided by the City of Kiel, Germany:
http://kiel.de/rathaus/statistik/open_data/index.php?id=de-sh-kiel_gesetze_justiz_strassenverkehsunfaelle_verkehrstote_verletzte_fahrerflucht
"""