Skip to content

Instantly share code, notes, and snippets.

August "Gus" Mueller ccgus

Block or report user

Report or block ccgus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Programmable Layers in Acorn.js
function main() {
var doc = [Acorn open:"/Volumes/srv/Users/gus/Dropbox/AcornStuff/more junk.acorn"];
var layer = [doc firstLayerNamed:"Background"];
var canvasSize = [doc canvasSize];
var inset = 40;
var image = [[[NSImage alloc] initWithSize:canvasSize] autorelease];
var canvasBounds = NSMakeRect(0, 0, 0, 0);
canvasBounds.size = canvasSize;
var pageBounds = NSMakeRect(inset, -inset, canvasSize.width - inset * 2, canvasSize.height);
@ccgus
ccgus / gist:633670
Created Oct 19, 2010
NSDataOMGWTFBBQ
View gist:633670
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int *x = malloc(sizeof(int));
void *foo = x;
NSMutableData *d = [NSMutableData dataWithBytesNoCopy:foo length:sizeof(int) freeWhenDone:NO];
View gist:1037099
tell application "Acorn"
set d to open "srv:Users:gus:Pictures:MyImage.acorn"
delay 0.5
tell document 1
flip canvas direction horizontal
undo
flip canvas direction vertical
undo
View gist:1126639
#import <Foundation/Foundation.h>
@interface FMFancyObject : NSObject {
}
@end
@interface FMDeallocCheckerObjectHolder : NSObject {
__weak id _holdingObject;
View gist:1128125
#!/bin/sh
cores=`sysctl -n machdep.cpu.core_count`
cores=`jstalk -e "$cores * 4"`
rm -rf /tmp/llvm
cd /tmp/
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ..
View gist:1740787
OLD:
FMDatabase *db = [FMDatabase databaseWithPath:dbPath];
[db executeUpdate:@"insert into namedparamtest values (:a, :b, :c, :d)" withParameterDictionary:dictionaryArgs];
NEW:
FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:dbPath];
[queue inDatabase:^(FMDatabase *db) {
View gist:1740870
- (void) deleteTweetsOlderThan:(int)inMaxToKeep
{
NSArray* recent_ids = [RFTweet tweetIDsReversedForCollectionID:self.collectionID];
if ([recent_ids count] > inMaxToKeep) {
FMDatabaseQueue *queue = …
[queue inDatabase:^(FMDatabase *db) {
if (inMaxToKeep > 0) {
NSNumber* last_tweet_id = [recent_ids objectAtIndex:inMaxToKeep - 1];
View gist:1762511
function runGitWithArgsForDocument(document, args) {
task = NSTask.alloc().init().autorelease();
task.setCurrentDirectoryPath(document.fileURL().path());
task.setLaunchPath('/usr/bin/git');
task.setArguments(args);
task.launch();
task.waitUntilExit();
}
function documentWasOpened(document) {
View gist:1762539
Process: VoodooPad [82471]
Path: /tmp/*/VoodooPad.app/Contents/MacOS/VoodooPad
Identifier: com.flyingmeat.VoodooPad
Version: 5b1+ (3559)
Code Type: X86-64 (Native)
Parent Process: bash [81641]
Date/Time: 2012-02-06 20:27:13.681 -0800
OS Version: Mac OS X 10.7.3 (11D50)
Report Version: 9
View gist:1838008
- (void)changeFont:(id)sender {
// by default, the bold menu is hooked up to NSFontManagers' - (void)addFontTrait:(id)sender; Start there to debug.
// isEditable , inputContext
for (TSGraphic *graphic in [[[self document] currentLayer] selectedGraphics]) {
if (![graphic isKindOfClass:[TSTextArea class]]) {
continue;
You can’t perform that action at this time.