Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean D Matthews Seanmatthews

  • Rowboat Entertainment
  • New York, NY
View GitHub Profile
@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
@Seanmatthews
Seanmatthews / gopro_streaming.cpp
Last active Feb 6, 2021
GoPro Hero4 Black C++ Streaming With OpenCV
View gopro_streaming.cpp
#include <boost/exception/exception.hpp>
#include <boost/thread.hpp>
#include <boost/chrono.hpp>
#include "opencv2/opencv.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
using namespace std;
View config.el
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Sean Matthews"
user-mail-address "sean.d.matthews@gmail.com")
@Seanmatthews
Seanmatthews / i3.config
Last active Feb 1, 2021
Config file for i3 window manager using apple keyboard
View i3.config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@Seanmatthews
Seanmatthews / i3lock-fancy-install.sh
Created Nov 26, 2019
i3lock-fancy Installation for Ubuntu 16.04
View i3lock-fancy-install.sh
#!/bin/sh
# Dependencies
sudo apt install pkg-config autoconf libev4 libev-dev libxcb-composite0-dev libxcb-xinerama0 libxcb-randr0-dev libxcb-randr0 libx11-xcb-dev libjpeg-turbo8 libxcb-util libxcb-util-dev libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-xinerama0-dev libxcb-image0-dev xcb-xrm libxcb-util-dev libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev xorg-macros xutils-dev xorg-macros libpam0g-dev
# xcb-util-xrm
git clone https://github.com/Airblader/xcb-util-xrm
cd xcb-util-xrm
git submodule update --init
./autogen.sh --prefix=/usr
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