...

Code Library

 

Project Description

Code Library is a web-based django application, that stores codes written from differnt programming language. Data is maintained in postgres database.

get the full code from github.

git clone https://github.com/bm-zi/code-library.git

Code Library is a web-based django application, that stores codes written from differnt programming language. Data is maintained in postgres database.

Developers can store pieces of code in databse and create their own library. Codes can be accessed from database and be manipulated in many different ways.

The source code is free and is available to download for personal use.

 

The GUI illustration

 

The first step is to create a record in databse for a pice of code from the action menu.

By default, a list of favorite codes is displayed in home page. We can view all codes by choosing "show all code" from action menu.

The code content window will show the content of selected code from code list, while code information window at the most buttom of home page shows the detailed information about selected code.

 

Operations available for code items

The following operations can be done on items selected in code list window:

  • Show all codes
    All codes from all programming languages are displayed in code list window

  • save
    As a code item is selected, the code content can be edited within code content window and then click on save updates the code content in database.

  • favorite/unfavorite change
    We can flag a code as favaorite or remove a code from favorite list by this option.

  • modify code
    We can select a code and modify all code parameters by selecting this option. A new dialog form will be opened and then we can change the code parameters from there.

  • add new code
    By choosing this option, we let a new record be added to database. Each new code will have its own specific parameter.

  • delete code
    A code item with all associated parameters will be removed from the database.

  • download content
    Choosing this option will allow user to open or save the content of any selected code item in a default system editor, like gedit in Linux.

 

 

Parmeters associated with each code

Each code item in database is associated by following parameters, that will be recoded in database when user creates a new code in database through the action menu, with option "add a new code".
Here are the list of parameters:

  • code title

  • programming language

  • created at (will be added automatically by database)

  • is favorite

  • category

 

 

Search options


We can filter the list of codes displayed by following search options:
 
  • search
    Any pattern can be used for this search. This search will show all code items that have the search pattern in code title string, or in content of the code in the database.

  • search by code age
    With this option we can find all codes from "n" days ago. "n" must be an intger. For example: 7, 15, 30 etc.

  • filter codes by programing languages?
    Codes in database are categorized by programming languages. so for example we can find all codes for Java, Perl or any other languages.

  • fliter codes by category
    Code are also categorized in database based on their application or most common used environment, like in finance, networking, OS administration etc.
 

A view of all codes listed

 

A view of all codes in database can be obtained from action menu choosing "show all code", and all windows can be collapsed and extended, to get a better readability.