Skip to content

Instantly share code, notes, and snippets.

@stilist
stilist / gist:cd7fdfabbf9ec5ed89b7
Created July 3, 2014 21:46
Installing OpenCV on OS X (using Homebrew)

Based on http://jjyap.wordpress.com/2014/02/21/installing-opencv-2-4-8-on-mac-osx-with-python-support/

  1. edit .bashrc or .bash_profile to include: export PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Python/2.7/site-packages/:$PATH"
  2. brew update
  3. brew tap homebrew/science
  4. brew install opencv
  5. cd /Library/Python/2.7/site-packages/
  6. ln -s /usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv.py cv.py
  7. ln -s /usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv2.so cv2.so
@stilist
stilist / init.pp
Created July 11, 2014 22:11 — forked from asimihsan/init.pp
class opencv {
Exec { path => "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin", }
$version = "2.4.6.1"
$libopencv_core_filename = "libopencv_core.so.2.4.6"
case $operatingsystem {
# Install OpenCV from source. This is an instructive example
# and may come in handy if we need to move to a version of
@stilist
stilist / .bash_profile
Created September 2, 2014 17:32
line count change for current git branch
function parse_git_branch () {
local git_status="`git status -unormal 2>&1`"
# http://toucware.blogspot.com/2012/05/partial-string-matching-in-bash.html
#
# TODO Catch case when repo is initialized but not committed.
if [[ "$git_status" == fatal* ]] ; then
echo ""
else
# http://stackoverflow.com/a/11958481/672403
@stilist
stilist / clear_build_target_test.js
Created November 12, 2014 02:17
Unusable test for clear-broccoli-build-target
'use strict'
var Builder = require('broccoli').Builder,
// see https://github.com/stilist/clear-broccoli-build-target
clearBuildTarget = require('../lib/clear-build-target'),
fs = require('fs-extra'),
test = require('tap').test
test('clear build target', function (t) {
var test_dir = 'tmp_test'
@stilist
stilist / index.html
Last active April 19, 2016 06:33
Aurora map
<!doctype html>
<meta charset='utf-8'>
<style>
.n0 {fill:#f7fcf5;}
.n1 {fill:#e5f5e0;}
.n2 {fill:#c7e9c0;}
.n3 {fill:#a1d99b;}
.n4 {fill:#74c476;}
.n5 {fill:#41ab5d;}
.n6 {fill:#238b45;}
@stilist
stilist / index.html
Last active August 29, 2015 14:24
US air quality
<!doctype html>
<meta charset='utf-8'>
<style>
.data-datapoint {fill:transparent; stroke-width:1px;}
.aqi1 {stroke:#00e400;}
.aqi2 {stroke:#ffff00;}
.aqi3 {stroke:#ff7e00;}
.aqi4 {stroke:#ff0000;}
.aqi5 {stroke:#99004c;}
@stilist
stilist / conrec.js
Last active August 29, 2015 14:24
US wind speed
/**
* Copyright (c) 2010, Jason Davies.
*
* All rights reserved. This code is based on Bradley White's Java version,
* which is in turn based on Nicholas Yue's C++ version, which in turn is based
* on Paul D. Bourke's original Fortran version. See below for the respective
* copyright notices.
*
* See http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/ for the original
* paper by Paul D. Bourke.
@stilist
stilist / LICENSE
Last active May 3, 2016 15:27
RFC 3966 regex
Copyright (c) 2016 Jordan Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@stilist
stilist / LICENSE
Created January 9, 2016 23:53
Simple clock that uses quipu numbering
Copyright (c) 2016 Jordan Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@stilist
stilist / .ruby-version
Last active February 29, 2016 18:11
MultiJSON vs standard library JSON (derived from http://gist.github.com/eirc/1300627)
2.3.0