atom.ioのパッケージ作成を試しながら、いろいろ調べる。
https://atom.io/docs/v0.64.0/your-first-package をみながら、ascii-artなパッケージを作る。
| // https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Closures.html | |
| let data:Dictionary = [30:"value1", 20:"2", 10:"3"] | |
| println("patter 1") | |
| for key in sort(Array(data.keys), { (a:Int,b:Int) -> Bool in return a > b }) { | |
| println( data[key] ) | |
| } | |
| println("patter 2") | |
| for key in sort(Array(data.keys), { return $0 > $1 }) { |
| # WWDC2014のビデオ一覧をスクレーピングして、markdown形式のリストで出力するスクリプト | |
| # ruby ./wwdc2014_video.rb > wwdc2014_video_list.md5 | |
| # | |
| # 参考にしたサイト: | |
| # http://morizyun.github.io/blog/ruby-nokogiri-scraping-tutorial/ | |
| # http://d.hatena.ne.jp/otn/20090509/p1 | |
| require 'open-uri' | |
| require 'nokogiri' #gem install nokogiri |
atom.ioのパッケージ作成を試しながら、いろいろ調べる。
https://atom.io/docs/v0.64.0/your-first-package をみながら、ascii-artなパッケージを作る。
日記 gist-itを試す。
https://atom.io/packages/gist-it
mba% apm install gist-it
Installing gist-it to /Users/tak/.atom/packages ✓
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| // Override point for customization after application launch. | |
| [UIViewController switchLoggingMethod]; // ←これでメソッドが入れ替わる | |
| return YES; | |
| } |
| # http://hakobe932.hatenablog.com/entry/2012/01/21/142726#fn1 | |
| .PHONY: all build archive testflight | |
| PROJECT ?= PAMEventBoard.xcworkspace | |
| SCHEME ?= PAMEventBoard | |
| SIGN ?= iOS Developer | |
| DSYM = $(PWD)/out/build/PAMEventBoard.app.dSYM | |
| all: archive |
| NSString *html_ = [NSString stringWithContentsOfURL:url | |
| encoding:NSUTF8StringEncoding | |
| error:nil]; | |
| NSString *html = [html_ stringByReplacingOccurrencesOfString:@"\n" | |
| withString:@""]; | |
| [UIApplication sharedApplication].networkActivityIndicatorVisible=NO; | |
| // 正規表現の中で.*?とやると最短マッチするらしい。 | |
| NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"<h5><a.*? href=\"(.*?)\".*?>(.*?)</a></h5>" | |
| options:0 | |
| error:nil]; |
| @interface UIView(Swap) | |
| -(void)removeAllGestures; | |
| @end | |
| @implementation UIView(Swap) | |
| -(void)removeAllGestures | |
| { | |
| for (UITapGestureRecognizer *gesture in self.gestureRecognizers) { | |
| [self removeGestureRecognizer:gesture]; | |
| } |
| // | |
| // UIScrollView+LadderLayout.m | |
| // UIScrollView+LadderLayout | |
| // | |
| #import "UIScrollView+LadderLayout.h" | |
| // 便利拡張。UIViewのframe.{origin|size}へのアクセスを簡略化 | |
| @interface UIView(LadderLayout) | |
| @property(readonly)CGFloat x; |
| -(void)viewDidAppear:(BOOL)animated | |
| { | |
| [super viewDidAppear:animated]; | |
| for (id c in self.childViewControllers) { | |
| NSLog( @"c=%@",c); | |
| } | |
| for( UIView *v in self.view.subviews){ | |
| NSLog(@"v=%@",v); | |
| for( UIView *v2 in v.subviews){ | |
| NSLog(@"v2=%@",v2); |