Skip to content

Instantly share code, notes, and snippets.

View bdittmer's full-sized avatar

Brian Dittmer bdittmer

  • Patreon
  • San Francisco, CA
View GitHub Profile
@import <AppKit/AppKit.j>
@implementation WVNavigationItem : CPView {
IBOutlet CPImageView iconImageView;
IBOutlet CPTextField nameTextField;
id delegate;
}
- (void)setImageName:(CPString)imageName {
@import <AppKit/AppKit.j>
@implementation WVNavigationViewController : CPViewController {
@outlet CPTableView navTableView;
@outlet CPView navItemView;
}
- (void)viewDidLoad {
[super viewDidLoad];
[[[navTableView tableColumns] objectAtIndex:0] setDataView:navItemView];
@import <AppKit/AppKit.j>
@implementation WVNavigationViewController : CPViewController {
@outlet CPTableView navTableView;
@outlet CPView navItemView;
}
- (void)viewDidLoad {
[super viewDidLoad];
table_for ActiveRecord::Base.connection.select_all(sql).each do |row|
column("Handle") { row["handle"]}
column("Number of Shifts") { row["num_gigs"]}
column("Percent of Total Shifts") { row["percent"] }
end
ruby-1.9.2-p180 :001 > s = 'asdf'
=> "asdf"
ruby-1.9.2-p180 :002 > s.strip
=> "asdf"
ruby-1.9.2-p180 :003 > s = ' asdf '
=> " asdf "
ruby-1.9.2-p180 :004 > s.strip
=> "asdf"
ruby-1.9.2-p180 :005 >
/*
* Finder.h
*/
#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>
@class FinderApplication, FinderItem, FinderContainer, FinderComputerObject, FinderDisk, FinderFolder, FinderDesktopObject, FinderTrashObject, FinderFile, FinderAliasFile, FinderApplicationFile, FinderDocumentFile, FinderInternetLocationFile, FinderClipping, FinderPackage, FinderWindow, FinderFinderWindow, FinderDesktopWindow, FinderInformationWindow, FinderPreferencesWindow, FinderClippingWindow, FinderProcess, FinderApplicationProcess, FinderDeskAccessoryProcess, FinderPreferences, FinderLabel, FinderIconFamily, FinderIconViewOptions, FinderColumnViewOptions, FinderListViewOptions, FinderColumn, FinderAliasList;
=c/vv|i_/|!=ic=|_vcc_~/~!\c!/v//\=|~i~~!==||c!~/c_|~/_\v~~_!\~~\,.--cv~~|_=v==-,-..~c=~|=~|c!,._\!v!=!!/v!|\|!\\~==\v==v=/_=_\i\c/!~vc\i\\=c!_!vic_!~c!!veL7zL/f
v|~!i_vv_\!i!__~ic/c~c!~v~c_~|!~i!v/_~!\=~i=_\c\~=/vv\iv~=!~i_i=.-,,-~,..--..,.,,,-.,.--.._~,,.,=\!!i/=_=c!~cic~=ci/|\!\=~/i!cii_ivi/!/!v=/!c_i|v|/_|\vcv][ejtYj
=_ci!=i=~_~_==_/=c_\=v~=\\_v|v/|=/\\~~~i|\c!~\|/i_v|v_~|/!\_|c\--,-,-.-,,.,,,--,.,,---,-,,,.,,.,-_\=\\~=/c|c!c==/!~!!=~~\c=!=|\v|_|cc/iv_v/=/!ivc!/|v=_i\i~=gezf
v\vi=!\i!_!/\vi\|=||c!|/v!|v!v__ivi_/_!/v!!_~_/v_~!.,,\cic_---,.,---,,..-,,,--..-,,.,.--.-.-,.--,,..i!ic_=i//_/i|_\vi|vi/~v||=!v=~==~|cci\!=v!\=|/__c~/!\=/vze2/
iiic_/\~v=!\~=_=~v!\/c!v//=vi~i\ci==_\\!i~|~\\_iv~/.,-..,..-..,.,---,----,--,,--,,-....-,........--,,,ii/c-,.c|c|_/~|_~!!/c\!/v|i=!|!!=!|=~=\v!|~ci!!/_/cc!~!i\v
~v_//_!==_=ii_c!\|_~_|=v=~_i_=~|c|i\_c_\=cc!\c=v/~,,.-,,--.,.-,-.-.-.,---,-,,,,..-,-,...-,,,.----..,-,,.,...-__|v~!c~v\|~cv\/|__~!ci/v~i|=!!~!!=!ic\!=_v_cv__~v=
==~~i~/~i~|_i_/v\/~cc_\=///!\=!/=/i!\!\cc_c!icv=\-,.-,,.-,
+ (NSDateFormatter *)utcDateFormatter {
if (nil == _utcDateFormatter) {
_utcDateFormatter = [[NSDateFormatter alloc] init];
[_utcDateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]];
[_utcDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[_utcDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss zzz"];
[_utcDateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
}
static NSDictionary *valueMap = @{giIdKey:@"_groupIncentiveId", giJobIdKey:@"_jobId", giPercentCompleteKey:@"_percentComplete",
giPercentReservedKey:@"_percentReserved", giGoalsKey:@"_goals", giRewardsKey:@"_rewards"};
for (NSString *key in valueMap) {
[gi setValue:[d objectForKey:key] forKey:valueMap[key]];
}
#import "ESGroupIncentive.h"
NSString *giIdKey = @"id";
NSString *giJobIdKey = @"job_id";
NSString *giPercentCompleteKey = @"percent_complete";
NSString *giPercentReservedKey = @"percent_reserved";
NSString *giGoalsKey = @"goals";
NSString *giRewardsKey = @"rewards";
@interface ESGroupIncentive()