How to install Homebrew on OSX

Shell Script (Bash) posted 4 months ago by christian

   1  cd
   2  curl http://gist.github.com/238927 -o 'install_homebrew.sh'
   3  chmod +x install_homebrew.sh
   4  ./install_homebrew.sh

Tagged homebrew, osx

How to install MongoDB on OSX Snow Leopard

Shell Script (Bash) posted 4 months ago by christian

Download and install the binaries

   1  cd /tmp
   2  wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-1.0.1.tgz
   3  tar zxvf mongodb-osx-x86_64-1.0.1.tgz
   4  sudo mv mongodb-osx-x86_64-1.0.1 /usr/local/mongodb
   5  sudo mkdir /usr/local/mongodb_data /var/log/mongodb
   6  sudo mkdir -p /data/db
   7  sudo chown -R root /usr/local/mongodb
   8  sudo chown -R root /data/db

Add MongoDB to path

   1  sudo sh -c 'echo "/usr/local/mongodb/bin" > /etc/paths.d/mongodb'

Open a new terminal window to get the updated path.

Start MongoDB

   1  sudo mongod run

References

This is article was very helpful when compiling these instructions

Tagged mongodb, osx, install

How to compile vim/MacVim on OSX Snow Leopard with clipboard support

Shell Script (Bash) posted 4 months ago by christian

   1  git clone git://repo.or.cz/MacVim.git vim7
   2  
   3  cd vim7
   4  ./configure --with-features=huge --enable-cscope --enable-pythoninterp --enable-rubyinterp --enable-perlinterp --enable-gui=macvim --with-mac-arch=intel --enable-multibyte --enable-clipboard=yes --enable-xterm_clipboard=yes
   5  
   6  make
   7  sudo make install
   8  

Tagged vim, macvim, compile, osx

How to fix irb in OSX Snow Leopard

Shell Script (Bash) posted 5 months ago by christian

This fix will enable Control+R and UTF-8, which by default don’t work on Snow Leopard because OSX’s Ruby doesn’t use readline by default. All code comes from Henrik Nyh’s blog, which explains how to fix irb on Leopard. I’ve changed the code so that it works on Snow Leopard:

   1  sudo port install readline +universal
   2  svn co http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7_72/ext/readline/ readline
   3  
   4  curl http://pastie.textmate.org/pastes/168767/download | patch readline/extconf.rb
   5  
   6  cd readline
   7  ruby extconf.rb
   8  make
   9  sudo make install

Tagged irb, readline, osx, snowleopard, hack

RubyCocoa HelloWorld

Ruby posted 10 months ago by christian

   1  require 'osx/cocoa'; include OSX 
   2  app = NSApplication.sharedApplication 
   3  
   4  win = NSWindow.alloc.initWithContentRect_styleMask_backing_defer( 
   5      [0, 0, 200, 60], 
   6      NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask, 
   7      NSBackingStoreBuffered, 
   8      false) 
   9  
  10  win.title = 'Hello World' 
  11  button = NSButton.alloc.initWithFrame(NSZeroRect) 
  12  win.contentView.addSubview(button) 
  13  
  14  button.bezelStyle = NSRoundedBezelStyle 
  15  button.title = 'Hello!' 
  16  button.sizeToFit
  17  button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), 
  18                                   (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) 
  19  button_controller = Object.new 
  20  def button_controller.sayHello(sender) 
  21    puts "Hello World!" 
  22  end 
  23  
  24  button.target = button_controller 
  25  button.action = 'sayHello:' 
  26  
  27  win.display 
  28  win.orderFrontRegardless 
  29  app.run 

Tagged rubycocoa, osx, helloworld, cocoa