Skip to content

Instantly share code, notes, and snippets.

jQuery(document).ready(function() {
validate_contact_form('#contact_form');
validate_contact_form('.productsPopup');
});
function validate_contact_form(form){
var validation_fields = ["#first_name", "#last_name", "#company", "#phone"];
jQuery.each(validation_fields, function(index, value){
$(form + ' ' + value).blur(function(){
@tomeara
tomeara / inline_svg_helper.rb
Last active October 25, 2019 13:01
Inline SVG for Rails
# Put this method in your helper file to render inline SVG
def inline_svg(path)
file = File.open("app/assets/images/#{path}", "rb")
raw file.read
end
@tomeara
tomeara / AngularWaiter
Created January 21, 2014 16:11
Reusing the main components of https://github.com/wrozka/capybara-angular, but made to be a "drop-in" module. Just use `wait_until_ready` whenever you want Capybara to catch-up to any Angular requests.
module AngularWaiter
def setup_ready
page.execute_script <<-JS
window.angularReady = false;
var app = $('*[ng-app]');
var injector = app.injector();
injector.invoke(function($browser) {
$browser.notifyWhenNoOutstandingRequests(function() {
window.angularReady = true;

Keybase proof

I hereby claim:

  • I am tomeara on github.
  • I am tomeara (https://keybase.io/tomeara) on keybase.
  • I have a public key ASB8tH2zXZh5o8XzoKd64SvtTlipoajmu7ZCG4N9KmI-9go

To claim this, I am signing this object:

@tomeara
tomeara / init.vim
Created July 27, 2017 00:44
Dotfiles
set nocompatible
filetype off
" make sure to add vim-plug to the autoload dir
call plug#begin('~/.vim/bundle')
" Plug 'Numkil/ag.nvim'
Plug 'Shougo/denite.nvim'
Plug 'Shougo/deoplete.nvim'
Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets'
# Terminal colors
set -g default-terminal "xterm-256color"
# Fixes the problem with Vim/Tmux rendering
set-window-option -g utf8 on
# Set new binding
set -g prefix C-a
unbind C-b
bind C-a send-prefix