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
// views needed, generated by the back-end. | |
var views = ['an', 'array', 'of', 'views']; | |
require(['libraries'], function () { | |
require(['global', 'plugins'], function(){ | |
require(['models', 'collections'], function(){ | |
require(views); | |
}); | |
}); | |
}); |
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
// Returning the jQuery plugin at the end of its requirejs module. | |
return function( $elem, options ) { | |
return $elem.someJQueryPlugin.apply($elem, Array.prototype.slice.call( arguments, 1 )); | |
}; | |
// Instead of this: | |
$foo.someJQueryPlugin({'bar': true}); |
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
// Router Module | |
// -------------------------------------------- | |
// | |
// * **Class:** Router | |
// * **Version:** 0.1 | |
// * **Modified:** 05/01/2013 | |
// * **Author:** George Pantazis | |
// | |
// This class is a lightweight extraction of Backbone's router object. For more information, please | |
// refer to [that project's documentation](http://backbonejs.org/#Router). |
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
// schema/killer-thing.json | |
{ | |
"parents": ["Grid", "Container"], // Grids and Containers can add KillerThing as a submodule. | |
"model": { | |
"foo": "String", | |
"bar": "Integer", | |
"baz": "Boolean", | |
"a": ["CoolThing"], // An Array of CoolThing Models. | |
"b": "RadThing" // A single RadThing Model. |
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
# Installing OpenCV python libs on mac to work with virtualenv | |
# OpenCV 2.4.3 | |
# Python 2.7.3 installed with brew | |
# assuming you have virtualenv, pip, and python installed via brew | |
# assuming $WORKON_HOME is set to something like ~/.virtualenvs | |
# using homebrew - make sure we're current | |
brew update |
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 <opencv2/gpu/gpu.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
using namespace cv; | |
int main(int argc, char* argv[]) | |
{ | |
Mat src_img, dst_img; |
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 | |
echo "http://placehold.it/$(identify $1 | sed -n 's/.* \([0-9][0-9]*x[0-9][0-9]*\) .*/\1/p')" |
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
var checkActive = function(el) { | |
var self = this, | |
elRect = el.getBoundingClientRect(), | |
winRect = document.documentElement.getBoundingClientRect(), | |
isNearBottom = winRect.bottom - elRect.bottom < 100 && $(document).height() - ($(window).scrollTop() + $(window).height()) < 100; | |
if (elRect.top < 100 && elRect.top > 0 || isNearBottom) { | |
// Element is scrolled into view. | |
} |
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
// Semantic Versioning Tool | |
// ======================== | |
// | |
// See: http://semver.org/ | |
// For projects with package.json in the target folder. | |
// | |
// * Author: George Pantazis | |
// | |
// * Usage: | |
// * Major (0.x.x -> 1.0.0) : `node version-update major` |
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
<script id="<%= dashName %>-fixture" type = "text/template"> | |
@Html.Partial("app/modules/<%= dashName %>/html/<%= dashName %>") | |
</script> |