This file contains 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
#application_helper.rb | |
def google_static_map_image_path(address,options={}) | |
size = options[:size]? options[:size] : "220x220" | |
zoom = options[:zoom]? options[:zoom] : "16" | |
maptype = options[:maptype]? options[:maptype] : "roadmap" | |
sensor = options[:sensor]? "true" : "false" | |
query_string = "center=#{address.address_path}&zoom=#{zoom}&size=#{size}&maptype=#{maptype}&sensor=#{sensor}&markers=#{address.address_path}" | |
base_url="http://maps.google.com/maps/api/staticmap?#{query_string}" | |
end |
This file contains 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
// Imports ------------------------------------------------------------------- | |
@import "compass/reset" | |
@import "compass/typography" | |
@import "compass/css3" | |
@import "compass/layout" | |
@import "compass/utilities" | |
@import "compass/typography/vertical_rhythm" | |
//Grid ------------------------------------------------------------------ | |
//Sorry susy has to be imported |
This file contains 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
group :assets do | |
gem 'sass-rails', "~> 3.1.0" | |
#gem 'coffee-rails', "~> 3.1.0" | |
gem 'uglifier' | |
gem "compass", "~> 0.12.alpha" | |
gem "compass-rgbapng", :require => "rgbapng" | |
gem "compass-susy-plugin", :require => "susy" | |
gem 'tinymce-rails' | |
end |
This file contains 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
map.namespace :users, :as => "members",:name_prefix => 'user' do |user| | |
user.resources :users,:path_prefix => "", :name_prefix => '',:except => [:destroy,:edit,:index,:show,:update,:create,:new,:send_email] do |user| | |
user.resources :projects, :except => [:destroy] do |project| | |
project.resources :collaborators, | |
:name_prefix => '', | |
:only => [:new,:edit,:create, :update], | |
:collection => {:order => :post, :search => :get} | |
end | |
end | |
end |
This file contains 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
$('#products').append('<%= j render(@products) %>'); | |
<% if @products.next_page %> | |
$('.pagination').replaceWith('<%= j will_paginate(@products) %>'); | |
<% else %> | |
$('.pagination').remove(); | |
<% end %> |
This file contains 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
# Because we have some old legacy users in the database, we need to override Devises method for checking if a password is valid. | |
# We first ask Devise if the password is valid, and if it throws an InvalidHash exception, we know that we're dealing with a | |
# legacy user, so we check the password against the SHA1 algorithm that was used to hash the password in the old database. | |
#SOURCES OF SOLUTION: | |
# http://stackoverflow.com/questions/6113375/converting-existing-password-hash-to-devise | |
# https://github.com/binarylogic/authlogic/blob/master/lib/authlogic/crypto_providers/sha512.rb | |
# https://github.com/plataformatec/devise/blob/master/lib/devise/encryptors/authlogic_sha512.rb | |
alias :devise_valid_password? :valid_password? | |
def valid_password?(password) |
This file contains 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
Ejemplo: http://visca.cat/es/research/projects/temporal-and-spatial-effects-on-awareness-of-reachability |
This file contains 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
require File.expand_path(File.dirname(__FILE__) + "/../sanitize_tinymce_text") | |
include SanitizeTinymceText | |
namespace :html do | |
desc "Limpiar descripciones guarrillas con css inline y spans" | |
task :clean => :environment do | |
Publication.all.each do |pub| | |
pub.abstract = sanitize_text(pub.abstract) | |
pub.save |
This file contains 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
function splash_window(){ | |
// Busco con js la cookie | |
var splash = jQuery.cookie('splash'); | |
if(splash==null){ | |
// Si no la encuentro la escribo en su navegador | |
document.cookie = 'splash=1; path=/; expires=' + new Date(2030,1,15).toUTCString(); | |
//Como no la he encontrado le lanzo el popup | |
// Si ya la tuviera no entraria por aqui. | |
jQuery(document).bind('init.facebox',function() { |