Skip to content

Instantly share code, notes, and snippets.

View jasperges's full-sized avatar

Jasper van Nieuwenhuizen jasperges

View GitHub Profile
@PaulSchweizer
PaulSchweizer / flow_pyblish.py
Created August 6, 2019 11:07
Pyblish with Flowpipe
"""Convert a pyblish context with collected instances to a flowpipe graph:
+----------------------------+ +----------------------------+ +-----------------------------+
| ValidatorA Instance 0 | | ExtractorA Instance 0 | | IntegratorA Instance 0 |
|----------------------------| |----------------------------| |-----------------------------|
% contexts | % contexts | % contexts |
o contexts.0<{"results"> | +--->o contexts.0<> | +--->o contexts.0<> |
o instance<{"data": {> | |--->o contexts.1<> | |--->o instance<> |
o plugin<"Validator> | |--->o instance<> | | o plugin<"Integrato> |
o step<"validate"> | | o plugin<"Extractor> | | o step<"integrate> |
@kramester
kramester / SubmitNukeToDeadline.py
Last active July 13, 2023 11:40
Bootstrapping tk-nuke to deadline instances
# this code needs to be inserted into your SubmitNukeToDeadline script if you are using deadline's submission script.
###### INSERT AFTER THIS LINE, line 1308 in my file
#if groupBatch or dialog.separateJobs.value():
# fileHandle.write(EncodeAsUTF16String("BatchName=%s\n" % batchName))
# Populating environment variables from running Nuke:
# http://developer.shotgunsoftware.com/tk-core/platform.html#sgtk.platform.create_engine_launcher
current_engine = sgtk.platform.current_engine()
launcher = sgtk.platform.create_engine_launcher(
@simonw
simonw / recover_source_code.md
Last active September 14, 2025 04:26
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active June 12, 2025 07:04
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@mottosso
mottosso / README.md
Last active September 5, 2016 06:46
Restore Script Editor focus

Problem

image

On Windows systems using Autodesk Maya, the text input field of the Script Editor doesn't regain focus after having restored focus to the main window. This event handler explicitly restores focus, if it turns out to have been the last active panel at the time of leaving the application.

Usage

Place the full contents of the script below into your userSetup.py and never again lose focus.

@carter2422
carter2422 / showErrorMessage
Created January 4, 2015 17:45
Simple Error Popup
def showErrorMessage(message, wrap=80):
lines = []
if wrap > 0:
while len(message) > wrap:
i = message.rfind(' ',0,wrap)
if i == -1:
lines += [message[:wrap]]
message = message[wrap:]
else:
lines += [message[:i]]
import bpy
from mathutils.geometry import interpolate_bezier
def get_points(spline, clean=True):
knots = spline.bezier_points
if len(knots) < 2:
return
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 31, 2025 16:45
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: