Skip to content

Instantly share code, notes, and snippets.

View dominikbulaj's full-sized avatar

Dominik Bułaj dominikbulaj

View GitHub Profile
@dominikbulaj
dominikbulaj / fibonacci-generator.js
Created January 27, 2017 10:57 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0;
let next = 1;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
}
}
@dominikbulaj
dominikbulaj / gist:4302666ffa691e9f1b49
Created November 27, 2015 14:07 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote