Skip to content

Instantly share code, notes, and snippets.

Sean D Matthews Seanmatthews

  • Rowboat Entertainment
  • New York, NY
Block or report user

Report or block Seanmatthews

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SeparatingAxisTheorem.cpp
#include "SeparatingAxisTheorem.hpp"
#include <vector>
using namespace std;
void SeparatingAxisTheorem::getProjectionAxes(const vector<EigenPt>& verts,
vector<EigenPt>& axes)
{
for (int i=0; i<verts.size(); ++i) {
@Seanmatthews
Seanmatthews / robowordcloud.py
Created May 6, 2019
Word cloud & word count
View robowordcloud.py
#!/usr/bin/env python
from collections import OrderedDict
from os import path
from PIL import Image
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
View yesmaster.bashrc
export ROS_MASTER_URI=http://localhost:11311
yesmaster() {
export ROS_MASTER_URI=http://$1:11311
}
@Seanmatthews
Seanmatthews / crontab
Created Jan 22, 2019
Ubuntu auto backups to router ftp server
View crontab
# crontab -e
# Backups at 5:15am every day
15 05 * * * /usr/local/bin/restic -r /media/backup/<dir>/<restic-repo> -p <pass> backup <dir to backup>;/usr/local/bin/restic -r /media/backup/<dir>/<restic-repo> -p <pass> prune
View perlin.cpp
#include <algorithm>
#include <random>
using namespace std;
void createRandomHash(vector<uint8_t>& hash)
{
random_device r;
default_random_engine re(r());
@Seanmatthews
Seanmatthews / .git-prompt.sh
Created Nov 2, 2018
Git prompt for maximum information
View .git-prompt.sh
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
View ps1.bashrc
# store colors
MAGENTA="\[\033[0;35m\]"
YELLOW="\[\033[01;32m\]"
BLUE="\[\033[00;96m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
GREEN="\[\033[00m\]"
RED="\[\033[0;31m\]"
VIOLET='\[\033[01;35m\]'
View .gitconfig
[core]
editor = emacs -nw
[push]
default = simple
[submodule]
recurse = true
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
@Seanmatthews
Seanmatthews / fibonacci_sphere.py
Created May 29, 2018
Create equidistant points on the surface of a sphere using Fibonacci sphere algorithm
View fibonacci_sphere.py
#!/usr/bin/env python3
import argparse
import mpl_toolkits.mplot3d.axes3d as ax3d
import matplotlib.pyplot as plt
import numpy as np
def fibonacci_sphere(num_points: int):
ga = (3 - np.sqrt(5)) * np.pi # golden angle
You can’t perform that action at this time.