Skip to content

Instantly share code, notes, and snippets.

View pengwynn's full-sized avatar

Wynn Netherland pengwynn

View GitHub Profile
source :rubygems
gem 'sinatra', '1.0'
gem 'gowalla', '~> 0.2.0'
group :development do
gem 'shotgun'
end

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: () ->
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) ->
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
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