Skip to content

Instantly share code, notes, and snippets.

View Nub's full-sized avatar
🕶️

Zach Thayer Nub

🕶️
View GitHub Profile
- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
//Recreate bars
finiteBar = nil;
freqBar = nil;
[self finiteBar];
[self freqBar];
(void)logTimeCode:(CMTime)Time{
NSTimeInterval time = (NSTimeInterval)((NSTimeInterval)Time.value/(NSTimeInterval)Time.timescale);
int minutes = time/60.f;
int seconds = time - (minutes * 60.f);
int frames = (time - (seconds + (minutes * 60.f))) * 29.97;
NSLog(@"01:%02d:%02d:%02d = [%f s]",minutes,seconds,frames, time);
}
- (CMTime)parseTimeCode:(NSString*)timeCode{
//Parse text for timeCode
int minutes = [[timeCode substringWithRange:NSMakeRange(3, 2)] intValue];
int seconds = [[timeCode substringWithRange:NSMakeRange(6, 2)] intValue];
int frames = [[timeCode substringWithRange:NSMakeRange(9, 2)] intValue];
NSTimeInterval timeInSeconds = (minutes * 60.f) + seconds + ((frames) * (1.f/29.97f));
return CMTimeMakeWithSeconds(timeInSeconds, 9000); //at 30fps
}
NSInteger YRFrequencies[] = {
88,90,92,95,98,101,106
};
NSInteger YRFrequenciesCount = 7;
NSInteger YRFrequencies[] = {
88,90,92,95,98,101,104,106
};
2011-11-21 20:35:53.015 frequenciesLCD[12118:f803] Family name: Thonburi
2011-11-21 20:35:53.017 frequenciesLCD[12118:f803] Font name: Thonburi-Bold
2011-11-21 20:35:53.017 frequenciesLCD[12118:f803] Font name: Thonburi
2011-11-21 20:35:53.018 frequenciesLCD[12118:f803] Family name: Snell Roundhand
2011-11-21 20:35:53.018 frequenciesLCD[12118:f803] Font name: SnellRoundhand-Bold
2011-11-21 20:35:53.018 frequenciesLCD[12118:f803] Font name: SnellRoundhand-Black
2011-11-21 20:35:53.019 frequenciesLCD[12118:f803] Font name: SnellRoundhand
2011-11-21 20:35:53.019 frequenciesLCD[12118:f803] Family name: Academy Engraved LET
2011-11-21 20:35:53.019 frequenciesLCD[12118:f803] Font name: AcademyEngravedLetPlain
2011-11-21 20:35:53.020 frequenciesLCD[12118:f803] Family name: Marker Felt
@interface YRFrequenciesLCDView : UIView
@property (nonatomic) CGFloat frequency;
@end
git push origin master
To [email protected]:/Code/ScribbeoMacServer
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:/Code/ScribbeoMacServer'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
- (void)myProperty
{
if(!myProperty)
{
//allocate/default init
}
return myProperty;
}
void getImageUrlForCallsign(NSString *callsign){
NSString *searchURL = [NSString stringWithFormat:@"http://www.bing.com/images/search?q=%@+logo&go=&qs=n&sk=&sc=8-4&form=QBIR", callsign];
NSString *regexOneliner = [NSString stringWithFormat:@"/usr/local/bin/wget -O tmp.txt \"%@\";sleep 2;cat tmp.txt | perl -ne '/class=\"sg_t\" src=\"([^>]*)\" style=\"([^>]*)\"/; print \"$1,\" ' >> tmp2.txt;echo '\"%@\":\"' >> allText.json; cat tmp2.txt | perl -ne '/,*(http[^,]*).*/; print \"$1\"' >> allText.json;echo '\",' >> allText.json;echo 'Done'; rm tmp.txt; rm tmp2.txt",
searchURL, callsign];