Skip to content

Commit afc2264

Browse files
committed
Update documentation files
And add license templates
1 parent cfe6ece commit afc2264

File tree

4 files changed

+89
-5
lines changed

4 files changed

+89
-5
lines changed

ReadMe.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Code Polyglot
22
=============
33

4-
![Code Polyglot Techno Screenshot](image/CodePolyglot_TechnoSkin_Nokia_Screenshot.png)
5-
64
Code snippets sharing service powered by [GraalVM](https://www.graalvm.org/) and [Spring Boot](https://spring.io/).
75

6+
![Code Polyglot Techno Screenshot](image/CodePolyglot_TechnoSkin_Nokia_Screenshot.png)
7+
88
Syntax highlighting is implemented using several libraries and languages:
99

1010
1. [Highlight.js](https://github.com/highlightjs/highlight.js/) and JavaScript.
@@ -13,10 +13,10 @@ Syntax highlighting is implemented using several libraries and languages:
1313

1414
![Code Polyglot Pastorg Screenshot](image/CodePolyglot_PastorgSkin_Screenshot.png)
1515

16-
*Live demo: [code.exlmoto.ru](https://code.exlmoto.ru) with Highlight.js and Rouge syntax higlighters.\
17-
Pygments on [GraalPython](https://github.com/oracle/graalpython) are CPU and RAM intensive.
16+
*Live demo: [code.exlmoto.ru](https://code.exlmoto.ru) with Highlight.js and Rouge syntax higlighters.*\
17+
*Pygments on [GraalPython](https://github.com/oracle/graalpython) are CPU and RAM intensive.*
1818

19-
Note: Service can sometimes be offline.*
19+
*Note: Service can sometimes be offline.*
2020

2121
## API examples
2222

@@ -147,6 +147,7 @@ export PATH=$GRAALVM_HOME/bin:$PATH
147147

148148
cd ~/CodePolyglot/
149149
DB_CONNECTION=jdbc:postgresql://localhost:5432/code DB_USERNAME=user DB_PASSWORD=password ./gradlew clean build
150+
# ./gradlew clean bootJar
150151
sudo mv build/libs/code-polyglot-*.jar /srv/
151152
```
152153

doc/UsefulTips.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Useful Tips
2+
===========
3+
4+
## Find all files without line ending at the end
5+
6+
```shell script
7+
find src/ doc/ util/ -type f -print0 | xargs -0 -L1 bash -c 'test "$(tail -c 1 "$0")" && echo "No new line at end of $0"'
8+
```
9+
10+
This command should be run at the root of the project.
11+
12+
## Find trailing spaces on files
13+
14+
```shell script
15+
grep -r '[[:blank:]]$' src/ doc/ util/
16+
```
17+
This command should be run at the root of the project.
18+
19+
## Find stored a static file in the Nginx cache
20+
21+
```shell script
22+
grep -lr 'login.css' /var/nginx/cache/*
23+
```
24+
25+
This command should be run on the server side with root user privileges.
26+
27+
## Add license header to files by name mask
28+
29+
```shell script
30+
find . -name \*.java -exec sh -c "mv '{}' tmp && cp util/template/license_header_common '{}' && cat tmp >> '{}' && rm tmp" \;
31+
find . -name \*.py -exec sh -c "mv '{}' tmp && cp util/template/license_header_other '{}' && cat tmp >> '{}' && rm tmp" \;
32+
```
33+
34+
* [license_header_common](../util/template/license_header_common) template applies to the C, C++, Java source files.
35+
* [license_header_other](../util/template/license_header_other) template applies to the Python and other source files.
36+
37+
These commands should be run at the root of the project.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2015-2020 EXL <exlmotodev@gmail.com>
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+

util/template/license_header_other

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2015-2020 EXL <exlmotodev@gmail.com>
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+

0 commit comments

Comments
 (0)