Skip to content

Instantly share code, notes, and snippets.

View AnthonyZJiang's full-sized avatar
🎓
Busy building robots 🤖

Anthony Jiang AnthonyZJiang

🎓
Busy building robots 🤖
View GitHub Profile
@JavaScriptDude
JavaScriptDude / SingleInstanceChecker.py
Last active August 15, 2023 09:02
Cross Platform Example of Single Instance Checking in Python
import time, sys, os
class SingleInstanceChecker:
def __init__(self, id):
if isWin():
ensure_win32api()
self.mutexname = id
self.lock = win32event.CreateMutex(None, False, self.mutexname)
self.running = (win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS)
@wojteklu
wojteklu / clean_code.md
Last active July 26, 2024 15:57
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules