Skip to content

Instantly share code, notes, and snippets.

@gvc
gvc / gist:1594940
Created January 11, 2012 14:37
Weird RegExp
# Can anybody explain why this happens?
name = "John Doe"
name.gsub(/John/, "\\'")
# " Doe Doe"
@gvc
gvc / recibo.html.haml
Created May 13, 2011 01:05
View of a receit
#recibo.column.span-24
.column.span-16.prepend-4
%h1.titulo RECIBO
.column.span-4.last
%h2=number_to_currency @recibo.valor_total
.texto-recibo.column.span-24.last
%p
             
= "Recebi de #{@recibo.recebido_de}, a importância de #{number_to_currency @recibo.valor_total} "
@gvc
gvc / marcacao.rb
Created May 13, 2011 01:04
Class that represents a medical appointment
# encoding: utf-8
class Agendamento::Marcacao < Agendamento::Agendamento
belongs_to :procedimento, class_name: 'Agendamento::Procedimento'
belongs_to :convenio
belongs_to :paciente
belongs_to :atendimento
validates_presence_of :horario, :procedimento