Skip to content

Commit b00733e

Browse files
committed
adding maintainers on readme
1 parent 4645af1 commit b00733e

File tree

6 files changed

+94
-48
lines changed

6 files changed

+94
-48
lines changed

.github/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ If you are modifying an algorithm make sure you add a benchmark using [Repl.it](
136136

137137
#### Lastly and not less important:
138138

139-
Make sure you start ⭐️ and follow [@abranhe](https://git.io/abranhe)
139+
Make sure you start ⭐️ and follow [@abranhe](https://github.com/abranhe)

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http
135135
- [Bogo sort](sorting/bogo_sort.cpp)
136136
- [Bubble sort](sorting/bubble_sort.cpp)
137137
- [Counting sort](sorting/counting_sort.cpp)
138+
- [Gnome sort](sorting/gnome_sort.cpp)
138139
- [Heap sort without vectors](sorting/heap_sort_without_vectors.cpp)
139140
- [Heap sort](sorting/heap_sort.cpp)
140141
- [Insertion sort](sorting/insertion_sort.cpp)
@@ -166,6 +167,12 @@ You can find the All ▲lgorithms categories at [algorithms.com/categories](http
166167

167168
<!-- Please do not edit this file | This file is authomatically generated by ~/scripts/formatter.js -->
168169

170+
## Maintainers
171+
172+
|[![1][1-avatar]][1]|[![2][2-avatar]][2]|
173+
| :-: | :-: |
174+
| [Carlos Abraham][1] | [Christian Bender][2] |
175+
169176
## License
170177

171178
This work is released under [MIT License][MIT]
@@ -183,3 +190,9 @@ To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github
183190

184191
[MIT]: https://github.com/abranhe/algorithms/blob/master/license
185192
[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png
193+
194+
<!-- Maintainers -->
195+
[1]: https://github.com/abranhe
196+
[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50
197+
[2]: https://github.com/christianbender
198+
[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50

scripts/format.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
/**
5+
* Usage: node format.js
6+
*
7+
* Author: Carlos Abraham Hernandez
8+
* https://abranhe.com (abraham@abranhe.com)
9+
*/
10+
11+
const path = require('path');
12+
const glob = require('glob');
13+
const chalk = require('chalk');
14+
const decamelize = require('decamelize');
15+
const shell = require('child_process').execSync;
16+
17+
const getFiles = (src, callback) => {
18+
glob(src + '/**', callback);
19+
};
20+
21+
getFiles('../', (err, res) => {
22+
if (err) {
23+
console.log('Error', err);
24+
} else {
25+
res.map((file) => {
26+
// Accept only valid C++ Files (.cpp,.hpp,.h)
27+
if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') {
28+
return;
29+
}
30+
31+
// Only avilable for Linux/Macos
32+
// https://stackoverflow.com/a/41030518/7602110
33+
// Can be replaced in the future
34+
shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`);
35+
36+
if (file.replace(' ', '\\ ') !== decamelize(file)) {
37+
console.log(
38+
`The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}`
39+
);
40+
41+
// Change file on git history
42+
// https://stackoverflow.com/a/16071375/7602110
43+
shell(`cd ../\
44+
git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize(
45+
file.replace(' ', '_').replace('../', '')
46+
)}`);
47+
}
48+
49+
// Replace for convention .h for .hpp
50+
if (path.extname(file) === '.h') {
51+
shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`);
52+
}
53+
});
54+
}
55+
});

scripts/formatter.js renamed to scripts/generate-readme.js

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,22 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
14
/**
2-
* The All Algorithms C++ Formatter
5+
* Usage: node generate-readme.js
36
*
47
* Author: Carlos Abraham Hernandez
58
* https://abranhe.com (abraham@abranhe.com)
69
*/
7-
'use strict';
810

911
const fs = require('fs');
1012
const path = require('path');
1113
const glob = require('glob');
1214
const chalk = require('chalk');
13-
const decamelize = require('decamelize');
14-
const shell = require('child_process').execSync;
1515

1616
const getFiles = (src, callback) => {
1717
glob(src + '/**', callback);
1818
};
1919

20-
getFiles('../', (err, res) => {
21-
if (err) {
22-
console.log('Error', err);
23-
} else {
24-
res.map((file) => {
25-
// Accept only valid C++ Files (.cpp,.hpp,.h)
26-
if (path.extname(file) !== '.cpp' && path.extname(file) !== '.hpp' && path.extname(file) !== '.h') {
27-
return;
28-
}
29-
30-
// Only avilable for Linux/Macos
31-
// https://stackoverflow.com/a/41030518/7602110
32-
// Can be replaced in the future
33-
shell(`mv ${file.replace(' ', '\\ ')} ${decamelize(file.replace(' ', '_'))}`);
34-
35-
if (file.replace(' ', '\\ ') !== decamelize(file)) {
36-
console.log(
37-
`The file ${chalk.red(file)} was successfuly changed to ${chalk.green(decamelize(file.replace(' ', '_')))}`
38-
);
39-
40-
// Change file on git history
41-
// https://stackoverflow.com/a/16071375/7602110
42-
shell(`cd ../\
43-
git mv --force ${file.replace(' ', '\\ ').replace('../', '')} ${decamelize(
44-
file.replace(' ', '_').replace('../', '')
45-
)}`);
46-
}
47-
48-
// Replace for convention .h for .hpp
49-
if (path.extname(file) === '.h') {
50-
shell(`mv ${file} ${file.replace(/\.[^\.]+$/, '.hpp')}`);
51-
}
52-
});
53-
}
54-
});
55-
5620
const categories = [
5721
'artificial-intelligence',
5822
'backtracking',
@@ -149,6 +113,12 @@ getFiles('../', (err, res) => {
149113
readme.push(`
150114
<!-- Please do not edit this file | This file is authomatically generated by ~/scripts/formatter.js -->
151115
116+
## Maintainers
117+
118+
|[![1][1-avatar]][1]|[![2][2-avatar]][2]|
119+
| :-: | :-: |
120+
| [Carlos Abraham][1] | [Christian Bender][2] |
121+
152122
## License
153123
154124
This work is released under [MIT License][MIT]
@@ -166,11 +136,17 @@ To the extent possible under law, [Carlos Abraham](https://go.abranhe.com/github
166136
167137
[MIT]: https://github.com/abranhe/algorithms/blob/master/license
168138
[MIT-logo]: https://cdn.abranhe.com/projects/algorithms/mit-license.png
139+
140+
<!-- Maintainers -->
141+
[1]: https://github.com/abranhe
142+
[1-avatar]: https://avatars3.githubusercontent.com/u/21347264?s=50
143+
[2]: https://github.com/christianbender
144+
[2-avatar]: https://avatars3.githubusercontent.com/u/23243382?s=50
169145
`);
170146

171147
fs.writeFile(`../readme.md`, readme.join('\n'), (err) => {
172148
if (err) throw err;
173149
console.log(chalk.green('The file was succesfully saved!'));
174150
});
175151
}
176-
});
152+
});

scripts/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "scripts",
33
"version": "1.0.0",
4-
"description": "Maintaining clean the All ▲lgorithms Project",
4+
"description": "Keeping clean the All ▲lgorithms Project",
55
"main": "formatter.js",
66
"scripts": {
77
"validate": "node validate.js",
8-
"format": "node formatter.js"
8+
"format": "node format.js",
9+
"readme": "node generate-readme.js"
910
},
1011
"license": "MIT",
1112
"private": true,

scripts/validate.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
14
/**
2-
* validate.js
3-
*
45
* The All ▲lgorithms validator CLI
56
*
7+
* Usage: node validate.js
8+
*
69
* Author: Carlos Abraham Hernandez
710
* https://abranhe.com (abraham@abranhe.com)
811
*/
9-
'use strict';
1012

1113
const glob = require('glob');
1214
const path = require('path');
1315
const decamelize = require('decamelize');
1416
const chalk = require('chalk');
15-
const shell = require('child_process').execSync;
1617

1718
const getFiles = (src, callback) => {
1819
glob(src + '/**', callback);

0 commit comments

Comments
 (0)