Skip to content

Instantly share code, notes, and snippets.

View stephanschulz's full-sized avatar

Stephan Schulz stephanschulz

View GitHub Profile
#include "ofApp.h"
float theta,theta2;
//--------------------------------------------------------------
void ofApp::setup(){
theta = 0;
theta2 = PI/2;
@stephanschulz
stephanschulz / main.cpp
Created September 4, 2016 14:49
reset app via setup() call
#include "ofMain.h"
#include "ofApp.h"
//========================================================================
int main( ){
ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
#include "ofApp.h"
int cnt = 0;
//--------------------------------------------------------------
void ofApp::setup(){
fbo.allocate(ofGetWidth(), ofGetHeight());
fbo.begin();
ofClear(0,0,0);
fbo.end();
offsetX = 8;
# save-webpage.py
# http://programminghistorian.org/lessons/code-reuse-and-modularity
# modifications needed to run on raspberry pi with python 3
# http://stackoverflow.com/questions/2792650/python3-error-import-error-no-module-name-urllib
import urllib
from urllib.request import urlopen
import time
char myScript[255];
sprintf(myScript, "osascript -e 'try' -e 'mount volume \"smb://192.168.1.237/admin/Desktop\" as user name \"HERE_ADD_YOUR_USERNAME\" with password \"HERE_ADD_YOUR_PASSWORD\"' -e 'end try'");
std::system(myScript);
@stephanschulz
stephanschulz / gist:bccfb2f3f7ebb9bdebcfcbcc7a372a19
Created June 6, 2016 19:51
check system preferences scheduled shutdown time and exit OF app just before
//--------------------------------------------------------------
void ofApp::setup(){
string path = "/Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist";
ofFile file;
file.open(path); // open a file
ofBuffer buffer = file.readToBuffer(); // read to a buffer
// ofXml XML;
// XML.loadFromBuffer( buffer.getText() ); // now get the buffer as a string and make XML
[notice ] ofxVideoRecorder: setupCustomOutput
[notice ] videoRecorder: start
[ error ] ofxVideoDataWriterThread: 12:02:37:528 - write to PIPE failed with error -> 32 - Broken pipe.
[ error ] ofxVideoDataWriterThread: 12:02:37:572 - write to PIPE failed with error -> 32 - Broken pipe.
[ error ] ofxVideoDataWriterThread: 12:02:37:636 - write to PIPE failed with error -> 32 - Broken pipe.
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
WARNING: library configuration mismatch
avutil configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --
[notice ] ofxVideoRecorder: setupCustomOutput
[notice ] videoRecorder: start
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
WARNING: library configuration mismatch
avutil configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
avcodec configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clan
@stephanschulz
stephanschulz / gist:a58e65c3f597a7292a3c150b92aa669e
Created April 29, 2016 17:35
mount remote computer and copy file via OF
char myScript[255];
sprintf(myScript, "osascript -e 'try' -e 'mount volume \"smb://10.111.222.5/admin/Desktop\" as user name \"admin\" with password \"hemmer\"' -e 'end try'");
std::system(myScript);
ofFile file;
string toPath = "/Volumes/Desktop";
string fromPath = ofToDataPath("2016.mov");
ofLog()<<"from: "<<fromPath;
ofLog()<<"to: "<<toPath;
@stephanschulz
stephanschulz / videoRecorder.h
Created April 27, 2016 01:02
ofxVideoRecorder object
//
// videoRecorder.h
// ofxVideoRecorderExample_ROI
//
// Created by Stephan Schulz on 2016-04-15.
//
//
/*
install homebrew via http://brew.sh