A Pen by Jack OConnor on CodePen.
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
import React, { PropTypes } from 'react'; | |
import BaseComponent from 'libs/components/BaseComponent'; | |
import CommentBox from '../CommentBox/CommentBox'; | |
import css from './CommentScreen.scss'; | |
export default class CommentScreen extends BaseComponent { | |
static propTypes = { |
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
class User < ApplicationRecord | |
before_create :check_user_exists | |
# Include default devise modules. Others available are: | |
# :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable | |
private | |
def check_user_exists |
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
#en el modelo | |
#... | |
def self.search(search) | |
where("companies.name ILIKE ?", "%#{search}%") | |
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
- n = 0 | |
- @posts.each_with_index do |post, i| | |
%p= post.title | |
- if n < @banners.count | |
- if ((i+1) % 3 == 0) | |
%p= @banners.drop[n].first.title | |
- n += 1 |
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
def get_avatar(container,file,access_token) | |
@avatar_clean = ApiConecction.get("/Contenedores/#{container}/download/#{file}",access_token) | |
// aqui deberia tomar @avatar_clean.response_body y convertirlo en la imagen, pero no se que hacer | |
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
#... | |
after_save :facebookapplink | |
#... | |
private | |
require 'open-uri' | |
def facebookapplink | |
if self.facebook.present? |
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
@inserciones = Adblock.where(code: @sponsorsection).inject({}) {|h, p| h[p.id] = p.ranking; h} | |
@ofertas_select2 = WeightedRandomizer.new(@inserciones) | |
@ofertas_select = @ofertas_select2.sample(10) | |
@ofertas = [] | |
@ofertas_select.each do |o| | |
@insert = Adblock.find(o) | |
@oferta = @insert.coupon | |
if @oferta.publicada == true | |
@ofertas << @oferta | |
end |
simple Autumn falling leaves with GSAP
A Pen by Pelayo Maojo on CodePen.
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
Hello |