Skip to content

Instantly share code, notes, and snippets.

View MrLixm's full-sized avatar
🥑
don't mind me, just starting a 16th personal project

Liam Collod MrLixm

🥑
don't mind me, just starting a 16th personal project
View GitHub Profile
@yantor3d
yantor3d / unload_pkg
Created September 11, 2023 20:37
A Python script to unload all modules within a package
"""Python utilies."""
import os
import sys
def unload(pkg):
"""Unload all imports from the given package.
Args:
@harut-harutyunyan
harut-harutyunyan / shuffle_convert.py
Created November 30, 2022 09:58
Convert nuke Shuffle2 to Shuffle
import nuke
DELETE_AFTER = False
COLOR_CODE = True
COLOR_CODE_COL = 4282078975
NUKE_VERSION = nuke.NUKE_VERSION_MAJOR + nuke.NUKE_VERSION_MINOR/10
DEFAULT_MAPPINGS = "4 rgba.red 0 0 rgba.red 0 0 rgba.green 0 1 rgba.green 0 1 rgba.blue 0 2 rgba.blue 0 2 rgba.alpha 0 3 rgba.alpha 0 3"
@aras-p
aras-p / building_oiio.md
Last active September 7, 2023 07:59
Building OpenImageIO from source locally

Windows

OIIO build instructions currently just say this for Windows:

Method 1 - from source I really need someone to write correct, modern docs about how to build from source on Windows.

So I decided to figure that out.

Easiest: get Blender first :)

@345161974
345161974 / qtableview_demo.py
Created February 28, 2017 08:31
PyQt QTableView with CheckBox and Model Update demo code(PyQt 4.8.7, Python 3.4.3)
''' pqt_tableview3.py
explore PyQT's QTableView Model
using QAbstractTableModel to present tabular data
allow table sorting by clicking on the header title
used the Anaconda package (comes with PyQt4) on OS X
(dns)
'''
#coding=utf-8
@msrose
msrose / combining-git-repositories.md
Last active May 4, 2024 15:58
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@mastbaum
mastbaum / custom_directive.py
Created May 10, 2012 20:32
Example of a custom ReST directive in Python docutils
'''Example of a custom ReST directive in Python docutils'''
import docutils.core
from docutils.nodes import TextElement, Inline
from docutils.parsers.rst import Directive, directives
from docutils.writers.html4css1 import Writer, HTMLTranslator
class foo(Inline, TextElement):
'''This node class is a no-op -- just a fun way to define some parameters.
There are lots of base classes to choose from in `docutils.nodes`.