Skip to content

Instantly share code, notes, and snippets.

@osiriswrecks
osiriswrecks / git-origins.md
Created June 20, 2019 04:45 — forked from benschw/git-origins.md
fork a repo manually (set source as upstream origin) rather than with the "fork" button. e.g. for in github when you want to fork a project twice.

Ripped off from adrianshort.org

List curent remotes

$ git remote -v

origin  https://github.com/hakimel/reveal.js.git (fetch)
origin  https://github.com/hakimel/reveal.js.git (push)

Rename origin to upstream and add our new empty repo as the origin.

@osiriswrecks
osiriswrecks / console_intercept.py
Last active June 6, 2022 13:05
How to intercept stdout with Python in Blender
import sys
import contextlib
import io
class ConsoleReader(io.StringIO):
def __init__(self, stream):
super().__init__()
self.stream = stream
def enable(self):
@osiriswrecks
osiriswrecks / bpy_in_terminal.py
Created January 12, 2023 03:27
Accessing Blender's Python console from a terminal
'''
If you ever need to install, enable, or debug an add-on that's running on a headless Blender install
(ie, on a server like AWS Deadline), then you can run Blender's Python console from the terminal directly.
This was originally posted here: https://blender.stackexchange.com/questions/73759/install-addons-in-headless-blender, but
I'm saving in a Gist for future me and others.
First, run this in the terminal:
blender -b --python-console