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
let $back; | |
const BACKGROUND_ID = '#background', SCROLL_SELECTOR = 'main'; | |
//hard-coded backgoround image size to start parallax asap | |
let sizes = { | |
width: 1678, height: 2481 | |
}; | |
$(document).on('turbolinks:load', () => { | |
$(scrollSelector).on('scroll', handleParallax); | |
setSize(); |
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 $elem = $('.has-background-image'); | |
function parallax() { | |
var top = $elem.offset().top; | |
if((pos = (top-window.scrollY))-window.innerHeight <= 0) | |
{ | |
var yPos = pos * 0.15; | |
var coords = "50% "+yPos+"px"; | |
$elem.css("backgroundPosition", coords); | |
} | |
}; |
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
Job failed to load: allocator undefined for Proc. Handler: "--- !ruby/object:Delayed::PerformableMethod\nobject: !ruby/object:CommentsMailer\n _routes: \n _action_has_layout: true\n _mail_was_called: false\n _message: !ruby/object:Mail::Message\n body: !ruby/object:Mail::Body\n boundary: \n preamble: \n epilogue: \n charset: US-ASCII\n part_sort_order:\n - text/plain\n - text/enriched\n - text/html\n parts: !ruby/array:Mail::PartsList []\n raw_source: ''\n encoding: 7bit\n body_raw: \n separate_parts: false\n text_part: \n html_part: \n errors: \n header: !ruby/object:Mail::Header\n errors: []\n charset: UTF-8\n raw_source: ''\n fields: !ruby/array:Mail::FieldList []\n charset: UTF-8\n defaulted_charset: true\n smtp_envelope_from: \n smtp_envelope_to: \n perform_deliveries: true\n raise_delivery_errors: true\n delivery_handler: \n delivery_method: !ruby/object:Mail::SMTP\n settings: |
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
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 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 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 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 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 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 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 |