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
# files_controller.rb | |
class FilesController < ApplicationController | |
def index | |
@files = Files.all | |
end | |
... | |
end |
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
# | |
# Para conseguir que compile os assets locais, depois | |
# de muito quebrar a cabeça, eu achei em um post de | |
# como escrever o deploy.rb para o Capistrano 3 esta | |
# pérola, que fez tudo 'ir para frente': | |
# | |
# "Entre as inovações do Cap3 está a descontinuação | |
# da sua DSL própria e a adoção do Rake" | |
# | |
# Então precisava somente saber como trocar uma task |
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 Validations = (function(){ | |
var Validation = function() { | |
var name = $("[name='nome']"); | |
var email = $("[name='email']"); | |
var empresa = $("[name='empresa']"); | |
var telefone = $("[name='telefone']"); | |
var mensagem = $("[name='mensagem']"); | |
var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
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
# derived from http://railscasts.com/episodes/340-datatables | |
# handles server side multi-column searching and sorting | |
class Datatable | |
delegate :params, :h, :raw, :link_to, :number_to_currency, to: :@view | |
def initialize(klass,view) | |
@klass = klass | |
@view = view | |
end |
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
namespace :foreman do | |
desc <<-DESC | |
Export the Procfile to upstart. | |
You can override any of these defaults by setting the variables shown below. | |
set :foreman_cmd, "foreman" | |
set :foreman_format, "upstart" | |
set :foreman_location, "/etc/init" | |
set :foreman_port, 5000 |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
= simple_form_for person, remote: true do |f| | |
.row | |
.col-xs-12.col-sm-12.col-md-6 | |
= f.fields_for :address do |builder| | |
= render 'form_address', f: builder |
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
" Note: Skip initialization for vim-tiny or vim-small. | |
if !1 | finish | endif | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif |
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
namespace('App.data') | |
### | |
Meteor pagination class | |
Usage | |
UsersController = RouteController.extend | |
waitOn: -> | |
@page = @params.query.page || 1 | |
@pagination = new App.data.Pagination(Users, selector, {page: @page}) |
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
// Config file at "client/lib/inputmask.js" - I used this to create a new mask type | |
$.extend($.inputmask.defaults.definitions, { | |
H: { | |
validator: '[0-9a-fA-F]', | |
cardinality: 1 | |
} | |
}); |
OlderNewer