Skip to content

Instantly share code, notes, and snippets.

View MattPChoy's full-sized avatar

Matthew Choy MattPChoy

  • Deswik
  • Brisbane, Queensland, Australia
View GitHub Profile
@MattPChoy
MattPChoy / contributions.sh
Last active May 11, 2025 09:19
GitHub Contributions Summary: Generate a summary of your contributions to a git repository.
#!/bin/bash
# Generate a summary of contributions to your repository for all users.
# The output looks like
# User Name: 98187 Added, 70678 Removed, 168865 Modified, 309 Commits
# Where Modified = Added + Removed.
git log --all --format="%aN" | sort -u | while read author; do
stats=$(git log --all --numstat --pretty="%H" --author="$author" --since=1.year | \
awk 'NF==3 {plus+=$1; minus+=$2} NF==1 {total++} END {printf("%d %d %d", plus, minus, total)}')
@MattPChoy
MattPChoy / main.py
Created August 13, 2022 04:04
COMP3702 Tutorial 3 Starting Point
class GridWorld():
ACTIONS = ['U', 'D', 'L', 'R']
def __init__(self):
self.obstacles = [[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0, 0],