Coder Social home page Coder Social logo

igormatos / initials-avatar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from loopj/initials-avatar

0.0 2.0 0.0 206 KB

Generate an avatar image from a user's initials, ideal for use as a meaningful gravatar fallback.

License: MIT License

Ruby 100.00%

initials-avatar's Introduction

Initials Avatar

Generate an avatar image from a user's initials, ideal for use as a meaningful gravatar fallback. For example:

Usage

Basic Usage

Generate a 100x100 avatar for the initials JD:

http://initials.me/jd

Basic avatar

Specifying Size

Generate an 50x50 avatar for the initials JS:

http://initials.me/js?s=50

50x50 avatar

Specifying Colors

Generate an avatar with custom foreground/background colors:

http://initials.me/js?s=50&fg=336699&bg=ffcc00

Colored avatar

Use as a Gravatar Fallback

Show the Gravatar for a particular user, and fallback to showing their initials (JD) if the Gravatar doesn't exist:

http://www.gravatar.com/avatar/00000000000000000000000000000000?d=http%3A%2F%2Finitials.me%2FJD

Dependencies

This app requires ImageMagick and Ghostscript to be installed:

Mac

$ brew install imagemagick ghostscript

Ubuntu

$ sudo apt-get install ruby-dev libmagickwand-dev imagemagick

Installation

bundle install

Starting the Server

Rackup

For running locally, I recommend using the rackup command:

$ rackup

Docker

You can run this in production using Docker as follows:

$ docker pull loopj/initials-avatar
$ docker run -p 80:80 loopj/initials-avatar

Mounting Under a Rails App

If you'd like to run this from inside an existing rails app, you can mount it as follows in config/routes.rb:

match "/initials-avatar" => InitialsAvatar, :anchor => false

You can then access avatars at /initials-avatar/:initials from your rails app.

initials-avatar's People

Contributors

loopj avatar

Watchers

 avatar  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.