Skip to content

Instantly share code, notes, and snippets.

View robotconscience's full-sized avatar

Brett Renfer robotconscience

View GitHub Profile
@robotconscience
robotconscience / DataToAirtable.js
Last active June 7, 2024 15:29
Import Met data into Airtable
// Ask for an ObjectID
let objectID = await input.textAsync("Input an Object ID")
// get result from objectID
let apiURL = "https://collectionapi.metmuseum.org/public/collection/v1/objects/" + objectID
let results = await fetch(apiURL)
let json = await results.json()
if (json.hasOwnProperty("message")){
@robotconscience
robotconscience / batch_export_variants.py
Last active January 29, 2024 16:04
Blender - glTF Variants -> individual USDZs
# exports each selected object into its own file
import bpy
import os
# export to blend file location
basedir = os.path.dirname(bpy.data.filepath)
if not basedir:
raise Exception("Blend file is not saved")
@robotconscience
robotconscience / SelectAudioOutput.mm
Created April 8, 2015 15:07
Set CoreAudio ouput device for your app
// change this to a recognizeable piece of your audio output
// e.g. setAudioOutput("AirPlay"); or setAudioOutput("VoilaDevice");
// returns true on success / false on beef
// as always, all thanks to StackOverflow for the amazing
// enumerate devices script:
// http://stackoverflow.com/questions/1983984/how-to-get-audio-device-uid-to-pass-into-nssounds-setplaybackdeviceidentifier
// Note: if you change "kAudioDevicePropertyScopeOutput" to "kAudioObjectPropertyScopeGlobal" in line 62,
// you can set the output for your whole system...
@robotconscience
robotconscience / SvgSampler.h
Created November 18, 2014 14:52
openFrameworks SVG color sampler
#pragma once
#include "ofxSvg.h"
class SvgSampler {
public:
void load( string svgFile ){
svg.load(svgFile);
@robotconscience
robotconscience / ofxLibwebsockets_socketio_client.h
Created September 30, 2014 16:52
Start of connecting ofxLibwebsockets with socket.io. Not finished and probably won't ever be...
#include "ofApp.h"
string sid = "";
//--------------------------------------------------------------
void ofApp::setup(){
ofSetLogLevel(OF_LOG_VERBOSE);
ofxLibwebsockets::ClientOptions opts = ofxLibwebsockets::defaultClientOptions();
opts.channel = "/socket.io/1/websocket?EIO=2&transport=websocket&sid=";
opts.port = 3000;
@robotconscience
robotconscience / ofxiOSImageSharer.h
Last active August 29, 2015 14:06
openFrameworks iOS share window creation
//
// ofxiOSImageSharer.h
// Created by Brett Renfer on 9/9/14.
//
#pragma once
#import <UIKit/UIKit.h>
#include "ofMain.h"
@class ofxiOSViewController;
@robotconscience
robotconscience / ofxiOSImageSaver.h
Created September 10, 2014 16:05
openFrameworks iOS image saving
//
// ofxiOSImageSaver.h
// Colorizer
//
// Created by Brett Renfer on 9/9/14.
//
#pragma once
#include "ofMain.h"
@robotconscience
robotconscience / loadStrings.h
Created January 27, 2013 19:39
Openframeworks version of Processing's loadStrings
static vector<string> loadStrings( string file ){
static vector<string> ret;
ret.clear();
ofBuffer temp = ofFile( file ).readToBuffer();
while ( !temp.isLastLine() ){
ret.push_back( temp.getNextLine() );
cout<<ret.back()<<endl;
}
return ret;
@robotconscience
robotconscience / Ray.js
Created September 4, 2012 15:47
THREE Ray intersectObject with Sprite support
// override THREE Ray
THREE.Ray.prototype.intersectObject = function ( object, recursive ) {
var intersect, intersects = [];
if ( recursive === true ) {
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
@robotconscience
robotconscience / ofNoWindowRunner.cpp
Created June 7, 2012 18:27
Use ofAppNoWindow on OS X
//
// ofNoWindowRunner.cpp
// touchForwarder
//
// Created by Brett Renfer on 6/7/12.
// Copyright (c) 2012 Rockwell Group. All rights reserved.
//
#include "ofNoWindowRunner.h"
#include "ofAppRunner.cpp"