Skip to content

Instantly share code, notes, and snippets.


Sean D Matthews Seanmatthews

  • Rowboat Entertainment
  • New York, NY
View GitHub Profile
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 /
Created Nov 2, 2018
Git prompt for maximum information
# bash/zsh git prompt support
# Copyright (C) 2006,2007 Shawn O. Pearce <>
# 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. ~/
View ps1.bashrc
# store colors
View .gitconfig
editor = emacs -nw
default = simple
recurse = true
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
Seanmatthews /
Last active Jan 11, 2017
Slack user keepalive
  1. Put 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 / laplace_of_gaussian_2D.cpp
Last active Dec 23, 2016
Compute Laplace of Gaussian kernel for a size and sigma using OpenCV
View laplace_of_gaussian_2D.cpp
#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;
View laplace_of_gaussian_1D.cpp
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,;
Mat XX;
Seanmatthews / xorg.conf.lg34uc97s
Created Nov 29, 2016
xorg.conf for Ubuntu 16.04 LG 34UC97-S split screen
View xorg.conf.lg34uc97s
# 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"