Skip to content

Instantly share code, notes, and snippets.

NSPopUpButton *popup = NSToolbarSizeModeSmall == [toolbar sizeMode]
? [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 40.0, 24.0)] autorelease]
: [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 48.0, 32.0)] autorelease];
[[popup cell] setControlSize:NSSmallControlSize];
[popup setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
destinationPopup = [popup retain];
[result setView:popup]; [popup release];
function clone(obj) {
if (!obj || typeof obj !== 'object') {
return obj;
}
if (obj instanceof Date) {
return new Date(obj.getTime());
}
var result,
propertyIndex,
From 57c75a248546d63e4cad8a6f3306ec18f753e484 Mon Sep 17 00:00:00 2001
From: rentzsch <[email protected]>
Date: Sat, 8 May 2010 01:09:29 -0500
Subject: [PATCH] [FIX] fs.Stats.size V8::Integer => V8::Number.
While VM::Integer::Value() offers an int64_t, V8::Integer::New() only
accepts an int32_t, truncating fs.Stat's size in BuildStatsObject().
I consider this a bug in V8, and we should move back to V8::Integer
when it gets a ctr that allows a int64_t. Until then, this work-around
From 509a940e4c9421bb75aadfdc185f196d4253b62e Mon Sep 17 00:00:00 2001
From: rentzsch <[email protected]>
Date: Sun, 16 May 2010 14:29:29 -0500
Subject: [PATCH] FIX path.dirname('/tmp') => '/'.
Previously path.dirname('/tmp') incorrectly returned '.'.
Unfortunately module.js incorrectly thinks dirname('/a/b/') should
yield '/a/b', so I can't strip trailing slashes yet. Once module.js
is fixed, then the commented-out code should be activated and a test
From ac458ba1774287c7e98d03bb95ef553a932bec73 Mon Sep 17 00:00:00 2001
From: rentzsch <[email protected]>
Date: Sun, 13 Jun 2010 01:08:14 -0500
Subject: [PATCH] NEW API: fs.seek()
---
doc/api.markdown | 4 +++
lib/fs.js | 4 +++
src/node_file.cc | 49 ++++++++++++++++++++++++++++++++++++++++++
test/fixtures/helloworld.txt | 1 +
sudo /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed
var sys = require('sys');
var assert = require('assert');
var MySQLClient = require('mysql').Client;
var mysqlDB = new MySQLClient({user:'root', database:'db_node_test'});
mysqlDB.connect();
function insertRow(err) {
if (err) throw err;
mysqlDB.query(
- (void)workerThreadObjectContextDidSave:(NSNotification*)notification_ {
NSManagedObjectContext *moc = [[NSApp delegate] managedObjectContext];
SEL mergeChanges = @selector(mergeChangesFromContextDidSaveNotification:);
[moc performSelectorOnMainThread:mergeChanges
withObject:notification_
waitUntilDone:NO];
}
// Hosey_warnings.xcconfig
// see http://boredzo.org/blog/archives/2009-11-07/warnings
// http://rentzsch.tumblr.com/post/237349423/hoseyifyxcodewarnings-scpt
// http://tewha.net/2010/11/xcode-warnings/
GCC_TREAT_WARNINGS_AS_ERRORS = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
@protocol ProtocolWithMethod
- (void)protocolMethod;
@end
@protocol ProtocolWithProperty
@property(retain) NSString *protocolProperty;
@end
// Trival base class that satisfies both protocols.
@interface BaseClass : NSObject {}