Skip to content

Instantly share code, notes, and snippets.

@jeetsukumaran
jeetsukumaran / build-gcc.sh
Last active February 27, 2025 22:17
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
@dbr
dbr / nuke_duplicate_node.py
Created April 17, 2013 00:38
Duplicate a Nuke node
import nuke
def duplicate_node(node, to_file = None):
"""Slightly convoluted but reliable(?) way duplicate a node, using
the same functionality as the regular copy and paste.
Could almost be done tidily by doing:
for knobname in src_node.knobs():
@martinth
martinth / decorators.py
Last active January 21, 2018 01:09
A sample decorator the can be used on plain old functions and also on instance methods
class func_and_method_decorator(object):
'''A clased based decorator that takes parameters and works on plain functions
and instance methods'''
def __init__(self, *args, **kwargs):
'''The init function is called when a module where the decorator is used
is imported. It gets passed all parameters that are given to decorator
definition. I.e.
@func_and_method_decorator(foo='bar')
@draconiansolo
draconiansolo / gist:6744801
Last active February 17, 2021 14:52
Self-contained nuke knobChanged callbacks...To be able to add a callback when knobs change on a group or gizmo without having to create init callback scripts on the menu.py and stuff.So it is waaay better to do it like this for copypastas :D
#based on http://forums.thefoundry.co.uk/phpBB2/viewtopic.php?t=3602&sid=7c140135632c783e7147e0e1b577eaa6
#which is most interesting...
#code="""
print 'knobChanged fired...'
n=nuke.thisNode()
k=nuke.thisKnob()
if k.name()=='number':
print 'yyyay!!!!!'
#"""
@ikennaokpala
ikennaokpala / full_proxy_setup.sh
Last active November 1, 2018 18:03
Behind enemy lines (full proxy setup)
Export your shell environment for http proxy use
export http_proxy="http://hostname:port" or save it to your shell profile. (i.e. ~/.bash_rc)
export http_proxy='http://example.proxy_name.com:80'
For multi-user installs, use sudo -E to preserve the proxy settings in your environment:
Setting git to use a proxy
git config --global url.https://github.com/.insteadOf git://github.com/
git config --global http.proxy %http_proxy%
@sloria
sloria / bobp-python.md
Last active May 28, 2025 02:41
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@astrojuanlu
astrojuanlu / bezier_curves.py
Last active September 25, 2023 13:09
Interactive Bézier curves with Python using just matplotlib.
import matplotlib
matplotlib.use('webagg')
import numpy as np
from scipy.special import binom
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
@mikeboers
mikeboers / graph.py
Created November 7, 2013 19:41
Graph the corresponding pixel values in a sequence of images to assert linearity.
from __future__ import division
from argparse import ArgumentParser
import math
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import cv2
@jinroh
jinroh / README.md
Last active June 6, 2025 17:13
Fourier series visualisation with d3.js.

From Wikipedia:

In mathematics, a Fourier series decomposes periodic functions or periodic signals into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines (or complex exponentials).

Use the bottom right form to change the visualized serie.

@julik
julik / parser.py
Created November 26, 2013 10:39
Yo dawg, I heard you like Nuke so I wrote this so that you can parse your Nuke TCL while you tickle yo' Python. Ya dig?
TERMINATORS = ["\n", ";"]
ESC = "\\"
QUOTES = ['"', "'"]
class c:
"""
Will be at the start of a list representing an expression
in curly braces. Every c() is equal to any other c()
"""