Skip to content

Instantly share code, notes, and snippets.

@jeangjenq
jeangjenq / userContent.css
Created March 20, 2022 11:11
Firefox readability fix in KDE Plasma
input {
border: 2px inset white;
background-color: white;
color: black;
-moz-appearance: none !important;
}
textarea {
border: 2px inset white;
background-color: white;
color: black;
@jeangjenq
jeangjenq / findTerminal.py
Created March 20, 2022 11:05
Find terminal from any linux distro.
from distutils.spawn import find_executable
def isNot_exec(name):
#check whether terminal program exists
return find_executable(name) is None
def findTerminal():
termList = ["x-terminal-emulator", "konsole", "gnome-terminal", "urxvt", "rxvt", "termit", "terminator", "Eterm", "aterm", "uxterm", "xterm", "roxterm", "xfce4-terminal", "termite", "lxterminal", "mate-terminal", "terminology", "st", "qterminal", "lilyterm", "tilix", "terminix", "kitty", "guake", "tilda", "alacritty", "hyper"]
#list taken from https://github.com/i3/i3/blob/next/i3-sensible-terminal
i = 0
@jeangjenq
jeangjenq / rmReparsePoints.ps1
Created March 20, 2022 07:44
Delete reparse points in all directory/subdirectory/files with Powershell.
Get-ChildItem -Recurse -Attributes Reparsepoint | % { $n = $_.FullName.Trim(“\”); fsutil reparsepoint delete “$n” }
import os
from subprocess import call
#gather a list of files/directories/subdirectories
list = []
for root, directories, filenames in os.environ['OneDrive']:
for directory in directories:
list.append(os.path.join(root, directory))
for filename in filenames:
list.append(os.path.join(root, filename))
@jeangjenq
jeangjenq / listDir.py
Created March 20, 2022 07:39
A list off all directory.
[val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk('./')] for val in sublist]
@jeangjenq
jeangjenq / find.inPython.py
Last active March 20, 2022 07:38
List all directory, subdirectory and files
l = []
for root, directories, filenames in os.walk('./'):
for directory in directories:
l.append(os.path.join(root, directory))
for filename in filenames:
l.append(os.path.join(root, filename))
@jeangjenq
jeangjenq / ShuffeEXRPasses.py
Created March 20, 2022 04:29
Improved ShuffleEXRPasses from Pr_Suite for Nuke.
for layer in extract:
shuffle = nuke.nodes.Shuffle(label='[value in]')
shuffle["in"].setValue(layer)
shuffle.setInput(0, self.node)
@jeangjenq
jeangjenq / ReadFromWrite.py
Created March 20, 2022 04:27
Improved ReadFromWrite from Pr_Suite for Nuke.
def read_from_write():
"""
Create Read node from selected Write node.
:return: None
:rtype: None
"""
selected = nuke.selectedNodes()
writeNodes = []
for node in selected:
if node.Class() == 'Write':
@jeangjenq
jeangjenq / OpenFolder.py
Last active March 20, 2022 04:27
Improved OpenFolder from Pr_Suite for Nuke.
def open_folder(path):
"""
Open folder based on OS.
:param path: Directory path
:type path: str
:return: None
:rtype: None
"""
if platform.system() == "Windows":
os.startfile(os.path.abspath(path))
@jeangjenq
jeangjenq / python_snippets.py
Created March 20, 2022 03:41
Python snippets for Nuke.
# Get the last letter/section from node name, separated by "_":
nuke.thisNode().name().rsplit("_").__getitem__(2)
# From the above, can be modified to acquire file extension
nuke.thisNode()['file'].getValue().rsplit(".").__getitem__(2)
# Set expression with python found in the link below, especially useful when setting expression to a dropdown menu which is usually not accessible
# http://nuke.yellow-ant.net/set-expression-via-python/
nuke.selectedNode()['antialiasing'].setExpression('$gui? 0:3')