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
# Install WireGuard client on RaspberryPi | |
# 1 # download config file from web ui, for example ~/Downloads/client.conf | |
# 2 # Install pivpn and Wireguard client for RaspberryPi | |
sudo -i | |
apt update | |
apt dist-upgrade -y | |
curl -L https://install.pivpn.io | bash | |
# non interactive installation manual: https://docs.pivpn.io/install/ |
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
version: '3.4' | |
services: | |
vpn: | |
image: weejewel/wg-easy | |
container_name: vpn | |
restart: always | |
environment: | |
- WG_HOST=[IP ADDRESS OF YOUR SERVER] | |
- PASSWORD=[PASSWORD FOR WEB UI] |
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
import maya.OpenMaya as om | |
def resolve_file_path_callback(retCode, fileObject, clientData): | |
old_path = fileObject.rawFullName() | |
new_path = resolve_path(old_path) # fome resolve function | |
if new_path: | |
print('Resolved path {} => {}'.format(old_path, new_path)) | |
fileObject.setRawFullName(new_path) | |
om.MScriptUtil.setBool(retCode, True) |
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
from PySide6.QtWidgets import * | |
from PySide6.QtCore import * | |
from PySide6.QtGui import * | |
class CourseWidget(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.setWindowFlags(Qt.FramelessWindowHint | Qt.Tool) |
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
from pytube import Playlist, YouTube, Stream | |
import re | |
from pathlib import Path | |
PLAYLIST_URL = 'https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXX' | |
SAVE_PATH = Path('~/yt').expanduser() | |
skip_chars = r"""!"#$%&'()*+,./:;<=>?@[\]^`{|}~""" |
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
from PySide2.QtWidgets import * | |
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
class TransparentWidget(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.setAttribute(Qt.WA_TranslucentBackground, True) | |
self.setWindowFlags(Qt.FramelessWindowHint) |
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
from pymel.core import * | |
class CopyOffset(object): | |
def __init__(self): | |
self.offs_mx = None | |
with window(): | |
with verticalLayout(): | |
button(label='Copy', command=Callback(self.copy)) | |
button(label='Paste', command=Callback(self.paste)) |
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
import tarfile | |
import hashlib | |
import timeit | |
import os | |
from pathlib import Path | |
# create random test files | |
files_to_archive = [] | |
for i in range(5): |
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
from PySide2.QtGui import * | |
from PySide2.QtCore import * | |
from PySide2.QtWidgets import * | |
def create_icon(text, bg_color, text_color='white', size=64): | |
pix = QPixmap(QSize(size, size)) | |
pix.fill(Qt.black) | |
painter = QPainter() |
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
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
from PySide2.QtWidgets import * | |
from pymel.core import * | |
text = '''<h2>Title</h2> | |
Some text | |
<a href="https://google.com">Help</a> |