This file contains hidden or 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
FactoryGirl.define do | |
factory :application do | |
attachment :sample, "public/samples/sample.doc", "application/msword" | |
end | |
end |
This file contains hidden or 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 salvar a altura e largura das imagens enviadas pelo plugin paperclip, utilize o callback abaixo | |
# | |
# class Document < ActiveRecord::Base | |
# | |
# has_attached_file :document, :styles => { :medium => "300x300>" } | |
# | |
# before_save :save_dimensions | |
# | |
# def save_dimensions | |
# if document.image? |
This file contains hidden or 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
#!/bin/bash | |
mkdir -p kubecon_files | |
DAYS=("2017-12-06" "2017-12-07" "2017-12-08") | |
for DAY in "${DAYS[@]}"; do | |
#Super shitty pipefest because of grep matched groups sadness | |
LINKS=($(curl https://kccncna17.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' ')) | |
for LINK in "${LINKS[@]}"; do | |
echo "Requesting https://kccncna17.sched.com/${LINK}" |