Skip to content

Instantly share code, notes, and snippets.

View Seanmatthews's full-sized avatar

Sean D Matthews Seanmatthews

  • Rowboat Entertainment
  • New York, NY
View GitHub Profile
@Seanmatthews
Seanmatthews / SeparatingAxisTheorem.cpp
Last active May 16, 2019 18:13
Separating Axis Theorem
#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 / i3lock-fancy-install.sh
Created November 26, 2019 17:07
i3lock-fancy Installation for Ubuntu 16.04
#!/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
@Seanmatthews
Seanmatthews / sakura.conf
Created August 15, 2021 16:21
Sakura terminal config
[sakura]
colorset1_fore=rgb(192,192,192)
colorset1_back=rgba(0,0,0,1)
colorset1_curs=rgb(255,255,255)
colorset1_key=F1
colorset2_fore=rgb(192,192,192)
colorset2_back=rgba(0,0,0,1)
colorset2_curs=rgb(255,255,255)
colorset2_key=F2
colorset3_fore=rgb(192,192,192)
@Seanmatthews
Seanmatthews / tmux-cheatsheet.markdown
Created November 16, 2021 19:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
[push]
default = simple
[submodule]
recurse = true
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@Seanmatthews
Seanmatthews / gopro_streaming.cpp
Last active November 24, 2021 14:31
GoPro Hero4 Black C++ Streaming With OpenCV
#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;
@Seanmatthews
Seanmatthews / config.el
Last active February 8, 2022 21:44
Doom Emacs Config
;;; $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 July 11, 2022 11:42
Config file for i3 window manager using apple keyboard
# 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 / laplace_of_gaussian_2D.cpp
Last active November 6, 2023 12:18
Compute Laplace of Gaussian kernel for a size and sigma using OpenCV
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
#include <assert.h>
// Calculates Laplace of Gaussian kernel
cv::Mat createLOGKernel(int ksize, double sigma)
{
using namespace cv;
using namespace std;
@Seanmatthews
Seanmatthews / fibonacci_sphere.py
Created May 29, 2018 02:54
Create equidistant points on the surface of a sphere using Fibonacci sphere algorithm
#!/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