Git Product home page Git Product logo

tumblr's Introduction

Tumblr Clone

In this project I cloned the popular blogging site tumblr.

The live version is up here

Some of the technologies featured include:

Polymorphic Associations

Posts can be of different types ie: Text, Quote, Photo.

All posts share some datafields ie: post_date, user_id

To avoid having to:

all_posts = current_user.text_posts
all_posts = all_posts.merge( current_user.photo_posts ).

the Post Model holds a field 'content_type' which is a string reference to the model name of the content the post holds. Thus to access a posts content I can use:

// in post.rb
def content
  return false unless self.content_type
  self.content_type.constantize.find_by_post_id(self.id)
end

Amazon Cloud Storage.

None of the photos are held on heroku. Use the paperclip gem to store my photos in a bucket at AWS.

Rich Text Editor Plugin

There are indeed many plugins to do rich text editng ( tinyMCE, nicEdit ...). After playing with both a little I discovered that the meat of what they do is centered around this command:

document.execCommand()  

So I spent a day writing my own library for repeated use that fits my needs. Rome was not built in a day, while functional there are bugs listed in issues. And it works only in Chrome.

Nokogiri Content

The content is scraped from popular real tumblr pages with the gem nokogiri.

tumblr's People

Contributors

aastudent avatar breadbaker avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.