Archive for April, 2007

OS X - Help a brother out

Friday, April 20th, 2007

I have done some searching and research about this topic, but for some reason I just can’t connect to the info I am hunting for.  So, if you could help a brother out I would really appreciate it.

One of the things that I love so much about my Mac is that it greatly reduces what I will call the “dicking around” factor of my computer.  It either just works, or provides me the tools to easily make it just work.  For example, I can launch my entire rails dev environment including Textmate, terminals, servers, consoles, etc. with just a few keystrokes.  That probably saves me 5 minutes a day.  AppleScript is very goofy, but I dig what it lets me do.

I came up with an idea for how I would like my Mac to just work, but haven’t been able to find one piece of the puzzle.

I use my computer in a couple of settings — each with their own needs:

  • Work — This is where i spend most of my computing life.  The tools I use at work are my RoR dev environment, a browser, and iTunes.
  • School — Pretty much just a browser, and OmniOutline
  • Home — A wide variety of things.  I use my rails dev environment to work on side projects, office like tools for homework, my browser, photo editing software, etc.

My computer can very easily determine if I am in one of these three environments based on the network that I am attached to.

My idea is to use an AppleScript to automate getting my computer ready for the environment that I am working in.  It can launch the apps I am going to need, change my power management settings, change my backgrounds, etc.  However, in order for it work, it needs to trigger on when I connect to a network.
There are a lot of hooks in OS X for trigger actions on changes, but i haven’t figure this one out.  Any ideas on how this could be accomplished?

Find across multiple levels of relationships

Thursday, April 12th, 2007

I was writing some code today and I would like to be able to find all my users who work for a specific group. The relationship is that a User belongs to one or more Jobs. Each Job belongs to a Group.

user.rb
class User “jobUsers”, :association_foreign_key => “jobID”,
:foreign_key => “usrID”

def self.get_active_by_group(groupname)
find(:all,
:include => [:jobs, {:jobs =>:group}],
:conditions => ["usrDeleted = 'false' and groups.grpName=?", groupname],
:order => “usrName ASC”)
end
end

job.rb
class Job ‘jobGrpID’
end

The key to this working is in the :include parameter.  (Sorry I can never get wordpress to format code that I cut and paste correctly)

Backing up my flash drive or Floder Actions Are Awesome!

Tuesday, April 10th, 2007

Voodoo Programming — Backing up Flash Drives Automatically

Great article that gives you the code to do something very useful. Now, anytime that I plug in my thumb drive my Mac automatically makes a backup of it.

Now that I have had my Mac for a couple of days, I have to say that the combo of Folder Actions and AppleScript is a very useful thing. There will be more examples to come as I get used to AppleScript.

Continuing MacBook impressions

Thursday, April 5th, 2007
  • Macs are very, very keyboard centric.  I know that keyboard shortcuts are available in pretty much all windows programs too.  Here is why I think that I notice the difference so much — in OS X there are a lot of things in the OS that are faster using keys than the mouse.  Closing an app for example.  If I click on the red X like I am used to, only the window closes.  So, it is easier to just use cmd+q to close the app.  That, plus ctl+tab, plus quicksilver to launch apps and I am so used to keyboard shortcuts for normal things that reaching for my mouse is unappealing.  So in my apps I start looking for more.  Like cmd+p in TextMate to insert params[:id] in a rails file.
  • TextMate is worth every penny.  It is incredibly nice.
  • My MacBook is kinda easy to get to bog down.  Not a good thing, so I need to figure out why.  I am curious if 512mb of ram is just not enough.
  • STM makes very nice affordable laptop bags.  Way lighter and smaller than my old Timbuk2 bag.  Is it too small?  Time will tell.

That is all that is new.  I still really, really like my new machine.  I need to write an applescript for starting my dev environment.  I will post that once I am done because I think people might find it useful.

Gettting iTerm to work correctly

Wednesday, April 4th, 2007

In the default configuration I was not too happy with iTerm.  Thanks to the web and about 3 minutes of work, I have a much better setup.  The two keys are changing your shell to use the tab/window title bars for current location.  And the ntab function — which creates a new tab in your current directory.

So, thanks who ever’s site this is:
http://xanana.ucsc.edu/xtal/iterm_tab_customization.html

First impressions of my MacBook

Monday, April 2nd, 2007

Okay.  I have had my MacBook now for literally a couple of days, and overall I am very happy with it.  I am currently working on getting my dev environment set up for work.  I was able to talk my boss into buying me TextMate, so hopefully that means I am not going to have to deal with installing RadRails or the like.  We will see what I think of it.

The screen on this thing is so, so nice.  I was concerned because my old screen was a 15.4 and this screen is only 13″.  However, I haven’t felt that it was a problem at all yet.  Thanks to Expose and cmd+tab the ease of switching between windows makes up for the smaller screen.  The up sides are that this screen is dramatically brighter, crisper, and generally better looking than my Dell M60.  I really can’t believe just how much nicer the screen is.

The jury is still out on the speed of this thing.  I have noticed that when using CyberDuck/SFTP to transfer huge volumes of small files that they system gets pretty sluggish.  That is not a normal operation for me though, so I am reserving judgement.

QuickSilver is very cool.  I am still getting the hang of it, but it definately makes doing some things very fast.  At the very least if feels faster not having to grab for the mouse so often.

I should get back to work…

gnubbs