Skip to content

Instantly share code, notes, and snippets.

View DarthVanger's full-sized avatar

Ivan Sergiienko DarthVanger

  • Kiev, Ukraine
View GitHub Profile
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active January 7, 2026 22:03
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@kerimdzhanov
kerimdzhanov / random.js
Last active January 17, 2026 16:10
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@katylava
katylava / git-selective-merge.md
Last active December 27, 2025 15:19
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

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.