Skip to content

Instantly share code, notes, and snippets.

View kevinhughes27's full-sized avatar

Kevin Hughes kevinhughes27

View GitHub Profile
@kevinhughes27
kevinhughes27 / himawari.ps1
Created February 22, 2016 03:07 — forked from MichaelPote/himawari.ps1
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@kevinhughes27
kevinhughes27 / avgEpisode.py
Created January 10, 2016 18:16
the script I used to average every episode of That 70's Show into a singe video
# first mount the samba share (use the gui)
# then link the mounted smb share somewhere more convientent
# sudo ln -s /run/user/1000/gvfs/smb-share:server=dlink-71f6dd,share=volume_1-1 /mnt/network
# then run as usual
# python avgEpisode.py /mnt/network/TV\ Shows/That\ \'70s\ Show/ output.avi
import os
import sys
@kevinhughes27
kevinhughes27 / robust_pca_project.py
Last active January 2, 2016 23:29
An Implementation of the robust subspace projection technique described in: A. Leonardis and H. Bischof. Robust recognition using eigenimages. Computer Vision and Image Understanding, 78:99--118, 2000. based off of source provided by the original authors
#!/usr/bin/env python
# robust_pca_project.py
#
# Author: Kevin Hughes
# Date: May 2013
"""
An Implementation of the robust subspace projection technique described in:
@kevinhughes27
kevinhughes27 / cv2sg.cpp
Last active December 24, 2015 05:39
Using OpenCV and Shogun Machine Learning
/* Using OpenCV and Shogun Machine Learning
* gist by Kevin Hughes
*/
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <shogun/base/init.h>
#include <shogun/lib/common.h>
#include <shogun/lib/SGMatrix.h>
@kevinhughes27
kevinhughes27 / Eigen3_NumPy_Print.cpp
Last active December 21, 2015 18:29
NumPy style printing in C++ for Eigen 3
using namespace Eigen;
typedef Matrix< float64_t, Dynamic, Dynamic, ColMajor > EMatrix;
using std::cout;
using std::endl;
void print(EMatrix A)
{
int n = A.rows();
int m = A.cols();
@kevinhughes27
kevinhughes27 / setdir.sh
Created April 4, 2013 16:17
Sets the directory for execution to be the lowest directory. This is helpful for ensuring relative paths work inside your program
#!/bin/bash
set -e
cd $(readlink -f $(dirname $0))
exec ./exe $*
@kevinhughes27
kevinhughes27 / CMakeLists.txt
Created April 4, 2013 15:57
PCL CMake File
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(HelloWorld)
set(EXE HelloWorld)
find_package(PCL 1.6 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
@kevinhughes27
kevinhughes27 / coding-timer.sh
Created November 28, 2015 01:10
A simple program to display a warning message if I have been coding for more than 90 mins
#!/usr/bin/env bash
# add to cron tab
# crontab -e
# then append:
# */30 * * * * /home/kevin/coding-timer.sh
# need to have:
# xhost local:mpromber > /dev/null
# in bashrc
@kevinhughes27
kevinhughes27 / my-fitness-pal-scrape.py
Created August 23, 2015 17:36
scrape date between 2 date ranges from my fitness pal. Scrapes current nutrients being tracked but you can change your settings and re-run the scraper
import myfitnesspal # pip install myfitnesspal
import ipdb
print 'logging in ...'
client = myfitnesspal.Client('username', 'password')
days = []
for i in range(2, 18+1):
print 'fetching 2015, 6,', i
days.append( client.get_date(2015, 6, i) )
@kevinhughes27
kevinhughes27 / zuluru-scrape-polys.js
Last active August 29, 2015 14:25
scrape the actual polygon points from zuluru field drawings
// run by pasting the function into dev console then call it
// can also use something like Custom JavaScript for websites:
// https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
// name and field are set by Zuluru
function scrape() {
data = ""
fields.forEach(function(field){