Skip to content

Instantly share code, notes, and snippets.

View rbrancher's full-sized avatar

Rodrigo Brancher rbrancher

  • Amazon
  • Seattle, WA - USA
View GitHub Profile
require 'spec_helper'
describe 'publications/index' do
describe 'title' do
before do
%w(authors medias countries dates publications).each { |var| assign(var, []) }
end
it 'should set with author name' do
assign(:author, 'agnaldo farias')
SitemapGenerator::Sitemap.default_host = 'http://leonardofinotti.com'
SitemapGenerator::Sitemap.create do
add root_path, changefreq: 'daily', priority: 1.0
add about_path, changefreq: 'monthly', priority: 0.9
# Projects
Project.published.each do |project|
add project_path(project), priority: 0.8, changefreq: 'weekly', lastmod: project.updated_at
def luz_e_forma_filters_path(params)
path = "/luz_e_forma"
path << "/" << params[:filters][:use] ? "all_uses" : params[:filters][:use]
path << "/" << params[:filters][:application] ? "all_applications" : params[:filters][:application]
path << "/" << params[:filters][:lamp] ? "all_lamps" : params[:filters][:lamp]
path << "/" << params[:filters][:designer] ? "all_designers" : params[:filters][:designer]
path << "/" << params[:filters][:manufacturer] ? "all_manufacturers" : params[:filters][:manufacturer]
path
end
// SERVER
Meteor.startup(function () {
// code to run on server at startup
Coords = new Meteor.Collection("coords");
Meteor.publish('coords', function () {
return Coords.find();
});
});
<div id="video_block" class="field-group grid_24 <%= "hidden" unless @item.type == 'video' %>">
<h2><%= t('publisher.video') %></h2>
<%= f.text_field :video_source %>
<%= attachment_container_for_video @item, :videos %>
</div>
var VimeoPlayer = function (player_id) {
this.player = document.getElementById(player_id);
this.player_ready = false;
this.play_when_ready = false;
this.play = function () {
if (this.player_ready !== true) {
this.play_when_ready = true;
}
this.command('play');

Separar em helpers

<%= attachment_container @album, :photos do |container| %>
  <div>
    <%= container.video_upload %>
  </div>

  <div>
 &lt;%= container.image_upload %&gt;
@rbrancher
rbrancher / gist:4252859
Created December 10, 2012 19:47
helper
def mmagick_container(model, relation, media_types = {upload: true, reference: false}, options = {})
data = data_attributes(model, relation, options)
id = "#{model.class.to_s.downcase}-#{relation.to_s}"
classes = "mmagick-wrapper #{relation.to_s}"
content_tag 'div', id: id, class: classes, data: data do
if block_given?
yield
else
render '/wrapper_content', partial_attributes(model, relation, media_types, options)
<ul class="mmagick-entries">
</ul>
<%= render '/reference_input' if media_types[:reference] %>
<%= render '/upload_input' if media_types[:upload] %>
# reference_input
<div class="mmagick-references-queue">
server {
listen 80;
listen 443;
server_name lumini.com.br www.lumini.com.br lumini-app-874277573.us-east-1.elb.amazonaws.com 107.22.255.53 ec2-174-129-157-250.compute-1.amazonaws.com;
charset utf-8;
root /home/ubuntu/rails_apps/lumini.com.br/current/public;