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
(function( exports ) { | |
var onDOMReady = function( fn ) { | |
if ( document.readyState !== 'loading' ) { | |
fn(); | |
} else { | |
document.addEventListener( "DOMContentLoaded", fn ); | |
} | |
}; | |
exports.onDOMReady = onDOMReady; |
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 is a version of https://github.com/juliensobrier/google-safe-browsing-lookup-ruby, | |
# modified to work against Ruby 1.9.2 and not blow up when malformed URLs are encountered. | |
# | |
# The library requires an API key from Google. | |
# Sign up for a free key a http://code.google.com/apis/safebrowsing/key_signup.html | |
# | |
# See README.rdoc for more information about Google Safe Browsing v2 API | |
# and this library. | |
# | |
# Author:: Julien Sobrier (mailto:julien@sobrier.net) |
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 code is modified from the working version to remove coupling with the original | |
// application, and hasn't been tested in its new form. So, it's enough to give you | |
// the basic idea, but may not entirely work ;) | |
// | |
// It assumes the src image is in HSV and the dst image is grayscale. | |
// | |
// CvScalar red = cvScalar(179, 255, 255); | |
// CvScalar lowOffset = cvScalar(-20, -150, -150); // find colors down to h = 159, s = 105, v = 105 | |
// CvScalar highOffset = cvScalar(20, 0, 0); // find colors up to h = 19, s = 255, v = 255 (h wraps/is mod 179) | |
// colorThreshold(img, thresholded, red, lowOffset, highOffset); |
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 | |
in="$1" | |
bumper_img="$2" | |
seek="$3" # "hh:mm:ss" or # of seconds | |
length="$4" # "hh:mm:ss" or # of seconds | |
ffmpeg \ | |
-f image2pipe -vcodec ppm -i <( | |
ffmpeg \ |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
src_files: | |
- assets/javascripts/app.js.coffee | |
- assets/spec.js.coffee | |
# ... | |
stylesheets: | |
- assets/stylesheets/app.css |
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 "Canvas.h" | |
Canvas * Canvas::p_Instance = NULL; | |
Canvas * Canvas::Instance(){ | |
if(!p_Instance) p_Instance = new Canvas(); | |
return p_Instance; | |
} | |
Canvas::Canvas(){ |
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
// useful as a basis for rendering parts of the image across multiple monitors | |
// see also http://www.opengl.org/wiki/GluPerspective_code | |
// and https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/gl/ofGLRenderer.cpp#L315 | |
void testApp::draw(){ | |
ofxFenster * win = ofxFensterManager::get()->getActiveWindow(); | |
ofPoint size = win->getWindowSize(); | |
glMatrixMode(GL_PROJECTION); | |
glLoadIdentity(); | |
float halfFovTan = tanf(60 * PI / 360.0); |
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 'ruote/fei' | |
class Ruote::FlowExpressionId | |
def initialize(h) | |
@h = h | |
class << h; include Ruote::HashDot; end | |
# Howcast: don't use sub_wfid if we arleady have a subid | |
@h['subid'] = @h.delete('sub_wfid') if @h['sub_wfid'] && !@h['subid'] | |
# TODO : for 2.1.13, remove this |
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 'ruote/svc/participant_list' | |
class Ruote::ParticipantList | |
def instantiate_with_arg_normalization pinfo, opts={} | |
pinfo = [pinfo, {}] if pinfo.is_a?(String) # This will get all breaky if we ever pass options to the participant definition | |
instantiate_without_arg_normalization(pinfo, opts) | |
end | |
alias_method_chain :instantiate, :arg_normalization | |
end |