Skip to content

Instantly share code, notes, and snippets.

View zachlewis's full-sized avatar

zachlewis

  • Method Studios
View GitHub Profile
@dbr
dbr / nuclearPong.py
Created April 5, 2010 12:29
Pong. In Nuke.
"""Pong.
In Nuke.
"""
import nuke
import time
from random import random
import threading
@jessykate
jessykate / Jekyll nd Octopress Liquid tag for MathJax.rb
Created February 18, 2011 23:37
A simple liquid tag for Jekyll/Octopress that converts {% m %} and {% em %} into inline math, and {% math %} and {% endmath %} into block equations, by replacing with the appropriate MathJax script tags.
module Jekyll
class MathJaxBlockTag < Liquid::Tag
def render(context)
'<script type="math/tex; mode=display">'
end
end
class MathJaxInlineTag < Liquid::Tag
def render(context)
'<script type="math/tex">'
end
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active July 10, 2024 14:36
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@dbr
dbr / gist:1139639
Created August 11, 2011 13:25
More sane method of doing Nuke panel UI's
p = nukescripts.panels.PythonPanel()
# Accessible via the knob name (not the UI string \o/)
p.addKnob(nuke.String_Knob("start", "Staaaart value"))
# Or accessible via the knob object
or_this_way = nuke.String_Knob("finish", "Finish value. And it's not used for the UI!")
p.addKnob(or_this_way)
p.showModalDialog()
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@dbr
dbr / dct.py
Created August 26, 2011 10:28
Discreet Fourier Transform in Python
"""Based on Javascript from
http://madebyevan.com/dft/
This may be wrong, but seems to do what I'd expect...
"""
from __future__ import division
import sys
import math
@dbr
dbr / determine_colour_matrix.py
Created August 28, 2011 13:03
Colour matrix reverse engineer'er
"""PoC code to reverse-engineer an unknown colour-matrix applied to a
set of know pixel values
Moved to:
https://github.com/dbr/colourstuff/blob/master/lib/python/colourstuff/determine_colour_matrix.py
"""
import math
import array
import time
@dbr
dbr / ociolooktransform.nk
Created March 24, 2012 13:04
OCIOLookTransform UI prototype
set cut_paste_input [stack 0]
version 6.3 v5
push $cut_paste_input
Group {
name Group1
knobChanged "\nn = nuke.thisNode()\nas_str = n\['look_as_str'].value()\nn\['look'].setEnabled(not as_str)\nn\['look_str'].setVisible(as_str)\n\nif as_str and n\['look_str'].value() == \"\":\n n\['look_str'].setValue(n\['look'].value())\n"
selected true
xpos 140
ypos -56
addUserKnob {20 User l OCIOLookTransformTest}
@dbr
dbr / iridas_look_to_csp.py
Created March 30, 2012 05:18
IRIDAS .look to .csp LUT
"""From the seemingly undocumented IRIDAS .look format to .csp
"""
import re
import os
import sys
import struct
import binascii
import xml.etree.ElementTree as ET
@btoone
btoone / curl.md
Last active June 29, 2024 16:01
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin