Рубрика: ‘Mac OS X’

ANSI escape sequences for coloring

More about ANSI escape code I modify my twitter script from previous post and now timeline looks like this:

Теги: , , , ,

Комментарии отсутствуют

My Modified Neon(author zb3k) Bowtie theme

If album does not has artwork: Download theme

Теги: , , ,

Комментарии отсутствуют

How to get twitter timeline in Command line (for GeekTool)

Install next gem yajl-ruby, twitter, htmlentities 1sudo gem install yajl-ruby twitter htmlentities create app on twitter developer portal and copy keys 12345678910111213141516171819202122#!/usr/bin/ruby # Copyright Vladimir Boychentsov, 2012 # site http://www.developers-life.com/ # Released under BSD require ‘rubygems’ require ‘twitter’ require ‘htmlentities’ Twitter.configure do |config|   config.consumer_key = "Consumer key"   config.consumer_secret = "Consumer secret"   config.oauth_token [...]

Теги: , , ,

Комментарии отсутствуют

NSTableView with custom header

Default header looks like this First we want change height of header: 12NSTableHeaderView *tableHeaderView = [[NSTableHeaderView alloc] initWithFrame:NSMakeRect(0, 0, 120, 60)];     [_tableView setHeaderView:tableHeaderView]; Next step we want change NSTableHeaderCell, can make category for this class or make subclass. So, I wrote subclass. Empty category

Теги: , , , , , , ,

Комментарии отсутствуют

AVPlayer – looping video without “hiccup”/delays

I tried create loop by AVQueuePlayer, this method has delays between end and start play. for looping AVQueuePlayer i use this code: 123456[[NSNotificationCenter defaultCenter] addObserver:self                                              selector:@selector(playerItemDidReachEnd:)               [...]

Теги: , , , , , , , , ,

Комментарии отсутствуют

AudioSession AudioRouteChange

if you will use or used AVPlayer or you want just know about changes, you can check AudioRouteChange. Simple solution: Add framework AudioToolbox and add import to file 1#import <AudioToolbox/AudioToolbox.h> Insert into init method or any other 1AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, callbackHeadphone_func, self); Listener callback 12345678910111213141516171819202122232425void callbackHeadphone_func ( void *inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData [...]

Теги: , , ,

Комментарии отсутствуют

Sorting by block

Sorting by block 12345678910111213141516171819NSArray *stringsArray = [NSArray arrayWithObjects:                                  @"string 1",                                  @"String 21",                       [...]

Теги: , , ,

Комментарии отсутствуют

Getting Font Metrics

Doc about font metric Getting Font Metrics

Теги: ,

Комментарии отсутствуют

Get Geo tags from image

Little application for getting geo location from photo

Теги: , , , , , , , , , , ,

Комментарии отсутствуют

Administrator Privilege in Mac OS X app

If the Terminal command requires Administrator Privilege (aka sudo), use AuthorizationExecuteWithPrivileges instead. The following will create a file named “com.developers-life.test” is the root directory “/System/Library/Caches”. 123456789101112131415AuthorizationRef authorizationRef; FILE *pipe = NULL; OSStatus err = AuthorizationCreate(nil,                                    kAuthorizationEmptyEnvironment,     [...]

Теги: , , ,

Комментарии отсутствуют