Skip to content

Instantly share code, notes, and snippets.

@tuenut
tuenut / generator.js
Last active June 29, 2021 10:10
JavaScript generators understanding/demo
function* someGenerator(generatorArg) {
this.generatorArg = generatorArg;
const phraseCreator = yield `You try say "${generatorArg}".`;
const phrase = phraseCreator();
yield `And now you say "${phrase}"`;
yield "So, generator is end.";
}
@tuenut
tuenut / git-selective-merge.md
Created August 13, 2020 10:45 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp