Skip to content

Instantly share code, notes, and snippets.

Setup new Mac with OSX Lion from scratch

Latest update 20-Oct-2012. [email protected]

Command Line Tools are required for Homebrew. Previously it was suggested to download Xcode 4, but since the new version doesn't ship the proper gcc compiler for rvm, the command line tools are a better option and then using homebrew to get the gcc compiler. If preferred, install Xcode 4, although this setup doesn't follow that set of instructions.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

@seamusjr
seamusjr / gist:5051065
Created February 27, 2013 19:47
error in imagemagick output
MPlayer 1.1-4.2.1 (C) 2000-2012 MPlayer Team
Playing /Users/sroche/Sites/lge/lge-tv-poc/public/prototypes/media/tv.mov.
libavformat version 54.6.101 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
VIDEO: [H264] 220x124 24bpp 29.970 fps 2243.4 kbps (273.9 kbyte/s)
Clip info:
major_brand: qt
minor_version: 537199360
@seamusjr
seamusjr / gitworkflow.txt
Created August 7, 2012 21:06
Simple git workflow
# Git workflow example.
# Inspired by http://nakedstartup.com/2010/04/simple-daily-git-workflow
# Create a local working branch
# You only need to do when you want to create
# a local working branch for your project
#
# I use the convention feat_project_name so it can be feat_puma
git checkout -b branch_name_here
@seamusjr
seamusjr / install.md
Created March 18, 2012 07:43
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, nvm

Setup new Mac with OSX Lion from scratch.

These commands are good as of 2012-03-18.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Note: Make sure you install the XCode Command Line Tools after XCode is done installing. To do this go to Xcodes -> Preferences -> Downloads -> Command Line Tools -> Install. If you don't you might not be able to install brew packages (i.e. brew install wget will fail).*

@seamusjr
seamusjr / non_user_selectable.css
Created November 9, 2011 17:08
Non-user selectable
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
@seamusjr
seamusjr / foo.html
Created November 4, 2011 17:31
Test if argument passed is an HTMLElement or not using JQuery
<div class="foo">foo</div>
@seamusjr
seamusjr / native_js.html
Created October 25, 2011 22:11
native js event handler example
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<!-- Date: 2011-10-25 -->
</head>
<body>
<button id="load-application">Load Application</button>
$(document).keydown(function(e) {
if(typeof e != 'undefined'){
if(e.altKey && e.keyCode == 115){
e.keyCode = 0;
alert("Alt + F4");
return false;
}
}
});
@seamusjr
seamusjr / paperclip_loop.rb
Created August 14, 2011 21:47
loop collection images paperclip
<% for asset in @post.assets %>
<li><%= link_to image_tag(asset.asset.url(:thumb)), asset.asset.url(:original) %></li>
<% end %>
@seamusjr
seamusjr / class.js
Created July 29, 2011 16:21
Simple JS Inheritance, John Resig example
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};