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 / .git-prompt.sh
Created November 2, 2018 16:38
Git prompt for maximum information
# 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).
# 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\]'
[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 / 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
@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 / SLACKTIVE.md
Last active January 11, 2017 16:54
Slack user keepalive
  1. Put slacktive.py somewhere on your system, then change the path in slacktive.plist
  2. Put com.sean.python.slacktive.plist in ~/Library/LaunchAgents/
  3. Add your token to com.sean.python.slacktive.plist (see file comments)
  4. launchctl load ~/Library/LaunchAgents/com.sean.python.slactive.plist
@Seanmatthews
Seanmatthews / xorg.conf.lg34uc97s
Created November 29, 2016 18:05
xorg.conf for Ubuntu 16.04 LG 34UC97-S split screen
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 375.20 (buildmeister@swio-display-x86-rhel47-06) Tu
e Nov 15 17:49:44 PST 2016
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
cv::Mat createLOGKernel1D(int ksize, float sigma)
{
using namespace cv;
float std2 = sigma * sigma;
std::vector<float> seq(ksize);
std::iota(begin(seq), end(seq), -(ksize-1)/2);
Mat_<float> kSeq(1, ksize, seq.data());
Mat XX;
@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 / 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;