Skip to content

Instantly share code, notes, and snippets.

View rossbar's full-sized avatar

Ross Barnowski rossbar

  • Caltech
  • Pasadena, CA
View GitHub Profile
rossbar /
Created January 25, 2022 00:50
Generate per-line author data for pony factor
# replace `main` with name of default branch of repo @ pwd and output
for f in $(git ls-tree -r main --name-only); do git blame $f --line-porcelain | grep -I "^author " | cut -d" " -f2- >> authorship_by_line.txt; done
from setuptools import setup, find_packages, Extension
ext_modules=[Extension("spam", ["spam.c"])]
if __name__ == "__main__":
rossbar /
Last active July 30, 2023 12:15
ROS CameraInfo Publisher
pointgrey_camera_driver (at least the version installed with apt-get) doesn't
properly handle camera info in indigo.
This node is a work-around that will read in a camera calibration .yaml
file (as created by the in the camera_calibration pkg),
convert it to a valid sensor_msgs/CameraInfo message, and publish it on a
The yaml parsing is courtesy ROS-user Stephan:
rossbar /
Created September 18, 2015 17:39
Vim remove trailing whitespace

Remove trailing whitespace

  • From a current line:
  • From entire file:
rossbar /
Created September 16, 2015 18:25
vi switch between files
:bn # Next file in buffer
:bp # previous file in buffer

Can map to in .vimrc like so:

nnoremap <C-Tab> :bn<CR>
nnoremap <C-S-Tab> :bp<CR>
rossbar /
Created September 16, 2015 02:11
Add a git repo's entire history to another git project with subtree
# /rel/path/to/subproject/folder should not be created yet
# <branch> is the branch of the subproject you want to include in the current project
# Source:
git subtree add --prefix /rel/path/to/subproject/folder<user>/<subproject>.git <branch>
rossbar /
Last active September 18, 2015 17:43
Set up local repository to track all remote branches
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done