Created
January 15, 2024 00:45
-
-
Save Arsfiqball/9cb6a9517fb1867096708b8c913adc15 to your computer and use it in GitHub Desktop.
Say something in your github history by adding commits into your repository
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
import os | |
from datetime import datetime, timedelta | |
def transpose_2d_array(array): | |
return list(map(list, zip(*array))) | |
def run_x_times(x, command): | |
for i in range(x): | |
os.system(command) | |
t = datetime.strptime("2023-01-01", "%Y-%m-%d") # Start date, make sure this is a Sunday | |
# 2D array representing the text to be displayed | |
# 0 = empty, 1 = filled | |
# You can keep adding columns to the right, but make sure to keep the same number of rows | |
text_map = [ | |
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
[0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], | |
[0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], | |
[0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], | |
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
] | |
transposed_text_map = transpose_2d_array(text_map) | |
for i, row in enumerate(transposed_text_map): | |
for j, char in enumerate(row): | |
if char == 1: | |
run_x_times(15, f"git commit --allow-empty -m 'Path: {i}-{j}' --date '{t}'") | |
t = t + timedelta(days=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment