This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)captureOutput:(AVCaptureOutput *)captureOutput | |
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer | |
fromConnection:(AVCaptureConnection *)connection | |
{ | |
if (connection.isVideoMinFrameDurationSupported && connection.videoMinFrameDuration.timescale != FPS) { | |
connection.videoMinFrameDuration = CMTimeMake(1, FPS); | |
} | |
if (connection.isVideoMaxFrameDurationSupported && connection.videoMaxFrameDuration.timescale != FPS) { | |
connection.videoMaxFrameDuration = CMTimeMake(1, FPS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSImage+Grayscale.h | |
// | |
// Created by Panupan Sriautharawong on 8/7/12. | |
// | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface NSImage (Grayscale) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGContextSetBlendMode([[NSGraphicsContext currentContext] graphicsPort], kCGBlendModeScreen); | |
CGContextSetRGBFillColor ([[NSGraphicsContext currentContext] graphicsPort], 1, 1, 1, .8); | |
CGContextFillRect([[NSGraphicsContext currentContext] graphicsPort], self.backgroundRect); | |
CGContextSetBlendMode([[NSGraphicsContext currentContext] graphicsPort], kCGBlendModeColor); | |
CGContextSetRGBFillColor ([[NSGraphicsContext currentContext] graphicsPort], 1, 1, 1, 1); | |
CGContextFillRect([[NSGraphicsContext currentContext] graphicsPort], self.backgroundRect); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-activerecord' | |
gem 'sqlite3' | |
gem 'require_all' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (int)instanceCount { | |
int i = 0; | |
NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; | |
for (NSRunningApplication *app in [[NSWorkspace sharedWorkspace] runningApplications]) { | |
if ([appName isEqualToString:[app localizedName]]) i++; | |
} | |
return i; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BACKUP_DIR='/backups/S3 Mirror/' | |
BUCKETS=$(s3cmd ls | grep s3 | awk '{ print $3 }') | |
for i in $BUCKETS; do | |
CURRENT_DIR=$BACKUP_DIR${i//s3:\/\//}/ | |
echo Mirroring $i to $CURRENT_DIR | |
mkdir -p "$CURRENT_DIR" | |
s3cmd sync --verbose --no-check-md5 --recursive --no-delete-removed $i "$CURRENT_DIR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RespondersView.h | |
// RespondersView | |
// | |
// Created by Panupan Sriautharawong on 9/13/11. | |
// Copyright 2011 Panupan.com. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// VBox.h | |
// VBox | |
// | |
// Created by Panupan Sriautharawong on 9/23/11. | |
// Copyright 2011 Panupan.com. All rights reserved. | |
// | |
@interface WILLVBox : NSView { | |
NSColor *backgroundColor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================================================== | |
// Project: RecordBug | |
// Copyright: @2011 My Company, Inc. | |
// ========================================================================== | |
/*globals RecordBug */ | |
RecordBug = SC.Application.create({ | |
store: SC.Store.create().from(SC.Record.fixtures) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post < ActiveRecord::Base | |
default_scope :order => 'created_at DESC' | |
end |
NewerOlder