As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import base64 | |
| import urllib | |
| import hashlib | |
| import hmac | |
| import httplib | |
| import urlparse |
| @interface NSString (KBAdditions) | |
| - (CGFloat)fontSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size minimumFontSize:(CGFloat)minimumFontSize; | |
| @end |
| 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 { |
| 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) | |
| } |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| // | |
| // NSImage+OpenCV.h | |
| // | |
| #import <AppKit/AppKit.h> | |
| @interface NSImage (NSImage_OpenCV) { | |
| } |
| // | |
| // ARC Helper | |
| // | |
| // Version 2.2 | |
| // | |
| // Created by Nick Lockwood on 05/01/2012. | |
| // Copyright 2012 Charcoal Design | |
| // | |
| // Distributed under the permissive zlib license | |
| // Get the latest version from here: |
| @interface NSWindow (Fade) | |
| - (IBAction)fadeIn:(id)sender; | |
| - (IBAction)fadeOut:(id)sender; | |
| @end |
| #!/bin/bash | |
| # | |
| # Build and iPhone Simulator Helper Script | |
| # Shazron Abdullah 2011 | |
| # | |
| # WARN: - if your .xcodeproj name is not the same as your .app name, | |
| # this won't work without modifications | |
| # - you must run this script in where your .xcodeproj file is | |
| PROJECTNAME=$1 |
| static UIImage* CreateImageFromView(UITableView *view) | |
| { | |
| UIGraphicsBeginImageContextWithOptions(CGSizeMake(view.contentSize.width, view.contentSize.height), NO, 0.0f); | |
| CGContextRef context = UIGraphicsGetCurrentContext(); | |
| CGRect previousFrame = view.frame; | |
| view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y, view.contentSize.width, view.contentSize.height); | |
| [view.layer renderInContext:context]; | |
| view.frame = previousFrame; | |
| UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); |