Skip to content

Instantly share code, notes, and snippets.

View pengwynn's full-sized avatar

Wynn Netherland pengwynn

View GitHub Profile

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

before_save :set_location
def set_location
self.location = 'United States' if self[:location].blank?
end
class RewardsController < InheritedResources::Base
before_filter :dummy_data
def dummy_data
@something = 'test'
end
def index
end
- points = Project.all.each.map {|p| { "title": p.title, "description": p.description, "lat": p.lat, "lng": p.lng } }
/ This is the array I'm shooting for.
/ points = [
/ { title:'Some Place', description:'Descriptive description.', lat:-34.397, lng:150.644 }
/ { title:'Some Other Place', description:'Descriptive description.', lat:-33.397, lng:150.644 }
/ { title:'Distant Place', description:'Descriptive description.', lat:-31.397, lng:150.644 }
/ ]
@pengwynn
pengwynn / vim7.3_mac_install.rb
Created July 27, 2011 17:41 — forked from mattsacks/install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
dataForSubmit: () ->
players_data = _.map @players, (player, email) ->
player =
tee_slug: player.tee
email: email
handicap: player.handicap
holes: _.map player.scores, (score, hole) ->
hole_data =
hole: hole.replace("h", "")
score: score
dataForSubmit: () ->
data =
# course_slug: @course.slug
competition: "My competition"
players: _.map @players, (player, email) ->
player =
tee_slug: player.tee # or whatever
email: email
handicap: player.handicap # or omit
holes: _.map player.scores, (score, hole) ->
GolfStatus.UI.Views.Play.createSelectCourseWindow = (options) ->
window = Ti.UI.createWindow(options)
courses = Ti.UI.createTableView
className: 'selectionTable'
id: 'selectCourse'
allowsSelection: true
# 2010-10-01
#
# Mac OS X 10.6.3
# Homebrew 0.7
# Xcode 3.2.4
# Git 1.7.3.1
# RVM 1.0.12
# Ruby 1.9.2, 1.8.7
# Rails 3.0.0
# Passenger 3.0.0.pre4
$ bundle exec rake
(in /Users/erik/projects/twitter)
/opt/local/bin/ruby -I"lib:test" -rubygems "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/twitter/base_test.rb" "test/twitter/geo_test.rb" "test/twitter/oauth_test.rb" "test/twitter/request_test.rb" "test/twitter/search_test.rb" "test/twitter/trends_test.rb" "test/twitter/unauthenticated_test.rb" "test/twitter_test.rb"
/Users/erik/projects/faraday-middleware/lib/faraday_middleware.rb:4: warning: already initialized constant VERSION
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
EEEEEEEEEEEEEEEEEEEEEEEEEEE...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE..........EFFFFFFFFFEEE........EE.EEEEEE........EE...E.E......E.EEEEE.E.EEEEEEEEEEEEE..EEEEEEFFFFEEE
Finished in 0.214691 seconds.
1) Error: