Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃

Ahmed Fathy Ahmed7fathi

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

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@Ahmed7fathi
Ahmed7fathi / QImageViewer.py
Created Jan 5, 2020 — forked from acbetter/QImageViewer.py
Image Viewer Example by PyQt5 and Python 3
View QImageViewer.py
#!/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 Jan 1, 2020 — forked from 345161974/qtableview_demo.py
PyQt QTableView with CheckBox and Model Update demo code(PyQt 4.8.7, Python 3.4.3)
View qtableview_demo.py
''' 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 Jun 15, 2019 — forked from awesomebytes/threaded_function_python.md
Make a function or method threaded in python with a decorator
View threaded_function_python.md

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 — forked from codemedic/konsole-with-palette-colours.css
CSS for KDE Konsole minimal, lighter, dark tabs
View konsole-with-palette-colours.css
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 Apr 14, 2018 — forked from sloria/recorder.py
WAV recording functionality using pyaudio
View recorder.py
# -*- 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):