Skip to content

Instantly share code, notes, and snippets.

View waldofe's full-sized avatar
🦾

Oswaldo Ferreira waldofe

🦾
View GitHub Profile
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
Mat image_media;
Mat image;
char window_name1[] = "Imagem para ser processada";
char window_name2[] = "Imagem Processada";
@waldofe
waldofe / .gitconfig
Last active March 29, 2020 22:27
git plog
[alias]
plog = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@waldofe
waldofe / _media-queries.scss
Last active March 5, 2016 15:04
Sass mixin for media limitations
@mixin respond-to($type, $query) {
@media ($type: $query) {
@content;
}
}
@waldofe
waldofe / gulpfile.js
Last active January 30, 2016 21:49
Pre-compiling SCSS files using Gulp
'use strict';
// Requiring dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
// Naming paths and files
var scssFilesPath = './assets/stylesheets/**/*.scss';
var outputPath = './assets/stylesheets'
@waldofe
waldofe / 0_reuse_code.js
Created November 9, 2015 13:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
" Some config came from: http://vim.wikia.com/wiki/Example_vimrc
"
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on
" Tabs basic configuration.
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab smarttab
@waldofe
waldofe / gist:50b1d63e41de0ac46505
Created May 6, 2015 19:54
Testing Job call on model
# test
describe '#initialize_delayed_recharge_process' do
subject { create :transport_service_recharge_batch }
let(:calculation_job) do
instance_double(RH::TransportRechargeBatchCalculationJob)
end
it 'calls DelayedJob#enqueue on RH::TransportRechargeBatchCalculationJob' do
expect(RH::TransportRechargeBatchCalculationJob).to receive(:new).
set number
set tabstop=2
set expandtab
# size of an indent
set shiftwidth=2
# a combination of spaces and tabs are used to simulate tab stops at a width
# other than the (hard)tabstop
set softtabstop=2
@waldofe
waldofe / gist:f7f867f956463531c296
Last active August 29, 2015 14:04
Simple input form for time mask helper
def simple_input_time_form(f, attribute_time, opts = {})
default_opts = {
value_field: f.object.send(attribute_time),
attr_error: attribute_time,
format_time: :time,
icon_time: 'fa-clock-o',
col_size: 4
}
opts = default_opts.merge(opts)
@waldofe
waldofe / application_helper.rb
Last active August 29, 2015 14:04
Simple alert error message helper
module ApplicationHelper
# Renders the first field error of an object attribute on a red alert.
#
# @param klass [Class Object] - This object needs to
# include ActiveModel::Validations (or be a normal ActiveModel)
# @param field_sym [Symbol] - Attribute or field name of the object
def show_error_message_for(klass, attribute)
if klass.errors[attribute].any?
%(