Coder Social home page Coder Social logo

matuu / kilink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facundobatista/kilink

0.0 2.0 0.0 1.24 MB

A next generation pastebin

License: GNU General Public License v3.0

Python 3.54% CSS 2.32% JavaScript 69.35% HTML 24.13% Erlang 0.15% LiveScript 0.51%

kilink's Introduction

Kilink

Linkode is the useful pastebin!

It's a kind of "short living collaboration space", a "dynamic pastebin".

It's live right now in http://linkode.org/, give it a try!

Some awesome details:

  • you can create linkodes anywhere, whenever, and effortlessly.
  • editable texts, not static!
  • every new edition creates a child: you have a tree
  • code/text type automatic detection (and coloring!)
  • permanent linkodes (the owner can still remove them)
  • absolutely anonymous (unless you login, which is dead simple)
  • private URLs: because you can not guess UUIDs

Collaboration

Code and issues is in GitHub:

https://github.com/facundobatista/kilink

We also have a mailing list:

http://listas.python.org.ar/mailman/listinfo/kilink

And you can also get help by IRC, in Freenode: #linkode

The API

Get the API details from the HTML file::

kilink/templates/_tools.html

In a future this will be in a Doc file (source of that HTML).

How To Try It In Development

virtualenv kilink
cd kilink
git clone https://github.com/facundobatista/kilink.git
source bin/activate
pip install -r requirements.txt
./test
./run

How to Translate

When including translatable text in the code, make sure to always wrap it in the gettext function. Within templates it's already available and bound to _, e.g.:

<span>{{ _("Text to translate") }}</span>

In Python files you need to import it from Flask, e.g.:

from flask.ext.base import gettext as _

def views():
    flash( _("Text to translate") )

Later, to produce language catalogs:

  1. Extract the translation texts:

    cd kilink
    pybabel extract -F babel.cfg -o messages.pot translations
    
  2. Generate an individual language message catalog. E.g. for Italian (it) you would do:

    pybabel init -i messages.pot -d translations -l it

    That should leave a messages.po file nested under the directory specified by the given -d argument (e.g.: translations/it/LC_MESSAGES/messages.po);

  3. Open it in your favorite text editor and translate the collected messages;

  4. Repeat steps 1-3 for each target language;

  5. When finished, compile with:

    pybabel compile -d translations

  6. Finally, add the newly available languages to the config.py file, as follows:

    LANGUAGES = {
         ...
         'it': 'Italian',
         ...
     }
    

You'll need to follow again these steps each time you add or change some text in the code. See the Flask-Babel Tutorial for more on this subject.

How To Deploy With Apache

Documentation based in http://flask.pocoo.org/docs/deploying/mod_wsgi/

We use a virtualenv to deploy the project and apache virtual host on Ubuntu 13.04, This configuration es very general, I guess that works in almost all linux OS

Definitions:

  • Project path: /var/linkode_home/
  • Application path: /var/linkode_home/linkode_app
  • VirtualEnv Path: /var/linkode_home/linkode_virtualenv
  • User: www-data

Create virtualenv:

cd /var/linkode_home
virtualenv linkode_virtualenv
cd linkode_virtualenv
source bin/activate

Clone repository:

cd /var/linkode_home/
git clone https://github.com/facundobatista/kilink.git linkode_app

Install the requirements:

cd linkode_app
pip install -r requirements.txt

The WSGI configuration file is already in the project, ready to use; for develop or debugging you can add to it:

application.debug = True
# Needs install paste via pip "pip install paste"
# For More information:
# http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Browser_Based_Debugger
from paste.evalexception.middleware import EvalException
application = EvalException(application)

Create a virtual host configuration file in /etc/apache2/sites-enabled/ with the name that you want, in this case "linkode"

sudo vi /etc/apache2/sites-enabled/linkode

And paste this:

<VirtualHost *>
    ServerName linkode.mydomain

    WSGIDaemonProcess linkode user=www-data group=www-data threads=5
    WSGIScriptAlias / /var/linkode_home/linkode.wsgi
    WSGIScriptReloading On

    <Directory /var/linkode_home/linkode_app/kilink/>
        WSGIProcessGroup linkode
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>

    AddDefaultCharset utf-8
    ServerSignature On
    LogLevel info

    ErrorLog  /var/log/apache2/linkode-error.log
    CustomLog /var/log/apache2/linkode-access.log combined

</VirtualHost>

Restart Apache and enjoy!

Clients

kilink's People

Contributors

facundobatista avatar abuelodelanada avatar damianavila avatar jcarizza avatar hugoruscitti avatar ezequielchan avatar fisadev avatar dmascialino avatar epochiero avatar chuna avatar rbistolfi avatar juancarlospaco avatar missfilly avatar

Watchers

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