Coder Social home page Coder Social logo

tiley's Introduction

Tiley CircleCI

An alternative to the default Gravatar's that is quick and easy to use. Tiley creates consistent colored squares with initials that can be used for default avatars, they look like this:

TM JB LR FL KT KT

How to use

Basic Request

Tiley images may be requested just like a normal image, using an IMG tag. To ensure that tiley always returns the same color for a user you must pass a unique identifier - we recommend a hash of the users email address or a database id. The second parameter is the users initials which must be 1 or 2 letters:

https://tiley.herokuapp.com/avatar/HASH/INITIALS.FORMAT

For example:

https://tiley.herokuapp.com/avatar/205e460b479e2e5b48aec07710c08d50/TM.svg

File formats available are png, svg and jpg. We recommend using svg if possible.

Size

By default, images are presented at 100px by 100px if no size parameter is supplied. You may request a specific image size by using the s= parameter and passing a single pixel dimension (since the images are square):

https://tiley.herokuapp.com/avatar/205e460b479e2e5b48aec07710c08d50/TM.png?s=500

Color

By default, image background colors are dynamically generated using the unique identifier. You may request a specific background color by using the c= parameter and passing a hex value without the "#" symbol: https://tiley.herokuapp.com/avatar/205e460b479e2e5b48aec07710c08d50/JK.png?c=DADB0D

Hosting

We recommend running your own instance of Tiley, however there is an instance running on the Heroku free plan at https://tiley.herokuapp.com that you are welcome to use for low traffic applications. This instance will be shut down soon due to Heroku free plans ending.

The best way to use Tiley is to pass the url as the default parameter when constructing a gravatar url - this means that you can show your users gravatar if it's available and then fallback to a tiley. It would look something like this (don't forget to URL encode):

https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=200&d=https%3A%2F%2Ftiley.herokuapp.com%2Favatar%2F205e460b479e2e5b48aec07710c08d50/TM.svg%3Fs%3D200

Installation

You can run your own copy of tiley easily on Heroku:

Deploy

Development

Tiley depends on imageMagick, on OSX you can install it using Homebrew:

brew install imagemagick

On Heroku it's already installed and on linux you should use your package manager of choice.

yarn install
yarn start

This will begin a process on port 3004 by default, so navigate to "http://localhost:3004" to access the tiley instance.

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.