Skip to content

Instantly share code, notes, and snippets.

@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
@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
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= "Recebi de #{@recibo.recebido_de}, a importância de #{number_to_currency @recibo.valor_total} "
@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"
defmodule HappyNumbers do
def happy?(n) do
do_happy?(n, [])
end
defp do_happy?(1, _sequence), do: true
defp do_happy?(n, sequence) do
if Enum.member?(sequence, n) do
false
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
import { sleep, group } from 'k6'
import http from 'k6/http'
import jsonpath from 'https://jslib.k6.io/jsonpath/1.0.2/index.js'
export default function main() {
let response
const vars = {}
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from 'k6'
import http from 'k6/http'
export default function main() {
let response
group('page_1 - https://gatsby.vtex.app/', function () {
response = http.post(
@gvc
gvc / gatsby-2023-09-06.js
Created September 6, 2023 18:11
gatsby-2023-09-06.js
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from 'k6'
import http from 'k6/http'
export default function main() {
let response
group('page_1 - https://gatsby.vtex.app/', function () {
response = http.get(
@gvc
gvc / gatsby-2023-09-27.js
Created September 27, 2023 13:16
gatsby-2023-09-27
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from 'k6'
import http from 'k6/http'
export default function main() {
let response
group('page_1 - https://gatsby.vtex.app/', function () {
response = http.post(
@gvc
gvc / gatsby-2023-09-28.js
Created September 28, 2023 16:23
gatsby-2023-09-28.js
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from 'k6'
import http from 'k6/http'
import jsonpath from 'https://jslib.k6.io/jsonpath/1.0.2/index.js'
export default function main() {
let response