This file contains hidden or 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
| def mail_subscribers(book, attrs = {}) | |
| @book = book | |
| @body ||=attrs[:body] | |
| if attrs[:attachments] | |
| puts attrs[:attachments] | |
| attrs[:attachments].all? { | |
| |attachment| | |
| attachments[attachment[:filename]] = attachment[:content] |
This file contains hidden or 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
| <div class="top-swiper-container" swiper="vert" my-fullscreen="y" ng-controller="mainCtrl" ng-class="{'info-open': infoOpen, 'nav-open': navOpen}"> | |
| <navigation ng-controller="infoCtrl"> | |
| <div id="info"> | |
| <div id="info-wrapper" my-info="data.info" ng-click="toggleInfo()"> | |
| </div> | |
| </div> | |
| <div class="nav-trigger" ng-click="toggleNav();"><span></span></div> | |
| <div class="pagination-wrapper"> |
This file contains hidden or 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
| /* | |
| * Modified on 11.02.2014 by walidvb | |
| * to add a 'visual' checkbox, added by the soundcloud API | |
| * | |
| * | |
| * | |
| */ | |
| <?php |
This file contains hidden or 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
| angular.module('myApp.services', ['ngResource']). | |
| service('Projects', ['$resource', '$filter', | |
| function($resource, $filter) | |
| { | |
| var data = $resource('https://dl.dropboxusercontent.com/s/9jogzvut6v8xz62/works.json',{}, {getData: {method: 'GET'}}); | |
| this.getAllProjects = function() { | |
| return data; | |
| } | |
| this.getProjectsByID = function(projectID) { | |
| return $filter('filter')(data, {id: projectID}) |
This file contains hidden or 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
| mod = angular.module('infinite-scroll', []) | |
| mod.directive 'infiniteScroll', ['$rootScope', '$window', '$timeout', ($rootScope, $window, $timeout) -> | |
| link: (scope, elem, attrs) -> | |
| $window = angular.element($window) | |
| # from jQuery UI (https://github.com/jquery/jquery-ui/blob/2f497023261a7400295f4dd64c45139232a0ea4f/ui/jquery.ui.core.js#L60) | |
| $scrollParent = elem.parents() | |
| .filter -> | |
| console.log ($.css this, 'overflow') + ($.css this, 'overflow-y') + ($.css this, 'overflow-x') |
This file contains hidden or 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
| for(int i = 0; i < w; i+=chan) | |
| { | |
| for(int j = 0; j < h; j+=chan) | |
| { | |
| uchar v = srcImg.pixelAt(i, j) > 127 ? 255 : 0; | |
| if(d){cout << v << endl; d = !d;} | |
| dstImg.pixelWrite(v, i, j); | |
| } | |
This file contains hidden or 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
| $view = new view; | |
| $view->name = 'blog_view'; | |
| $view->description = ''; | |
| $view->tag = 'default'; | |
| $view->base_table = 'node'; | |
| $view->human_name = 'blog-view'; | |
| $view->core = 7; | |
| $view->api_version = '3.0'; | |
| $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
This file contains hidden or 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
| Image RDC::compensate(const Image& srcImg) | |
| { | |
| Image dstImg(srcImg.width, srcImg.height); | |
| for (int i = 0; i < srcImg.width; i++) | |
| { | |
| for (int j = 0 ; j < srcImg.height; j++) | |
| { | |
| float newPix = 0; | |
| //Simple fixed threshold method | |
| if (srcImg.pixelAt(i,j) > 127) |
This file contains hidden or 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
| //cv::imshow("", img.pixels); | |
| Channel32f chan(img.width, img.height); | |
| for(int i = 0; i < img.pixels.rows; i++) | |
| { | |
| for (int j = 0; j<img.pixels.cols; j++) | |
| { | |
| chan.setValue(ci::Vec2i(i, j), img.pixelAt(i, j)); | |
| } | |
| } | |
This file contains hidden or 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
| // number of corners on the chessboard | |
| Size boardSize(6,5); | |
| //init the system | |
| CalibController calibControl(boardSize); | |
| //Load the images | |
| string filePath = "/Users/Gaston/dev/RDC/tmp/IMG_0701.JPG"; | |
| Mat image = imread(filePath, CV_LOAD_IMAGE_COLOR); | |
| //Resize the images to a more reasonable size before treatment |