As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
| package main | |
| import "code.google.com/p/go-tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| // Allocate two-dimensioanl array. | |
| a := make([][]uint8, dy) | |
| for i := 0; i < dy; i++ { | |
| a[i] = make([]uint8, dx) | |
| } |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
| @interface NSString (KBAdditions) | |
| - (CGFloat)fontSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size minimumFontSize:(CGFloat)minimumFontSize; | |
| @end |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import base64 | |
| import urllib | |
| import hashlib | |
| import hmac | |
| import httplib | |
| import urlparse |
| - (CGImageRef)createMaskFromAlphaChannel:(UIImage *)image | |
| { | |
| size_t width = image.size.width; | |
| size_t height = image.size.height; | |
| NSMutableData *data = [NSMutableData dataWithLength:width*height]; | |
| CGContextRef context = CGBitmapContextCreate( | |
| [data mutableBytes], width, height, 8, width, NULL, kCGImageAlphaOnly); |
| #ifndef MAP_HPP | |
| #define MAP_HPP | |
| //#include <cstdint> | |
| #include <stdint.h> | |
| #include <cstddef> | |
| #include <map> | |
| #include <functional> | |
| #include <boost/functional/hash.hpp> | |
| #include <memory> | |
| #include <utility> |
| NSMutableArray *dataSource; | |
| NSMutableIndexSet *selectedIndexSet; | |
| /* | |
| dataSource,selectedIndexSetに突っ込む処理 | |
| */ | |
| // dataSourceからselectedIndexSetにマッチするものだけを取り出す。 | |
| NSMutableArray *resultArray = [NSMutableArray array]; | |
| [self.selectedIndexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { | |
| [resultArray addObject:[self.dataSource objectAtIndex:idx]]; | |
| }]; |
| Here is what you need to do to register your app for a custom URL scheme (for the example we will use a "myapp" scheme). | |
| 1) In your Info.plist, add a new entry for CFBundleURLTypes: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>MyApp's URL</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> </array> | |
| 2) Somewhere in your application's startup code (e.g. init), add this code: - (void)registerMyApp { [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; } | |
| - (void)getUrl:(NSAppleEventDescriptor )event withReplyEvent:(NSAppleEventDescriptor )replyEvent { NSString url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; // Now you can parse the URL and perform whatever action is needed } | |
| Related Tidbits: |