I've been a command-line user of subversion (svn) for some time and have long enjoyed these little bits of bash foo.
rm -rfv `find . -name *\.svn`The find . -name *\.svn finds all of the .svn folders that svn uses to track the repository and with the help of those handy back-tics, rm -rv does the recursive removal of svn tracking directories.
svn add `svn stat |grep \? |awk '{print $2}'`
Grep finds every svn stat output line that includes a question mark (meaning the item is not currently under version control) and pipes it through awk '{print $2}', which shows only the text (the filename) from the second column of the svn stat output. The back-tics and svn add finish the magic.
svn revert --recursive && rm -rf `svn stat |grep \? |awk '{print $2}'`
As with any other nerd foo, make sure that you really want to do what you're asking for when you use these commands. These make my life with svn just a little easier.
or... how I make my brain work more gooder*.
I've been known to fight foggy brain from time to time. You know what I mean? That decidedly uncool feeling of "can't do crap, too tired and dumb" that only seems to creep in when the to do list is longer than my ... um ... arm. Lately, though that feeling has struck me less and less often and I think I know why. I've lately zeroed - in on the right set of habits for me. Every now and again, I'll pick one of the topics below and write a short post expanding the topic. For now, though, just a list of things that work for me.
Continue reading "Brain clarity through body hacking and distractions" »
- (void)viewDidLoad
{
[super viewDidLoad];
self.fontNames = [NSMutableArray array];
NSArray *fontFamilyNames = [UIFont familyNames];
for (NSString *familyName in fontFamilyNames) {
NSLog(@"familyName = %@", familyName);
NSArray *names = [UIFont fontNamesForFamilyName:familyName];
NSLog(@"FontNames = %@", fontNames);
[self.fontNames addObjectsFromArray:names];
}
}
.
.
.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
NSString *name = [self.fontNames objectAtIndex:indexPath.row];
cell.text = name;
cell.font = [UIFont fontWithName:name size:14];
return cell;
}
NSString *filePath = @"pathToAnExcelDocument.xls";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] == YES)
{
NSLog(@"Loading %@", filePath);
NSURL *pathURL = [NSURL fileURLWithPath:filePath];
//Warning: this doesn't load into the view on the simulator
NSURLRequest *pathURLRequest = [NSURLRequest requestWithURL:pathURL];
[someWebView loadRequest:pathURLRequest];
}
radar://6417654