Skip to content

Instantly share code, notes, and snippets.

View satodaiki's full-sized avatar
:shipit:
Very happy.

satodai satodaiki

:shipit:
Very happy.
  • 東京
View GitHub Profile
@satodaiki
satodaiki / memento.js
Created March 24, 2021 14:28 — forked from jmgunn87/memento.js
js memento(undo redo)
function Memento(originalState) {
this.state = originalState;
this.stack = new Array(this.state);
this.stackIndex = 0;
}
Memento.prototype.undo = function () {
return this.stackIndex > 0 ?
this.state = this.stack[--this.stackIndex]: this.state;
};
Memento.prototype.save = function (state) {
@satodaiki
satodaiki / .tigrc
Last active April 27, 2020 13:13
自分用のtigrc(pushもpullもできちゃうよ)
# F で fetch (default: :toggle file-name / :toggle commit-title-refs)
bind generic F ?git fetch %(remote)
bind main F ?git fetch %(remote)
# Alt-f で :toggle file-name / :toggle commit-title-refs
bind generic <Esc>f :toggle file-name
bind main <Esc>f :toggle commit-title-refs
# U で pull
bind generic U ?git pull %(remote)