Skip to content

Instantly share code, notes, and snippets.

View Ahmed7fathi's full-sized avatar
🙃

Ahmed Fathy Ahmed7fathi

🙃
View GitHub Profile
1×× Informational
100 Continue
101 Switching Protocols
102 Processing
2×× Success
200 OK
201 Created
@Ahmed7fathi
Ahmed7fathi / docker-help.md
Created January 30, 2020 21:05 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@Ahmed7fathi
Ahmed7fathi / QImageViewer.py
Created January 5, 2020 01:14 — forked from acbetter/QImageViewer.py
Image Viewer Example by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
@Ahmed7fathi
Ahmed7fathi / qtableview_demo.py
Created January 1, 2020 22:28 — forked from 345161974/qtableview_demo.py
PyQt QTableView with CheckBox and Model Update demo code(PyQt 4.8.7, Python 3.4.3)
''' pqt_tableview3.py
explore PyQT's QTableView Model
using QAbstractTableModel to present tabular data
allow table sorting by clicking on the header title
used the Anaconda package (comes with PyQt4) on OS X
(dns)
'''
#coding=utf-8
@Ahmed7fathi
Ahmed7fathi / threaded_function_python.md
Created June 15, 2019 17:09 — forked from awesomebytes/threaded_function_python.md
Make a function or method threaded in python with a decorator

How to make a python function or class method threaded

From this stack overflow question I got this great snippet.

# Threaded function snippet
def threaded(fn):
    """To use as decorator to make a function call threaded.
    Needs import
    from threading import Thread"""
@Ahmed7fathi
Ahmed7fathi / konsole-with-palette-colours.css
Created May 26, 2019 19:12 — forked from codemedic/konsole-with-palette-colours.css
CSS for KDE Konsole minimal, lighter, dark tabs
QTabBar,
QTabBar::tab
{
font-family: "Noto Sans";
font-size: 11px;
height: 16px;
padding: 2px;
border: 0px;
border-bottom: 3px solid palette(dark);
background-color: palette(dark);
@Ahmed7fathi
Ahmed7fathi / recorder.py
Created April 14, 2018 23:48 — forked from sloria/recorder.py
WAV recording functionality using pyaudio
# -*- coding: utf-8 -*-
'''recorder.py
Provides WAV recording functionality via two approaches:
Blocking mode (record for a set duration):
>>> rec = Recorder(channels=2)
>>> with rec.open('blocking.wav', 'wb') as recfile:
... recfile.record(duration=5.0)
Non-blocking mode (start and stop recording):