Host a TextMate Bundle on GitHub

Posted by Trey on June 23, 2008

Create a repository on GitHub

Go into the Bundle Editor and drag your bundle to your desktop and cd into it in the terminal. This is the key to the whole thing. If you just go into the bundle where it lives in TextMate, you might not get everything it needs. Dragging the file to the desktop makes it a nice, happy package ready to help other people.

Follow GitHub’s instructions to set up and push to the remote repository. Don’t forget to git add . to get everything in there.

Delete your original bundle and then clone from GitHub like so:

cd ~/"Library/Application Support/TextMate/Bundles/"
git clone git://github.com/trey/trey-tmbundle.git "Trey.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'

When you make changes to your Git-ified bundle in the Bundle Editor, you’ll need to Reload Bundles for the changes to show up in your repository. Then you’ll need to git add . and commit / push as you would a normal repository.

Source

Installing Git on OS X Leopard

Posted by Trey on February 25, 2008

It’s apparently best to install Git using both MacPorts and from source. That way you’ll get all the dependencies that are a pain in the ass to get set up, and you’ll also get the newest version of Git.

Install Git + Dependencies from MacPorts

Install the MacPorts “Leopard (Universal)” disk image from here.

If after the installation, running “which port” doesn’t show “/opt/local/bin/port“, try adding the following lines above any other path rules you have in your .bash_login file:

# MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
# / MacPorts

Make sure MacPorts is up-to-date:

sudo port -v selfupdate

Install Git:

sudo port install git-core

Install Git from Source

Go to git.or.cz and download the newest package.

Stick the file where you want it (I prefer /usr/local/src/).

Open the file and cd into its folder. Then:

sudo make prefix=/usr/local all

(You won’t need the sudo on the last command unless you’ve got your source in /usr/local/src/, which is owned by root)

Then:

sudo make prefix=/usr/local install

If everything goes as planned, you should be able to type “which git” and see exactly this:

/usr/local/bin/git

If instead you see /opt/local/… you’re using the MacPorts version and you need to move those path rules above the other rules in your .bash_login.

Enjoy.


Bonus: TextMate Integration

To use TextMate to edit your commit messages, put the following in your ~/.bash_login:

export GIT_EDITOR="mate -w"

Install the TextMate Bundle:

mkdir -p /Library/Application\ Support/TextMate/Bundles
cd !$
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

Since Git is installed in /usr/local/bin, you’ll need to make a link to where the bundle expects it:

sudo ln -s /usr/local/bin/git /usr/bin/git

Sources:

Turning off Photoshop’s Automatic Generation of an ‘images’ Folder

Posted by Trey on February 14, 2008

File > Save for Web & Devices (cmd+shift+option+s)

On the right side of the screen, you’ll see something like this:

Output settings

On the dialog that pops up, choose Saving Files

Saving files

Then under Optimized Files, uncheck Put Images in Folder, or change it to something cooler like img.

Optimized files

How to color code headings in TextMate using Markdown

Posted by Trey on May 21, 2007

Preferences > Fonts & Colors

Add a new element entry like so, using the scope selector markup.heading (this doesn’t seem to effect H tags in HTML):

Custom Colors in TextMate

Use whatever foreground and background colors you want.

Project-Specific Self-Closing Tags in TextMate

Posted by Trey on May 18, 2007

If you want to switch to using self-closing tags like <img /> and <br /> in certain projects, change the shell variable TM_XHTML for that project to ” /“.

Click here:

Project Variables Button

Enter this:

XHTML for a specific project

The default behavior for TextMate is to use HTML 4, so you don’t have to do anything extra for those projects.

Creating a Web Archive of a Writeboard in Yojimbo

Posted by Trey on December 26, 2006

  1. Share the Writeboard with yourself
  2. Get the password out of the email you receive
  3. Archive the item in Yojimbo
  4. In the password prompt inside of the archive in Yojimbo, put the password from the email
  5. Submit the form
  6. Delete the web archive
  7. Archive the Writeboard again

How to set up Photoshop for Web

Posted by Trey on December 17, 2006

  • View > Proof Setup > Monitor RGB
  • Edit > Color Settings (or shift-cmd-K)
    • Change RGB working space to Monitor RGB - Color LCD
    • Set color management to off for RGB

Anything else? Anything different in CS3 beta? Anybody with differing opinions?

Update 2007-12-01: Just for the record, here’s the extra thing you have to do for CS3:

Convert to sRGB

Un-check the option to Convert to sRGB in the Save for Web & Devices dialog.

Deleting changes made to default bundles in TextMate

Posted by Trey on November 01, 2006

From the Help file:

If you want to discard local changes then currently the only option is to delete these from ~/Library/Application Support/TextMate/Bundles.

Of course, you can also just drag them out of that folder in case you want to add them back later. I created a folder called DeltedChanges within ~/Library/Application Support/TextMate/Bundles.