This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect stdout at every level to /dev/null | |
import os | |
import io | |
import sys | |
import ctypes | |
from contextlib import contextmanager | |
@contextmanager | |
def stdout_redirector(stream): | |
original_stdout_fd = sys.stdout.fileno() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Playing around with QMainWindow's nested within each other | |
as dock widgets. | |
""" | |
from random import randint | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
# ------------------------------------------------------------------------------ | |
import sys | |
import uuid | |
import json | |
from random import randint | |
from PySide import QtCore, QtGui | |
NODES = [] | |
HIERARCHY = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clear_layout(self, layout): | |
while layout.count(): | |
child = layout.takeAt(0) | |
if child.widget() is not None: | |
child.widget().deleteLater() | |
elif child.layout() is not None: | |
clear_layout(child.layout()) | |
def clear_layout(self, layout): | |
for x in reversed(range(layout.count())): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""PySide2 & OpenGL sample""" | |
import sys | |
from PySide2 import QtCore, QtWidgets, QtOpenGL | |
try: | |
from OpenGL.GL import * | |
except ImportError: | |
app = QtWidgets.QApplication(sys.argv) |