Skip to content

Instantly share code, notes, and snippets.

@zocker-160
zocker-160 / centering.py
Last active April 11, 2022 20:32 — forked from saleph/centering.py
[qt5] center a window on screen
__author__ = 'tom'
import sys
from PyQt5.QtWidgets import QWidget, QApplication
class Example(QWidget):
def __init__(self, app: QApplication):
super().__init__()
self.app = app
@zocker-160
zocker-160 / screenshot.py
Created December 21, 2020 14:41 — forked from frakman1/screenshot.py
screenshot utility
#!/usr/bin/env python
# Python screenshot tool (fullscreen/area selection)
# Ported from https://gist.github.com/initbrain/6628609
# Tested on Windows 7 64bit using PyQt5 and python 3.7
# area selection NOT working
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from subprocess import getoutput
@zocker-160
zocker-160 / screenshot.py
Created December 21, 2020 14:41 — forked from initbrain/screenshot.py
Python screenshot tool (fullscreen/area selection)
#!/usr/bin/env python
# Python screenshot tool (fullscreen/area selection)
# Tested on:
# Lubuntu 13.04 x86_64
# Gentoo 4.1.7-hardened-r1 x86_64
import sys
from PyQt4 import QtCore, QtGui
from commands import getoutput
from StringIO import StringIO
@zocker-160
zocker-160 / flappy.html
Created November 30, 2020 11:57 — forked from gullyn/flappy.html
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>