Skip to content

Instantly share code, notes, and snippets.

View stephanschulz's full-sized avatar

Stephan Schulz stephanschulz

View GitHub Profile
@stephanschulz
stephanschulz / main.cpp
Created April 22, 2016 23:14
ofxcv multiple contour finders
#include "ofApp.h"
int main() {
ofSetupOpenGL(640, 480, OF_WINDOW);
ofRunApp(new ofApp());
}
@stephanschulz
stephanschulz / main.cpp
Created April 25, 2016 17:36
OF 0.9.3 gpu opencv
#include "ofApp.h"
int main() {
ofSetupOpenGL(640, 480, OF_WINDOW);
ofRunApp(new ofApp());
}
@stephanschulz
stephanschulz / gist:c72134d6dd56d6f2b9f04684793c21e6
Created April 26, 2016 00:36
apothecary opencv formula error
kinder:apothecary stephan$ /Applications/openFrameworks-0.9.3-master/scripts/apothecary/apothecary update ofxOpencv
----- opencv -----
Downloading "opencv"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 120 0 120 0 0 151 0 --:--:-- --:--:-- --:--:-- 151
100 72.6M 0 72.6M 0 0 1508k 0 --:--:-- 0:00:49 --:--:-- 1660k
@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
@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;
[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
[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 --
@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
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);
# 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