Skip to content

Instantly share code, notes, and snippets.

View andreferraro's full-sized avatar
🎯
Focusing

Andre Ferraro andreferraro

🎯
Focusing
  • Brazil
  • 05:55 (UTC -03:00)
View GitHub Profile
pdf.stroke_color "CCCCCC"
pdf.font "Helvetica", :size => 14
pdf.text @uf.uf.to_s, :size => 30, :style => :bold
pdf.stroke_horizontal_rule
pdf.move_down(20)
pdf.text "Id: " + @uf.id.to_s
pdf.text "Uf: " + @uf.uf.to_s
pdf.text "Sigla: " + @uf.sigla.to_s
if [email protected]_content_type.index("image/gif") && (@uf.bandeira_content_type.index("image/png") || @uf.bandeira_content_type.index("image/jpeg") || @uf.bandeira_content_type.index("image/jpg"))
pdf.image "#{RAILS_ROOT}/public/images/" + @uf.bandeira.to_s.gsub(/\?.[0-9]*/,""), :at => [500, 480]
# exportação de TODOS os dados no formato xml e json
def export
@ufs = Uf.find(:all, :order => "uf")
prawnto :prawn => {:page_layout => :landscape}
respond_to do |format|
format.xml { render :xml => @ufs }
format.json { render :json => @ufs }
format.csv do
@output_encoding = 'ISO-8859-1'
@filename = "ufs.csv"
class Backend::DashboardController < ApplicationController
layout "backend"
def index
end
end
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
#BREADCRUMBS
before_filter :trail
pt-BR:
# formatos de data e hora
date:
formats:
default: "%d/%m/%Y"
short: "%d de %B"
long: "%d de %B de %Y"
day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta, Sábado]
abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb]
# Removendo as paginas que nao iremos utilizar
run "rm README"
run "rm doc/README_FOR_APP"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
#Colando a rota padrao
route %(map.root :controller => "dashboard")
#!/bin/bash
wget -c http://www.famfamfam.com/lab/icons/silk/famfamfam_silk_icons_v013.zip
unzip famfamfam_silk_icons_v013.zip
rm readme.html
rm readme.txt
cd icons
mv * ../public/images/web-app-theme/
cd ..
rm -R icons
rm famfamfam_silk_icons_v013.zip