This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
CAMERA_INDEX = 0 | |
CODEC = cv2.cv.CV_FOURCC('D','I','V','X') | |
FPS = 15 | |
def main(): | |
cam = cv2.VideoCapture() | |
cam.open(CAMERA_INDEX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'octokit' | |
Octokit.configure do |c| | |
c.login = 'pickle27' | |
c.password = '<github token>' | |
end | |
repo = ARGV[0] | |
file = ARGV[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- autostart hydra | |
autolaunch.set(true) | |
-- watch for changes | |
pathwatcher.new(os.getenv("HOME") .. "/.hydra/", hydra.reload):start() | |
-- notify on start | |
hydra.alert("Hydra config loaded", 0.5) | |
-- open a repl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cd $(readlink -f $(dirname $0)) | |
exec ./exe $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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> |
OlderNewer