Skip to content

Instantly share code, notes, and snippets.

@moxuse
moxuse / gist:5481055
Created April 29, 2013 11:27
Xcode Indexing
defaults write com.apple.dt.XCode IDEIndexDisable 1
defaults write com.apple.dt.XCode IDEIndexDisable 0
@moxuse
moxuse / gist:5440295
Last active December 16, 2015 13:18
QuickTime Player 第二画面フルスクリーン AppleScript
tell application "QuickTime Player"
open file "YOUR FILE"
activate
set the looping of document 1 to true
set the bounds of the first window to {-1920, 0, 0, 1080}
end tell
tell application "System Events"
keystroke "f" using command down
end tell
@moxuse
moxuse / gist:5393551
Last active December 16, 2015 06:39
プロセス監視AppleScript
on idle
tell application "System Events"
set ProcessList to name of every process
if "YOUR_APPNAME" is not in ProcessList then
tell application "YOUR_APPNAME" to launch
end if
end tell
return 30
end idle
p = PlusFreqScopeWindow.new
@moxuse
moxuse / iOS object debug pattern
Created January 25, 2013 03:51
iOS object debug pattern
- (id)init
{
self = [super init];
if (self)
{
NSLog(@"%@: %@", NSStringFromSelector(_cmd), self);
}
return self;
}
- (void)dealloc
on idle theObject
set x to (do shell script "diskutil list")
if "ramdisk" is not in x then
try
do shell script "diskutil erasevolume HFS+ 'ramdisk' `hdiutil attach -nomount ram://8388608`"
end try
end if
return 60
end idle
@moxuse
moxuse / gist:4256745
Created December 11, 2012 08:09
Auto sensor value speaker of cosm.com feed 87638 (Circuit Lab Environmental Sensors)
(
t = Task ({
inf.do ({
var dataList, en_subject, jp_subject;
dataList = Array.new;
en_subject = "";
jp_subject = "";
x = DOMDocument.new;
x.parseXML( "curl --request GET \ --header \"X-ApiKey: APIKEY\" \ http://api.cosm.com/v2/feeds/87638.xml".unixCmdGetStdOut; );
@moxuse
moxuse / gist:4256067
Created December 11, 2012 05:14
Parse cosm.com's XML feed
x = DOMDocument.new;
x.parseXML( "curl --request GET \ --header \"X-ApiKey: APIKEY_HERE\" \ http://api.cosm.com/v2/feeds/FEED_NUM.xml".unixCmdGetStdOut; );
m = x.getElementsByTagName("data");
m.do({arg item;
var child;
v = item.getAttribute("id");
child = item.getChildNodes;
@moxuse
moxuse / OSCThreadedObject.h
Created December 11, 2012 02:06
openframeworks OSC Recieveのスレッディング サンプル
#define PORT 5000
#import "ofmain.h"
#include "ofxOsc.h"
#include "User.h"
class OSCThreadedObject : public ofThread {
private:
ofxOscReceiver receiver;
@moxuse
moxuse / gist:4239726
Created December 8, 2012 10:30 — forked from reprimande/gist:4239620
play binary by supercollider
(
s.waitForBoot {
var rootPath, window, view,
drawBuf, bufnum, sound, task,
width, height, fps, curX, curY, pixSize,
processFunc, loadFile;
// initial settings
rootPath = "/path/to/root/dir";
pixSize = 5;