Skip to content

Instantly share code, notes, and snippets.

I like the idea of unifying navigation between tmux panes and vim windows. @mislav did a great job in [this gist][mislav-gist] but it depends on using C-{h,j,k,l} for navigation instead of vim's default C-W {h,j,k,l}.

Tmux's bind-key doesn't support multiple keys: just a single key with a modifier, so if we want to keep using C-w we have to be a bit tricky.

This approach binds C-w to set up keybindings that a) navigate and b) unset themselves. It turns out you can't have a bind-key statement in your .tmux.conf that's too long or tmux will segfault, which is one of the

@hjdivad
hjdivad / controllers.application.js
Created February 20, 2019 02:17
subroute model recomputation
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});

Ember-QUnit Testing With Vim

It can be tedious (and slow) to go from a test in your editor to running that test in the browser. This is a process to speed this up slightly. When it's set up you'll be able to run an individual test by:

  1. put your cursor inside a test body
  2. hit T
  3. switch to chrome
  4. type 'test ' (sans quotes), paste your clipboard and hit enter
import Ember from 'ember';
export default Ember.Object.extend({
deleteRecord(store, modelClass, snapshot) {
return Ember.RSVP.resolve();
}
});
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: ['tabindex'],
classNames: ['sortable'],
tagName: 'div',
});
import Ember from 'ember';
const values = [
0, 10, 20, 30,
];
export default Ember.Controller.extend({
sliderIndex: 1,
values: Ember.computed('sliderIndex', function() {
@hjdivad
hjdivad / adapters.application.js
Last active July 11, 2017 20:01
set -> destroy -> unload semantics
import Ember from 'ember';
import DS from 'ember-data';
const { RSVP: { resolve }} = Ember;
export default DS.Adapter.extend({
deleteRecord() {
return resolve(null);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@hjdivad
hjdivad / adapters.application.js
Last active February 16, 2017 03:21 — forked from danielspaniel/adapters.application.js
hasMany not cleared by pushPayload
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
});
@hjdivad
hjdivad / adapters.application.js
Created February 16, 2017 03:19 — forked from danielspaniel/adapters.application.js
hasMany not cleared by pushPayload
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
});