Skip to content

Instantly share code, notes, and snippets.

@nocarryr
nocarryr / photo.py
Created October 23, 2015 19:55 — forked from knowuh/photo.py
Blender script to turn an image data block into 3D cubes...
#----------------------------------------------------------
# File photo.py - cubify a named image in project.
# @knowuh (Noah Paessel) http://bit.ly/photoblend
# License: MIT ( http://opensource.org/licenses/MIT )
#----------------------------------------------------------
import bpy
from random import uniform
@nocarryr
nocarryr / ies2cycles.py
Created October 28, 2015 18:34 — forked from AngryLoki/ies2cycles.py
IES to Cycles addon for new nodetree system! It only works for trunk builds of blender 2.66 and later versions!!! Thread on blenderartists.org: http://blenderartists.org/forum/showthread.php?276063 Old outdated version (no rig) for official 2.66 release (old nodetrees): https://gist.github.com/Lockal/5313485
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nocarryr
nocarryr / bitrpc.py
Last active November 20, 2015 16:24
Python bitcoin rpc client removed from bitcoin core in 9f5edb9
#! /usr/bin/env python
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
@nocarryr
nocarryr / main.py
Created July 26, 2016 22:50
Simple test of RtlSdrTcpClient on Android
import os
os.environ['RTLSDR_CLIENT_MODE'] = 'true'
from rtlsdr import RtlSdrTcpClient
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import StringProperty, BooleanProperty, ObjectProperty
kv = '''
import random
import ctypes
import operator
import cProfile
import pstats
import os
import argparse
from time import time
import numpy
from numpy import frombuffer, complex64, empty, mean, ctypeslib
@nocarryr
nocarryr / benford.py
Created October 20, 2016 00:10
Benford's Law
#! /usr/bin/env python
import argparse
def get_first_digit(i):
return int(str(i)[0])
def run(iterations):
i = 0
n = 1
@nocarryr
nocarryr / videoscale.pde
Last active June 21, 2018 17:24
Processing test for realtime video scale
import processing.video.*;
Movie movie;
void setup()
{
size(1280, 720, P3D);
movie = new Movie(this, "/mnt/resource/renderfiles/seriouslytoomanymonkeys/0001-0227_crf18.mov");
movie.frameRate(24);
movie.loop();
@nocarryr
nocarryr / imagescale.pde
Created June 21, 2018 17:19
Processing test for image scaling
PImage srcImg;
PImage dstImg;
Float scaleW;
Float scaleH;
void setup()
{
size(1280, 720);
srcImg = loadImage("/mnt/resource/Shared Projects/modeling/testpatterns/1920x1080.png");
scaleW = float(width) / float(srcImg.width);
import codeanticode.syphon.*;
PGraphics srcCanvas;
PGraphics dstCanvas;
boolean srcReady;
SyphonClient client;
SyphonServer server;
void setup()
{
import os
import argparse
import cProfile
import pstats
from itertools import zip_longest
import numpy as np
def build_data(num_bytes):
a = np.arange(256, dtype=np.uint8)