Important command to demangle C++ code in your pasteboard

0

Posted by Jaime | Posted in Tip | Posted on 22-09-2011

Tags: , ,

Cool command line I can run from DTerm on the contents in my clipboard, outputted from Xcode:

pbpaste | c++filt | mate

This command will take my clipboard contents, which were originally created from Xcode, pass that to the c++filt command and then create a new file in TextMate with the resulting contents.

UNIX tip of the day

0

Posted by Jaime | Posted in Coding, Tip | Posted on 07-07-2011

Tags: , , , ,

Thanks to my coworker for showing me this:

pbpaste | c++filt | mate

I use this to take a really long text output from GDB and de-mangle the code into something I can read.

I copy the output in the GDB console to the clipboard and the command takes those contents and pastes the results into TextMate.

Performing a large search and replace

3

Posted by Jaime | Posted in Coding, Tip | Posted on 23-02-2011

Tags: , ,

Thanks to my co-worker for showing me this really cool trick in TextMate!

I have this project I’m working on where I need to represent enum values as text for analysis purposes. The enum though is not set up to be easily iterated over (Dr. Dobbs) (James Kanze), so I added a stream operator to do the job.

Now, using TextMate, it’s easy to use the Macro recorder to perform a text insert operation over a small enum. However, I came across a large one that would make this process way too cumbersome.

enum {
kFirstConstant = 0x001000,
kSecondConstant = 0x001002,
kThirdConstant = 0x001004,
[...]
kTwoHundrethConstant = 0x001216,
};

Thanks to my co-worker, he showed me how I can easily modify my text using TextMate‘s Search and Replace feature on left-justified code:

Find:
^(\w+)(.+)$

Replace:
else if (enumvalue == $1)
\tstringrep = "$1";

Passing parameters to shell scripts

0

Posted by Jaime | Posted in Coding | Posted on 28-01-2011

Tags: , ,

I recently fell in love with TextMate.

For me, programming 24/7, TextMate helps me edit files that would normally be a pain with the standard editors on the market.

Now, with that being said, I started making a lot of Bash shell scripts to automate building projects with Xcode and delivering the binaries for testing.

I actually had a couple of scripts to handle certain portions of the different builds, since the project was made up of many projects not just one big monolithic giant project.

Well, I needed to send my Bash scripts some parameters and I was scratching my head on how…

Well, it’s not so hard sending and getting those parameters. Check out the link below.

Reference
http://bashscript.blogspot.com/2009/11/how-to-pass-arguments-to-shell-script.html