Skip to content

Instantly share code, notes, and snippets.

View gillesruppert's full-sized avatar

Gilles Ruppert gillesruppert

View GitHub Profile

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

(*
* Google Chrome View Source in MacVim - v0.1 - 3/7/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*)
tell application "Google Chrome"
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
bar[foo ? 'doSomething' : 'doSomethingElse'](el);
foo ? bar.doSomething(el) : bar.doSomethingElse(el); // prefer this as it reads better to me