Skip to content

Instantly share code, notes, and snippets.

View eliac7's full-sized avatar
🎯
Focused

Ilias Nikolaos Thalassochoritis eliac7

🎯
Focused
View GitHub Profile
@gioiliop7
gioiliop7 / apli_analogiki.js
Last active May 23, 2023 22:20
Calculate the seats in "Apli Analogiki" elections format, in greek elections
function distributeSeats(percentages, totalSeats, threshold) {
const validParties = percentages.filter((percentage) => percentage >= threshold);
const totalValidPercentages = validParties.reduce((a, b) => a + b, 0);
const seatDistribution = [];
validParties.forEach((percentage) => {
const seats = Math.floor((percentage / totalValidPercentages) * totalSeats);
seatDistribution.push(seats);
});
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active June 10, 2025 19:05
Conventional Commits Cheatsheet