This code snippet was extracted from an AWS Step Functions example.
It can ben found in the AWS Console for the Step Functions service.
Follow the instructions on this documentation page
Date: 2019-10-16
| [alias] | |
| partial-push = "!sh -c 'REMOTE=$0;BRANCH=$1;BATCH_SIZE=2; if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then range=$REMOTE/$BRANCH..HEAD; else range=HEAD; fi; n=$(git log --first-parent --format=format:x $range | wc -l); echo "Have to push $n packages in range of $range"; for i in $(seq $n -$BATCH_SIZE 1); do h=$(git log --first-parent --reverse --format=format:%H --skip $i -n1); echo "Pushing $h..."; git push $REMOTE ${h}:refs/heads/$BRANCH; done; git push $REMOTE HEAD:refs/heads/$BRANCH'" |
| def reverse_file_lines(input_file_path, output_file_path): | |
| with open(input_file_path, 'r') as reader: | |
| lines = reader.readlines() | |
| with open(output_file_path, 'w') as writer: | |
| for line in reversed(lines): | |
| writer.write(line) | |
| input_file_path = 'input.txt' # The file to be reversed | |
| output_file_path = 'output.txt' # The file to write the reversed content to |
| import os | |
| import subprocess | |
| # Set the maximum allowed size in MB | |
| MAX_COMMIT_SIZE = 200 | |
| def get_files_and_sizes(directory): | |
| files_and_sizes = [] | |
| for root, _, files in os.walk(directory): | |
| for f in files: |
This code snippet was extracted from an AWS Step Functions example.
It can ben found in the AWS Console for the Step Functions service.
Follow the instructions on this documentation page
Date: 2019-10-16
| /* Run cron tasks */ | |
| public function hookActionCronJob() | |
| { | |
| return $this->cronTask(); | |
| } | |
| /* Return cron job execution frequency */ | |
| public function getCronFrequency() | |
| { | |
| return array( | |
| 'hour' => -1, |
This code snippet was extracted from an AWS Step Functions example.
It can ben found in the AWS Console for the Step Functions service.
Follow the instructions on this documentation page
Date: 2019-10-16
| /* Run cron tasks */ | |
| public function hookActionCronJob() | |
| { | |
| return $this->cronTask(); | |
| } | |
| /* Return cron job execution frequency */ | |
| public function getCronFrequency() | |
| { | |
| return array( | |
| 'hour' => -1, |