Created
July 24, 2023 12:29
-
-
Save GeoffreyHervet/51e866d17252cf6741087a4dee41dd58 to your computer and use it in GitHub Desktop.
Fake contribution github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dayjs = require("dayjs"); | |
function generateRandomInteger(min, max) { | |
return Math.floor(min + Math.random() * (max - min + 1)); | |
} | |
const today = dayjs(); | |
let date = today.subtract(1, "year"); | |
const cmd = `git init && git ci --allow-empty -m 'root' --date '${date.format("YYYY-MM-DD HH:mm:ss")}'`; | |
console.log(cmd); | |
while (date.isBefore(today)) { | |
for (let i = generateRandomInteger(0, 10); i--; i <= 0) { | |
const dateFormatted = date.format("YYYY-MM-DD HH:mm:ss"); | |
const cmd = `git commit --allow-empty -m 'commit' --date "${dateFormatted}"`; | |
console.log(cmd); | |
date = date.add(1, "hour"); | |
} | |
date = date.add(1, "day"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "github", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"dayjs": "^1.11.9" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment