Skip to content

Instantly share code, notes, and snippets.

@cedricduriau
cedricduriau / progressbar.py
Created October 25, 2020 13:57
CLI/GUI Progress Bar
# stdlib modules
import sys
import time
# third party modules
from PySide2 import QtCore, QtWidgets
class AbstractProgressBar(QtCore.QObject):
# signals
@jeongho
jeongho / synology_dsm6_tips.txt
Created August 26, 2017 17:36
Synology DSM 6 tips
# restart service
sudo su -
/usr/syno/sbin/synoservice --list
/usr/syno/sbin/synoservice --restart <service_name>
# passwordless ssh
#1. fix /etc/ssh/sshd_config
AuthorizedKeyFile .ssh/authorized_keys
#2. fix acl
chmod 755 <home_directory>
@fredrikaverpil
fredrikaverpil / storefunc.py
Last active September 15, 2023 13:31
Store function on Nuke NoOp (or on nuke.root()) node and have it made available upon loading of script
"""Store function on node
Usage example:
.. code-block::
# Control node
ctrl_node_name = 'MY_SCRIPT_NODE' # if None, store on nuke.root()
# Define your functions and add them to the dictionary
@GMMan
GMMan / ubuntu-gl502vs.md
Last active July 22, 2020 15:30
Problems and Solutions for Ubuntu 16.04 LTS on ASUS ROG GL502VS Laptop

Problems and Solutions for Ubuntu 16.04 LTS on ASUS ROG GL502VS Laptop

NVIDIA Graphics

Nouveau does not appear to support Pascal cards right now, so you should use the proprietary NVIDIA driver, available from the Additional Drivers applet.

Panel Dithering

@justinfx
justinfx / file_model_filters.py
Created November 8, 2016 10:07
Using proxy model to apply custom file extension filtering to a QFileSystemModel
"""
Example of using a proxy model to apply custom
filtering to a QFileSystemModel
RE: https://groups.google.com/d/topic/python_inside_maya/a2QM_KvgfeI/discussion
Justin Israel
justinisrael@gmail.com
"""
from PySide import QtCore, QtGui
@timmwagener
timmwagener / pyside_ui_singleton_example.py
Last active June 28, 2016 10:02
Quick pattern of how to enforce UI singletons.
# -*- coding: utf-8 -*-
import logging
from PySide import QtGui
from PySide import QtCore
def delete_instances(widget_type):
"""Search for all instances of widget_type and delete them. We find them
by class name instead of type since this is safer with all the reload() action
@pawelszydlo
pawelszydlo / transmission_remove_finished.sh
Last active March 23, 2024 19:42
Script to clear finished torrents from transmission-daemon
#!/bin/bash
# Clears finished downloads from Transmission.
# Version: 1.1
#
# Newest version can always be found at:
# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a
#
# Server string is resolved in this order:
# 1. TRANSMISSION_SERVER environment variable
@Zulko
Zulko / moviepy_time_accuracy.py
Created November 13, 2014 15:55
Checking MoviePy's time accuracy
"""
This script checks the time accuracy of MoviePy.
First, a one-hour video is generated, where the frame
at time t displays t (in seconds, e.g. '1200.50') in white
on a black baground.
Then we ask MoviePy to open this video file, fetch
different times (1200.5, 850.2, 2000.3, 150.25, 150.25),
extract the corresponding frame as a JPEG image file, and

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@seanfisk
seanfisk / pyside_version.py
Last active August 29, 2015 13:56
PySide Version Script
#!/usr/bin/env python
# Script to dump as much information as possible about the current platform,
# Python, PySide, and Qt.
#
# On platforms with wget, you may run with:
#
# wget -q -O - https://gist.githubusercontent.com/seanfisk/9194547/raw/pyside_version.py | python -
#