- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
In the below keyboard shortcuts, I use the capital letters for reading clarity but this does not imply shift, if shift is needed, I will say shift. So ⌘ + D does not mean hold shift. ⌘ + Shift + D does of course.
| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
| # .bash_profile is executed for login shells, | |
| # .bashrc is executed for interactive non-login shells. | |
| # We want the same behaviour for both, so we source .bashrc from .bash_profile. | |
| # Also, when .bash_profile exists, bash ignores .profile, so we have to source | |
| # it explicitly. | |
| if [ -f "$HOME/.profile" ]; then | |
| . "$HOME/.profile" | |
| fi |
| // https://github.com/realm/realm-js/issues/370#issuecomment-270849466 | |
| export default class Realm { | |
| constructor(params) { | |
| this.schema = {}; | |
| this.callbackList = []; | |
| this.data = {}; | |
| this.schemaCallbackList = {}; | |
| params.schema.forEach((schema) => { | |
| this.data[schema.name] = {}; | |
| }); |
| from functools import wraps | |
| try: | |
| # py>=3.2 | |
| from tempfile import TemporaryDirectory | |
| except ImportError: | |
| from backports.tempfile import TemporaryDirectory | |
| from pathlib2 import Path | |
| def tempdir(files=None, **kw): | |
| """ |
| #! /usr/bin/env python | |
| # remember to make this file executable (`chmod +x`) before trying to run it | |
| import rospy | |
| from std_srvs.srv import Trigger, TriggerResponse | |
| def trigger_response(request): | |
| return TriggerResponse( | |
| success=True, | |
| message="Hey, roger that; we'll be right there!" |