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
#include "camshifting.h" | |
/* Create a camshift tracked object from a region in image. */ | |
TrackedObj* create_tracked_object (IplImage* image, CvRect* region) { | |
TrackedObj* obj; | |
//allocate memory for tracked object struct | |
if((obj = malloc(sizeof *obj)) != NULL) { | |
//create-image: size(w,h), bit depth, channels | |
obj->hsv = cvCreateImage(cvGetSize(image), 8, 3); |
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 | |
# Create Git Repository | |
# created by Jim Kubicek, 2009 | |
# jimkubicek@gmail.com | |
# http://jimkubicek.com | |
# DESCRIPTION | |
# Create remote git repository from existing project | |
# this script needs to be run from within the project directory |
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 node #// -*- Mode: Node.js JavaScript; tab-width: 4; -*- | |
/* | |
--- | |
url: http://gist.github.com/441101 | |
name : safari-get-html | |
description : safari-get-html will rock your socks! | |
authors : Thomas Aylott | |
copyright : © 2010 Thomas Aylott | |
license : MIT |
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
;; This makes ido-find-file-other-window, | |
;; ido-switch-buffer-other-window, et. al obsolete. It’s a much better | |
;; abstraction, and I believe it should become apart of ido mode, | |
;; because any command that uses ido-completing-read can benefit from | |
;; it without any additional effort, including textmate.el’s | |
;; textmate-goto-symbol. | |
(require 'ido) |
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
(defun ido-completing-read-multiple (prompt choices &optional predicate require-match initial-input hist def sentinel) | |
"Read multiple items with ido-completing-read. Reading stops | |
when the user enters SENTINEL. By default, SENTINEL is | |
\"*done*\". SENTINEL is disambiguated with clashing completions | |
by appending _ to SENTINEL until it becomes unique. So if there | |
are multiple values that look like SENTINEL, the one with the | |
most _ at the end is the actual sentinel value. See | |
documentation for `ido-completing-read' for details on the | |
other parameters." | |
(let |
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
class Hash | |
def with(&block) | |
block.call *block.parameters.map{|x| self[x.last]} | |
end | |
end | |
# Example | |
h = {:name => "blambeau", :hobby => "ruby"} |
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 ruby-local-exec | |
require 'rubygems' | |
require 'active_support' | |
require 'active_support/core_ext' | |
class Foo | |
def self.bar | |
'bar' |
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
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
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
module Compass::SassExtensions::Functions::GradientSupport | |
module Functions | |
def linear_gradient_hm_header(color) | |
stop1 = Sass::Script::Number.new(45, ["%"]) | |
stop2 = Sass::Script::Number.new(50, ["%"]) | |
cstops = color_stops( | |
hmBoxHdrGrad1(color), | |
ColorStop.new(hmBoxHdrGrad2(color), stop1), | |
ColorStop.new(color, stop2), |
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 'methodfinder' | |
# _why's MethodFinder addition tweaked and revised. | |
# <http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html> | |
class MethodFinder | |
def self.with_redirected_streams | |
redirect_streams | |
yield | |
ensure |
OlderNewer