Skip to content

Instantly share code, notes, and snippets.

@osdrv
osdrv / elections_viewer.scpt
Created March 3, 2012 09:46
elections_viewer.scpt
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
on killAppRunning(appName)
try
tell application "System Events"
set pid to unix id of process (appName) as Unicode text
do shell script "kill " & pid
end tell
@osdrv
osdrv / json_proxy.rb
Created February 15, 2012 14:25
json-p proxy for any json
#encoding: utf-8
class Object
def try(method)
send method if respond_to? method
end
end
require "eventmachine"
require "evma_httpserver"
bool createMovieFromURL(string urlIn, Movie &movie){
char * url = (char *)urlIn.c_str();
Handle urlDataRef;
OSErr err;
urlDataRef = NewHandle(strlen(url) + 1);
if ( ( err = MemError()) != noErr){ ofLog(OF_LOG_ERROR,"createMovieFromURL: error creating url handle"); return false;}
BlockMoveData(url, *urlDataRef, strlen(url) + 1);
import processing.video.*;
import processing.opengl.*;
final static short DISPLAY_WIDTH = 1400;
final static short DISPLAY_HEIGHT = 800;
Movie movie;
public void setup() {
background(0);
// MyApp.h
#pragma once
#include "ofMain.h"
class MyApp : public ofBaseApp{
public:
void setup();
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
#include "cinder/url.h"
#include "cinder/qtime/QuickTime.h"
#define DISPLAY_WIDTH 1480
#define DISPLAY_HEIGHT 800
#define STREAM_URL "http://zz.zz.zz.zz/master.m3u8?cid=some_cool_id"
//#define STREAM_URL "http://some_internal_domain/video.mp4"
@osdrv
osdrv / openframeworks.log
Created February 5, 2012 18:25
openframeworks log output on .m3u8 videostream loading
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys001
[Switching to process 2875 thread 0x0]
OF: OF_LOG_WARNING: ofBaseVideoPlayer::setPixelFormat not implemented
OF: OF_LOG_ERROR: createMovieFromURL: error loading url
@osdrv
osdrv / libcinder.log
Created February 5, 2012 18:19
libcinder log output on .m3u8 videostream loading
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys001
[Switching to process 3182 thread 0x0]
terminate called throwing an exceptionsharedlibrary apply-load-rules all
warning: Could not find object file "/Users/andrewfb/Code/cinder_0.8.3_mac/xcode/build/cinder.build/Debug/cinder.build/Objects-normal/i386/App.o" - no debug information available for "App.cpp".
class ContractFile < ActiveRecord::Base
belongs_to :contract
has_attached_file :data,
:url => "/assets/paperclip/:parent_id/:attachment/:id/:style/:filename"
#:url => '/public/system/:attachment/foto_:basename.:extension',
#:url => '/assets/:id/foto_:basename.:extension'
validates_attachment_size :data, :less_than => 5.megabytes
@osdrv
osdrv / DocumentObjectSketch.pde
Created January 11, 2012 13:10
processing document object model
import processing.opengl.*;
import document_object.*;
Window window;
void setup() {
this.window = new Window( this, 640, 480, OPENGL );
background( 0 );
MyDocumentObject o = new MyDocumentObject( this );
window.appendChild( o );