Skip to content

Instantly share code, notes, and snippets.

View brianjo's full-sized avatar
🏠
Working from home

Brian Johnson brianjo

🏠
Working from home
View GitHub Profile
Optimize my Python code with detailed Sphinx-compatible docstrings. Follow these rules:
Adhere to PEP 8 guidelines.
Use descriptive variable names and efficient algorithms.
Minimize unnecessary computations and consider caching.
Write Google-style docstrings with detailed descriptions, parameter documentation, and return types.
Use Sphinx-specific directives like :param, :return, and :raises.
Include type hints for function parameters and return types.
Keep functions short, focused, and well-tested.
Use meaningful variable names, commit messages, and docstring updates.
Generate code that is readable, maintainable, and suitable for Sphinx documentation output.
@brianjo
brianjo / gist:9b2f6bf18e4e607675dca96723fa2120
Last active December 14, 2023 18:21
Spell Check - From LLAMA2
name: SpellCheck
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Install vsce
npm install -g @vscode/vsce\n
cd extensionfolder
vsce package
# Note: To get this to work on src/extenson.tsx source I needed to
# change it to src/extension.js. I haven't had time to debug it properly.
# This should create a (extention).vsix file in the root folder.
# Open command pallet (F1 on Mac)
# Find the command - Extensions: Install from VSIX...
# Navigate to (extension).vsix file in root.
# Commands I always forget.
podman build -f Dockerfile # You can use Buildfile for pure Podman.
podman images
podman tag 511541e4cde3 buck2-podman:latest
podman run -it buck2-podman bash
podman ps # copy the container id from another shell
podman commit eb1af8df2371
podman images
podman ps # grab the name from the Names column.
# This Dockerfile will create an image
# with the Buck2 repo on Ubuntu. It will
# build and install Buck2 on the image
# and it will add the buck2 binary
# to the image path.
#
# To use this, copy the Dockerfile
# to a folder, then cd to the
# folder and run:
#
@brianjo
brianjo / gourcevideo.sh
Created October 25, 2021 16:54 — forked from Gnzlt/gourcevideo.sh
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@brianjo
brianjo / git-commit-log-stats.md
Created October 25, 2021 16:34 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@brianjo
brianjo / ipynb_to_gallery.py
Created June 17, 2021 15:06 — forked from chsasank/ipynb_to_gallery.py
Convert jupyter notebook to sphinx gallery notebook styled examples.
@brianjo
brianjo / git_rebase.md
Created May 4, 2020 22:12 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@brianjo
brianjo / gource.sh
Last active February 20, 2019 22:44 — forked from XueshiQiao/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install