Skip to content

Instantly share code, notes, and snippets.

@bytezen
bytezen / ImageTiler.py
Created August 18, 2011 17:18 — forked from sansumbrella/ImageTiler.py
Walks directory for image files and merges them into a large sheet at a fixed individual size.
#!/usr/bin/env python
# encoding: utf-8
import Image
import sys
import os
def main():
path = "where-images-may-live"
@bytezen
bytezen / Mandlebrot.py
Created August 8, 2012 06:11
Mandlebrot implementation in Python with numpy, pygame
import pygame
from pygame import surfarray
from pygame.locals import *
import sys, numpy as n
# Based on code from D. Shiffman (http://processing.org/learning/topics/mandelbrot.html)
# and P. Bourke (http://paulbourke.net/fractals/mandelbrot/)
def main():
@bytezen
bytezen / isosurface.py
Created August 14, 2012 05:39
playing with metaballs
'''
Created on Aug 10, 2012
@author: spellrh
'''
import numpy as n
import pygame
from pygame.locals import *
from pygame import surfarray
@bytezen
bytezen / generative_patterns.py
Created August 28, 2012 00:50
Maya/Python - Generative Patterns
import maya.cmds as mc
import math
import random
def clr():
"""
helper function that will clear all primitives from the screen
"""
mc.select(all=True)
mc.delete()
@bytezen
bytezen / random_pattern.py
Created August 28, 2012 01:06
Maya/Python - Random Patterns
import maya.cmds as mc
import math
import random
def uniformRandom():
for i in range(100):
mc.polyCube()
x = random.uniform(-1,1) * 5 # these are the same
z = random.random() * 10 - 5 # this does the same as above
mc.move(x,0.,z)
@bytezen
bytezen / logger.py
Created September 6, 2012 21:58
Logging in Python
'''
Code from InventWithPython.com - "stop using print for debugging"
http://inventwithpython.com/blog/2012/04/06/stop-using-print-for-debugging-a-5-minute-quickstart-guide-to-pythons-logging-module/
'''
# Print log to the screen
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
void setup() {
size(600, 600);
background(0);
smooth();
translate(300, 300);
for (float i=0; i<360; i += 0.5) { // bump by .5 for ellipses, 1 for others
pushMatrix();
rotate(radians(i));
translate(0, 200);
rotate(radians(i*3));
@bytezen
bytezen / resources.md
Last active August 29, 2015 14:10 — forked from teropa/resources.md

Tutorials

Get Command Line Tools

This is required to build some of the pacakages that Homebrew will install. Get the command line tools for Apple Developer. This is included with XCode, but I don't want the heavy XCode download so I opt for the lighter Command Line Tools.

Fork thoughtbot/laptop

A write-up on the use of this step from the project authors. Thoughtbot has a useful script for setting up a Mac development environment. If you want to use their script as is then you can navigate to their Git repository and follow the instructions on the ReadMe. If you want to customize the install script then fork their repository and customize as needed. Their code is very well commented and you can use their code as a template for your packages. sit back and chill, this'll take a minute (might I suggest some: Keziah Jones ??)

// from http://ntt.cc/2008/02/10/4-ways-to-dynamically-load-external-javascriptwith-source.html
// TODO: will make mddn242 specific examples
// you need to put an escape character before the closing </script> tag, like this: <\/script>
1. use document write
<script language="javascript">
document.write("<script src='other.js'><\/script>");
</script>