This file contains 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
#import <Cocoa/Cocoa.h> | |
@interface MyTextView : NSView <NSTextInput, NSTextInputClient> { | |
NSMutableAttributedString *_text; | |
NSRange _selectedRange; | |
NSRange _markedRange; | |
} | |
@end |
This file contains 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
if expand('%') =~# '_spec\.rb$' | |
syn keyword rubyRspec describe context it specify it_should_behave_like before after setup subject | |
endif | |
hi def link rubyRspec Function |
This file contains 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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("www.tumblr.com"), | |
domain("www.tumblr-beta.com") | |
{ | |
ol#posts li blockquote, | |
body.mceContentBody blockquote { | |
margin-left: 0 !important; | |
margin-right: 0 !important; | |
padding-left: 3px !important; |
This file contains 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
#!/usr/bin/env ruby | |
# vim: encoding=utf-8 filetype=ruby | |
require 'rubygems' | |
require 'optparse' | |
require 'yaml' | |
options = YAML.load(<<CONF) | |
color: true | |
verbose: false |
This file contains 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
#import <Foundation/Foundation.h> | |
@interface Book : NSObject | |
{ | |
NSMutableDictionary *data; | |
} | |
@property (retain) NSString *title; | |
@property (retain) NSString *author; | |
@end |
This file contains 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/sh | |
# ================================================================ | |
# | |
# Convert a mysql database dump into something sqlite3 understands. | |
# | |
# Adapted from | |
# http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit | |
# | |
# (c) 2010 Martin Czygan <[email protected]> |
This file contains 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
XCodeの'グループとファイル'画面でターゲット選択、新規ビルドフェーズ(新規スクリプト)を追加 | |
スクリプトフェーズを最初に持ってくる('バンドルリソースをコピー'の前に持ってくる) | |
YourProject-Info.plistにVersionValueとVersionValueForDisplayキーを追加。VersionValueに\d+.\d+.\d+な文字列を入れる | |
スクリプトに以下を書く | |
VERSION=`cat ./YourProject-Info.plist | tr -d '\n\t' | perl -nle 'print ($_ =~ /^.*?<key>VersionValue<\/key><string>(\d+\.\d+\.\d+)<\/string>.*$/) ? $1 : ""'` | |
VERSION_FOR_DISPLAY=$VERSION-$CONFIGURATION-$ARCHS | |
/usr/libexec/PlistBuddy -c "Set :VersionValueForDisplay $VERSION_FOR_DISPLAY" ./YourProject-Info.plist |
This file contains 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)scan { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
ALAssetsGroupType sources = ALAssetsGroupLibrary | ALAssetsGroupSavedPhotos; | |
NSMutableArray *tags = [[NSMutableArray alloc] init]; | |
ALAssetsGroupEnumerationResultsBlock assetsEnumerator = ^(ALAsset *result, NSUInteger index, BOOL *stop){ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
if (result) { | |
if ([[result valueForProperty:ALAssetPropertyType] isEqual:ALAssetTypePhoto]) { |
This file contains 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
# iOS builds for ARMv7 and simulator i386. | |
# Assumes any dependencies are in a local folder called libs and | |
# headers in a local folder called headers. | |
# Dependencies should already have been compiled for the target arch. | |
PROJ=untitled | |
ifeq ($(IOS), 1) | |
ARCH=armv7 | |
DEVICE=OS | |
CC_FLAGS=-arch $(ARCH) |
OlderNewer