| Function | Shortcut |
|---|---|
| Previous Tab | ⌘+ Left Arrow |
| Next Tab | ⌘+ Right Arrow |
| Go to Tab | ⌘ + Number |
| Go to Window | ⌘ + Option + Number |
| Go to Split Pane by Direction | ⌘ + Option + Arrow |
| Go to Split Pane by Order of Use | ⌘ + ] , ⌘ + [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This event emitter emits events, but reserves the right to publish events to | |
| // for its creator. It uses a WeakMap for true encapsulation. | |
| const eesToEventMaps = new WeakMap(); | |
| export default class EventEmitter { | |
| constructor(publisher) { | |
| const eventMap = Object.create(null); | |
| eesToEventMaps.set(this, eventMap); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { exec } = require('./helpers') | |
| const changedFile = (filename, partial) => exec( | |
| `git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD`, | |
| `Something went wrong reading last git-pulled files list.`, | |
| true | |
| ).then((stdout) => stdout.split('\n') | |
| .some((name) => { | |
| let match | |
| if (partial) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Comp extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.onMouseDown = this.onMouseDown.bind(this) | |
| this.onMouseMove = this.onMouseMove.bind(this) | |
| this.onMouseUp = this.onMouseUp.bind(this) | |
| this.state = { onMouseMove: null, onMouseUp: null } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| const provideContext = (contextKey, contextType) => ( | |
| React.createClass({ | |
| childContextTypes: { | |
| [contextKey]: contextType | |
| }, | |
| getChildContext() { | |
| const { children, ...props } = this.props |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # forked by Gianluca Guarini | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // User.js | |
| const UPDATE_USER = 'UPDATE_USER' | |
| const defaultUser = { | |
| displayName: null | |
| } | |
| function userReducer(state = defaultUser, action) { | |
| switch (action.type) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function compose (...fns) { | |
| return (...args) => | |
| fns.reduceRight((child, fn) => | |
| fn.apply(null, child ? [child] : args), null | |
| ) | |
| } | |
| const b = i => <b>{i}</b> | |
| const i = i => <i>{i}</i> | |
| const u = i => <u>{i}</u> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| editor.addKeyMap({ | |
| "Tab": function (cm) { | |
| if (cm.somethingSelected()) { | |
| var sel = editor.getSelection("\n"); | |
| // Indent only if there are multiple lines selected, or if the selection spans a full line | |
| if (sel.length > 0 && (sel.indexOf("\n") > -1 || sel.length === cm.getLine(cm.getCursor().line).length)) { | |
| cm.indentSelection("add"); | |
| return; | |
| } | |
| } |