Skip to content

Instantly share code, notes, and snippets.

@codesandtags
Last active January 20, 2024 01:59
Show Gist options
  • Save codesandtags/6dc67efd0a968a080b3c2c6038c8a2e1 to your computer and use it in GitHub Desktop.
Save codesandtags/6dc67efd0a968a080b3c2c6038c8a2e1 to your computer and use it in GitHub Desktop.
const getFormattedDay = (stringDate) => {
const date = new Date(stringDate);
const options = {
weekday: 'short',
month: 'short',
day: 'numeric' ,
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
year: 'numeric',
};
const dateFormatted = date.toLocaleDateString('en-US', options);
return dateFormatted
.replace(/,/ig, '')
.replace(/\d\d\d\d /i, '')
.replace(/PM|AM/ig, '')
.concat(date.getFullYear())
.concat(' -0500');
}
const getCommitText = (days) => {
return days.map(day => `git commit --amend --no-edit --date="${getFormattedDay(day)}"`
+ ` && git push origin master --force`);
};
const letterE = [
// Top stick letter E
'2019-11-17 20:00',
'2019-11-24 20:00',
'2019-12-01 20:00',
'2019-12-08 20:00',
// Bottom stick letter E
'2019-11-23 20:00',
'2019-11-30 20:00',
'2019-12-07 20:00',
'2019-12-14 20:00',
// Left stick letter E
'2019-11-10 20:00',
'2019-11-11 20:00',
'2019-11-12 20:00',
'2019-11-13 20:00',
'2019-11-14 20:00',
'2019-11-15 20:00',
'2019-11-16 20:00',
'2019-11-18 20:00',
'2019-11-19 20:00',
'2019-11-20 20:00',
'2019-11-21 20:00',
'2019-11-22 20:00',
// Middle stick letter E
'2019-11-27 20:00',
'2019-12-04 20:00',
'2019-12-11 20:00'
];
const letterT = [
// Top stick letter T
'2019-12-22 20:00',
'2019-12-29 20:00',
'2020-01-05 20:00',
'2020-01-12 20:00',
'2020-01-19 20:00',
'2020-01-26 20:00',
// Middle stick letter T
'2020-01-06 20:00',
'2020-01-07 20:00',
'2020-01-08 20:00',
'2020-01-09 20:00',
'2020-01-10 20:00',
'2020-01-11 20:00',
'2020-01-13 20:00',
'2020-01-14 20:00',
'2020-01-15 20:00',
'2020-01-16 20:00',
'2020-01-17 20:00',
'2020-01-18 20:00',
];
getCommitText(letterE).join('\n\r');
getCommitText(letterT).join('\n\r');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment