Skip to main content

GitX and Finder in MacOs

GitX is a cool tool to visualize your git branches. It automatically assumes all files ending in .git files are git applications. When you browse files in Finder, anything ending in .git is now not a folder anymore, and clicking on it will launch GitX. Very annoying. I assumed I could just right click the file and set Open with to finder, but you can only change it to other applications, you can't tell your Mac that foo.git is a folder, not a git application. Instead, I edited the file /Applications/GitX.app/Contents/Info.plist (sudo!). Remove the following line inside CFBundleTypeExtensions

<string>git</string>



...
<key>CFBundleTypeExtensions</key>
      <array>
          <string>git</string>
          <string></string>
      </array>

...

And then run
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -u -r -f /Applications/GitX.app/

It should say
ThrottleProcessIO: throttling disk i/o

Reopening Finder, and foo.git is a nice folder again.

Comments

Popular posts from this blog

Uploading a file with JQuery

You can easily submit data in an html form via jQuery's $.post. But you need to do a little more to upload a file. I suggest the jQuery Form Plugin . Here is the HTML form: <html> <head> <title>Title</title> </head> <body> <form action="/test.cgi" enctype="multipart/form-data" method="post"> <input name="myFile" type="file" /> <div id="results"> </div> </form> </body> </html> This is the Javascript file myFrom.js: $(document).ready(function() { $('form').ajaxForm( { beforeSubmit: function() { $('#results').html('Submitting...'); }, success: function(data) { var $out = $('#results'); $out.html('Your results:'); $out.append('<div><pre>'+ data +'</pre></div>'); ...

Latex: Centering table larger than textwidth

Usually, you can center tables with \center. But when the table is longer than the \textwidth, it will be align with the left side margin. You can temporarily adjust the textwidth. % allows for temporary adjustment of side margins \usepackage{chngpage} \begin{table}     \begin{adjustwidth}{-.5in}{-.5in}          \begin{center}         \begin{tabular}{|c|}             \hline And here comes a very long line. And here comes a very long line. And here comes a very long line.  \\             \hline         \end{tabular}         \caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is lo...

PHP Opcodes

First, what is an Opcode? It's a compiled form of a PHP script, similar to Java bytecode. Or, more precisely, from php.net "When parsing PHP files, Zend Engine 2 generates a series of operation codes, commonly known as "opcodes", representing the function of the code." <?php $a = "Hello "; $b = "World\n"; echo $a . $b; For a script like this, the opcodes look like that: number of ops: 5 compiled vars: !0 = $a, !1 = $b line # * op fetch ext return operands --------------------------------------------------------------------------------- 2 0 > ASSIGN !0, 'Hello+' 3 1 ASSIGN !1, 'World%0A' 4 2 CONCAT ~2 !0, !1 3 ECHO ~2 5...