Skip to content

Instantly share code, notes, and snippets.

@megafaunasoft
megafaunasoft / povray_lambda.js
Created February 2, 2015 21:23
Using AWS Lambda and povray to render images
var async = require('async');
var AWS = require('aws-sdk');
var util = require('util');
var spawn = require('child_process').spawn;
var fs = require('fs');
var s3 = new AWS.S3();
// globals
var dstBucket = "outrender1121"
@megafaunasoft
megafaunasoft / jpng.py
Created March 30, 2014 00:53
Testing JPNG file format
import os, os.path
import numpy as np
import scipy
import scipy.misc
import scipy.ndimage.morphology as morphology
import subprocess
def printarr(arr):
print "\n".join([''.join(map(str,row)) for row in arr])
@megafaunasoft
megafaunasoft / gist:6361250
Created August 28, 2013 01:50
pymc simulated data
from pymc import *
import numpy as np
import matplotlib.pyplot as pyplot
from pprint import pprint
#-----------------------------------------------------------------------------------------
# Simulated data
#
def simulated(N, weekday_mean, weekend_mean, click_mean, conversion_rate):
@megafaunasoft
megafaunasoft / gist:6152840
Last active June 4, 2019 16:35
Spectral matting in numpy/scipy
#-----------------------------------------------------------------------------------------
#
# Spectral Matting
#
import time
import logging
import numpy as np
from scipy import ndimage, sparse
import scipy.sparse.linalg as sparse_linalg
@megafaunasoft
megafaunasoft / gist:5130161
Created March 10, 2013 19:57
Blender cup with rings, Python script
import bpy, math
deg2rad = 2*math.pi/360.0
scn = bpy.context.scene
scn.cursor_location = (0,0,0)
OVERALL_SCALE = 1/8.0
cgap = 0.525 * OVERALL_SCALE
#--------------------------------------------------------------
# Delete everything for starting over