Random Useful Commands

vim


make vim format json

note when pulling data from a mongo database, it uses  ISODATE() and a few other custom mongo things. You have to remove those to get the command to work. Otherwise it just tells you that there is no json for it to format.

 

search for files containing text, and open up the list of files that contained that text in vim

Once you have the list of files containing the search term open, you can put the cursor over the file and press  <ctrl-w>f to open the file the cursor is over in a split

Replace Text


replacing text in tons of files with sed in os x

this will list all files that contain some text. It can be piped into sed like this

and that will create a backup of every modified file. the backup will have bu as the extension. change that with the -i.bu  part of the command

you can also make it so there is no backup file created like this (make sure you’re in a source control system for safety)

Here’s what i use when updating nuget packages in multiple csproj’s (only safe with certain repos that don’t have install scripts)

XCode


When debugging auto layout ambiguity, pause the application and run the auto layout trace in the debugger console.

 

Xamarin does not have very good debugging tools. In particular, it doesn’t have a great way to determine the currently visible ViewController. This is what I use to do that

The Namespace  UIKit shouldn’t be required, but sometimes leaving it off doesn’t work. No clue why.

Leave a Reply

Your email address will not be published. Required fields are marked *