Skip to content

Instantly share code, notes, and snippets.

@GenjiApp
GenjiApp / window-resize.sh
Last active September 20, 2015 07:54
window resize
osascript -e 'set bounds of window 1 of application "Xcode" to {0, 0, 700, 778}'
@GenjiApp
GenjiApp / reset_launch_service.sh
Created June 1, 2014 06:09
OS Xの「このアプリケーションで開く」メニューのアイテム重複を修正する
#!/bin/sh
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user
killall Finder
exit 0
@GenjiApp
GenjiApp / AddNamespaceProblem.m
Created January 29, 2012 03:06
既存のものと同名のネームスペースを addNamespace すると、Snow Leopard 環境で Segmentation fault になる
#import <Cocoa/Cocoa.h>
int main(void)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSURL *fileURL = [NSURL fileURLWithPath:@"test.html"];
NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:fileURL
options:NSXMLDocumentTidyXML
error:nil];
@GenjiApp
GenjiApp / NSImage+DrawAttributedString.h
Created December 25, 2011 07:07
NSImage's category for drawing attributed string
#import <AppKit/AppKit.h>
@interface NSImage (DrawAttributedString)
+ (NSImage *)imageWithAttributedString:(NSAttributedString *)attributedString
backgroundColor:(NSColor *)backgroundColor;
+ (NSImage *)imageWithAttributedString:(NSAttributedString *)attributedString;
+ (NSImage *)imageWithString:(NSString *)string;
@end
@GenjiApp
GenjiApp / NSWindow+FullScreen.h
Created December 13, 2011 08:52
NSWindow's category for full screen mode.
#import <AppKit/AppKit.h>
@interface NSWindow (FullScreen)
- (BOOL)isInFullScreenMode;
@end