diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index cb033a13a5..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [Shpota] diff --git a/.github/README.md b/.github/README.md deleted file mode 100644 index 398b1d3e0a..0000000000 --- a/.github/README.md +++ /dev/null @@ -1,108 +0,0 @@ -GitHub Activity Generator [![Gitter](https://badges.gitter.im/github-activity-generator/community.svg)](https://gitter.im/github-activity-generator/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![build](https://github.com/Shpota/github-activity-generator/workflows/build/badge.svg)](https://github.com/Shpota/github-activity-generator/actions?query=workflow%3Abuild) -========================= - -A script that helps you *instantly* generate a beautiful GitHub Contributions Graph -for the last year. - -## ⚠ Disclaimer -This script doesn't encourage you to cheat. Cheating is bad. But if anybody judges your professional skills by -the graph on your GitHub profile (which carries no value), they deserve to see a rich graph. - -## Check my other projects - -I created this project more than five years ago. Since then, I have built several **much more valuable -tools** which I encourage you to check: - -- [sol4k](https://github.com/sol4k/sol4k) - Kotlin, JVM, and Android client for Solana -- [podil.js](https://github.com/podiljs/podil) - Lightweight and secure database schema migration tool -- [goxygen](https://github.com/Shpota/goxygen) - Web project generator -- [zeit](https://github.com/Shpota/zeit) - A Fitbit clock face for learners of the German language - - -## What it looks like - -### Before :neutral_face: :no_mouth: :unamused: -![Before](before.png) -### After :muscle: :relieved: :heart: :sunglasses: :metal: :horse: :wink: :fire: :dancer: :santa: :fireworks: :cherries: :tada: -![After](after.png) - -## How to use -1. Create an empty GitHub repository. Do not initialize it. -2. Download [the contribute.py script](https://github.com/Shpota/github-activity-generator/archive/master.zip) -and execute it passing the link on the created repository -```sh -python contribute.py --repository=git@github.com:user/repo.git -``` -Now you have a repository with lots of changes in your GitHub account. -Note: it takes several minutes for GitHub to reindex your activity. - -## How it works -The script initializes an empty git repository, creates a text file and starts -generating changes to the file for every day within the last year (0-20 commits -per day). Once the commits are generated it links the created repository with -the remote repository and pushes the changes. - -## Making contributions private - -You might want to make the generated repository private. It is free -on GitHub. You only need to set up your account -[to show private contributions](https://help.github.com/en/articles/publicizing-or-hiding-your-private-contributions-on-your-profile). -This way GitHub users will see that you contributed something, but they won't be -able to see what exactly. - -## Customizations -You can customize how often to commit and how many commits a day to make, etc. - -For instance, with the following command, the script will make from 1 to 12 -commits a day. It will commit 60% days a year. -```sh -python contribute.py --max_commits=12 --frequency=60 --repository=git@github.com:user/repo.git -``` -Use `--no_weekends` option if you don't want to commit on weekends -```sh -python contribute.py --no_weekends -``` -If you do not set the `--repository` argument the script won't push the changes. -This way you can import the generated repository yourself. - -Use `--days_before` and `--days_after` to specify how many days before the current -date the script should start committing, and how many days after the current date it -will keep committing. - -```sh -python contribute.py --days_before=10 --days_after=15 -``` - -Run `python contribute.py --help` to get help. - -## System requirements -To be able to execute the script you need to have Python and Git installed. - -## Troubleshooting -#### I performed the script but my GitHub activity is still the same. -It might take several minutes for GitHub to reindex your activity. Check -if the repository has new commits and wait a couple of minutes. -#### The changes are still not reflected after some time. -Are you using a private repository? If so, enable showing private contributions -[following this guide](https://help.github.com/en/articles/publicizing-or-hiding-your-private-contributions-on-your-profile). - -#### Still no luck -Make sure the email address you have in GitHub is the same as you have in -your local settings. GitHub counts contributions only when they are made -using the corresponding email. - -Check your local email settings with: -``` -git config --get user.email -``` -If it doesn't match with the one from GitHub reset it with -``` -git config --global user.email "user@example.com" -``` -Create a new repository and rerun the script. - -#### There are errors in the logs of the script. -Maybe you tried to use an existing repository. If so, make sure you are using -a new one which is *not initialized*. - -**If none of the options helped, open an issue and I will fix it as soon as possible.** diff --git a/.github/after.png b/.github/after.png deleted file mode 100644 index e36583572d..0000000000 Binary files a/.github/after.png and /dev/null differ diff --git a/.github/before.png b/.github/before.png deleted file mode 100644 index 06eb192b0f..0000000000 Binary files a/.github/before.png and /dev/null differ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a75a686961..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: build -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: pip install flake8 - - name: Lint - run: | - flake8 contribute.py - flake8 test_contribute.py - - name: Test for commits - run: | - python -m unittest test_contribute \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contribute.py b/contribute.py deleted file mode 100755 index 0bb6202fdd..0000000000 --- a/contribute.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python -import argparse -import os -from datetime import datetime -from datetime import timedelta -from random import randint -from subprocess import Popen -import sys - - -def main(def_args=sys.argv[1:]): - args = arguments(def_args) - curr_date = datetime.now() - directory = 'repository-' + curr_date.strftime('%Y-%m-%d-%H-%M-%S') - repository = args.repository - user_name = args.user_name - user_email = args.user_email - if repository is not None: - start = repository.rfind('/') + 1 - end = repository.rfind('.') - directory = repository[start:end] - no_weekends = args.no_weekends - frequency = args.frequency - days_before = args.days_before - if days_before < 0: - sys.exit('days_before must not be negative') - days_after = args.days_after - if days_after < 0: - sys.exit('days_after must not be negative') - os.mkdir(directory) - os.chdir(directory) - run(['git', 'init', '-b', 'main']) - - if user_name is not None: - run(['git', 'config', 'user.name', user_name]) - - if user_email is not None: - run(['git', 'config', 'user.email', user_email]) - - start_date = curr_date.replace(hour=20, minute=0) - timedelta(days_before) - for day in (start_date + timedelta(n) for n - in range(days_before + days_after)): - if (not no_weekends or day.weekday() < 5) \ - and randint(0, 100) < frequency: - for commit_time in (day + timedelta(minutes=m) - for m in range(contributions_per_day(args))): - contribute(commit_time) - - if repository is not None: - run(['git', 'remote', 'add', 'origin', repository]) - run(['git', 'branch', '-M', 'main']) - run(['git', 'push', '-u', 'origin', 'main']) - - print('\nRepository generation ' + - '\x1b[6;30;42mcompleted successfully\x1b[0m!') - - -def contribute(date): - with open(os.path.join(os.getcwd(), 'README.md'), 'a') as file: - file.write(message(date) + '\n\n') - run(['git', 'add', '.']) - run(['git', 'commit', '-m', '"%s"' % message(date), - '--date', date.strftime('"%Y-%m-%d %H:%M:%S"')]) - - -def run(commands): - Popen(commands).wait() - - -def message(date): - return date.strftime('Contribution: %Y-%m-%d %H:%M') - - -def contributions_per_day(args): - max_c = args.max_commits - if max_c > 20: - max_c = 20 - if max_c < 1: - max_c = 1 - return randint(1, max_c) - - -def arguments(argsval): - parser = argparse.ArgumentParser() - parser.add_argument('-nw', '--no_weekends', - required=False, action='store_true', default=False, - help="""do not commit on weekends""") - parser.add_argument('-mc', '--max_commits', type=int, default=10, - required=False, help="""Defines the maximum amount of - commits a day the script can make. Accepts a number - from 1 to 20. If N is specified the script commits - from 1 to N times a day. The exact number of commits - is defined randomly for each day. The default value - is 10.""") - parser.add_argument('-fr', '--frequency', type=int, default=80, - required=False, help="""Percentage of days when the - script performs commits. If N is specified, the script - will commit N%% of days in a year. The default value - is 80.""") - parser.add_argument('-r', '--repository', type=str, required=False, - help="""A link on an empty non-initialized remote git - repository. If specified, the script pushes the changes - to the repository. The link is accepted in SSH or HTTPS - format. For example: git@github.com:user/repo.git or - https://github.com/user/repo.git""") - parser.add_argument('-un', '--user_name', type=str, required=False, - help="""Overrides user.name git config. - If not specified, the global config is used.""") - parser.add_argument('-ue', '--user_email', type=str, required=False, - help="""Overrides user.email git config. - If not specified, the global config is used.""") - parser.add_argument('-db', '--days_before', type=int, default=365, - required=False, help="""Specifies the number of days - before the current date when the script will start - adding commits. For example: if it is set to 30 the - first commit date will be the current date minus 30 - days.""") - parser.add_argument('-da', '--days_after', type=int, default=0, - required=False, help="""Specifies the number of days - after the current date until which the script will be - adding commits. For example: if it is set to 30 the - last commit will be on a future date which is the - current date plus 30 days.""") - return parser.parse_args(argsval) - - -if __name__ == "__main__": - main() diff --git a/test_contribute.py b/test_contribute.py deleted file mode 100644 index 35ea228b7d..0000000000 --- a/test_contribute.py +++ /dev/null @@ -1,32 +0,0 @@ -import unittest -import contribute -from subprocess import check_output - - -class TestContribute(unittest.TestCase): - - def test_arguments(self): - args = contribute.arguments(['-nw']) - self.assertTrue(args.no_weekends) - self.assertEqual(args.max_commits, 10) - self.assertTrue(1 <= contribute.contributions_per_day(args) <= 20) - - def test_contributions_per_day(self): - args = contribute.arguments(['-nw']) - self.assertTrue(1 <= contribute.contributions_per_day(args) <= 20) - - def test_commits(self): - contribute.NUM = 11 # limiting the number only for unittesting - contribute.main(['-nw', - '--user_name=sampleusername', - '--user_email=your-username@users.noreply.github.com', - '-mc=12', - '-fr=82', - '-db=10', - '-da=15']) - self.assertTrue(1 <= int(check_output( - ['git', - 'rev-list', - '--count', - 'HEAD'] - ).decode('utf-8')) <= 20*(10 + 15))