Skip to content

Instantly share code, notes, and snippets.

@ryecroft
ryecroft / DefaultKeyBinding.dict
Last active December 13, 2022 12:36
DefaultKeyBinding.dict
// This file is a bit of a mess to say the least, but it does have a load of examples in it.
// Most of it is cobbled together from various blogs. Applications need to be restarted for
// any changes to take effect.
// If you puts this stuff in '~/Library/KeyBindings/DefaultKeyBinding.dict', most proper mac
// applications will honour it (not Xcode though - that now has its own copy inside the app
// bundle, and uses a different format I think).
// The use most is at the end:
// move line up/down
@ryecroft
ryecroft / Objective-C to MacRuby method translate
Created July 5, 2012 19:18
Ruby script to translate Objective-C method calls into MacRuby
#!/usr/bin/env ruby
# Translates an objective C method call on the pasteboard,
# as copied from the docs, into MacRuby syntax, placing it
# back on the pasteboard.
# @example
# '+ (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha'
# => 'colorWithCalibratedRed(red, green:green, blue:blue, alpha:alpha)'
string = `pbpaste`