Skip to content

Commit

Permalink
Deploy cmccandless/tools to github.com/cmccandless/tools.git:gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscibot committed Jul 31, 2018
0 parents commit fe0bc0a
Show file tree
Hide file tree
Showing 11 changed files with 400 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .gitignore
@@ -0,0 +1,114 @@

# Created by https://www.gitignore.io/api/python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

### Python Patch ###
.venv/


# End of https://www.gitignore.io/api/python
21 changes: 21 additions & 0 deletions .travis.yml
@@ -0,0 +1,21 @@
sudo: false
language: python
python:
- "3.6"

install:
- make init

before_script:
- make lint
- make test

script:
- make generate

deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,14 @@
# Contributing Guide
1. Add your tool to `tools.json`, including the following fields (if the appropriate category does not exist, add it):


```json
{
"Title": "Tool name",
"Description": "Short description of the tool"
"Free": true, //`true` if there is a permanent, free version available, else `false`
"Link": "https://example.com" //Tool website URL
}
```

2. Create a Pull Request for your changes.
14 changes: 14 additions & 0 deletions Makefile
@@ -0,0 +1,14 @@
all: init lint test generate

init:
python -m pip install -r requirements.txt

lint:
python -m pip check
python -m flake8 *.py

test:
python -m pytest -v generate.py

generate:
python generate.py
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@
[![Build Status](https://travis-ci.com/cmccandless/tools.svg?branch=master)](https://travis-ci.com/cmccandless/tools)

# Tools

A collection of useful development tools
1 change: 1 addition & 0 deletions _config.yml
@@ -0,0 +1 @@
theme: jekyll-theme-slate
76 changes: 76 additions & 0 deletions generate.py
@@ -0,0 +1,76 @@
#!/usr/bin/env python
import markdown_generator as mdg
import json

from jsonschema import validate
import unittest
import httplib2
from http import HTTPStatus


with open('tools.json') as f:
data = json.load(f)


class ToolsTest(unittest.TestCase):
def test_validate_against_schema(self):
with open('tools.schema') as f:
schema = json.load(f)
validate(data, schema)

def test_validate_links(self):
h = httplib2.Http()
for tool in (t for ts in data.values() for t in ts):
url = tool['Link']
resp = h.request(url, 'HEAD')
status = HTTPStatus(int(resp[0]['status']))
status_msg = f'{status} {status.name}: {url}'
self.assertLess(
status,
300,
status_msg
)


def get_tool_table_entry(tool):
def format_data(k, v):
if k == 'Free':
return 'Yes' if v else 'No'
if k == 'Link':
return mdg.link(v, 'Go')
return v

return [
format_data(k, tool[k])
for k in ['Title', 'Description', 'Free', 'Link']
]


if __name__ == '__main__':
data = sorted(data.items())

with open('index.md', 'w') as f:
writer = mdg.Writer(f)
writer.writeline('# Tools')
writer.writeline()

writer.writeline('## Table of Contents')
for category, _ in data:
url = category.lower()
url = url.replace(' ', '-')
url = url.replace('.', '')
url = '#' + url
writer.writeline('- ' + mdg.link(url, category))

for category, tools in data:
writer.writeline()
writer.writeline('## ' + category)
writer.writeline()
table = mdg.Table()
table.add_column('Title')
table.add_column('Description')
table.add_column('Free', mdg.Alignment.CENTER)
table.add_column('Link')
for tool in sorted(tools, key=lambda t: t['Title']):
table.append(*get_tool_table_entry(tool))
writer.write(table)
60 changes: 60 additions & 0 deletions index.md
@@ -0,0 +1,60 @@
# Tools

## Table of Contents
- [.NET](#net)
- [Cloud Hosting](#cloud-hosting)
- [Code Review](#code-review)
- [IDE](#ide)
- [Monitoring](#monitoring)
- [Network Analysis](#network-analysis)
- [Web Development](#web-development)

## .NET

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| LINQPad | The Ultimate Scratchpad for C#, F# and VB | Yes | [Go](https://www.linqpad.net/) |


## Cloud Hosting

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| Heroku | Cloud hosting with simple GitHub integration | Yes | [Go](https://www.heroku.com/home) |


## Code Review

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| Gerrit | Web based code review and repository management for Git | Yes | [Go](https://www.gerritcodereview.com/) |


## IDE

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| Visual Studio Code | Free. Open source. Runs everywhere. | Yes | [Go](https://code.visualstudio.com/) |


## Monitoring

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| Visual Ping | Sends notifications when a web page has changed | Yes | [Go](https://visualping.io/) |


## Network Analysis

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| Nmap | Free and open source utility for network discovery and security auditing. | Yes | [Go](https://nmap.org/) |
| Wireshark | Packet capture and protocol analysis | Yes | [Go](https://www.wireshark.org/) |


## Web Development

| Title | Description | Free | Link |
|:--- |:--- |:---:|:--- |
| ngrok | One command for an instant, secure URL to your localhost server through any NAT or firewall. | Yes | [Go](https://ngrok.com/) |

5 changes: 5 additions & 0 deletions requirements.txt
@@ -0,0 +1,5 @@
flake8==3.5.0
httplib2==0.11.3
jsonschema==2.6.0
markdown-generator==0.1.3
pytest==3.7.0
64 changes: 64 additions & 0 deletions tools.json
@@ -0,0 +1,64 @@
{
"Web Development": [
{
"Title": "ngrok",
"Description": "One command for an instant, secure URL to your localhost server through any NAT or firewall.",
"Link": "https://ngrok.com/",
"Free": true
}
],
"IDE": [
{
"Title": "Visual Studio Code",
"Description": "Free. Open source. Runs everywhere.",
"Link": "https://code.visualstudio.com/",
"Free": true
}
],
"Cloud Hosting": [
{
"Title": "Heroku",
"Description": "Cloud hosting with simple GitHub integration",
"Link": "https://www.heroku.com/home",
"Free": true
}
],
".NET": [
{
"Title": "LINQPad",
"Description": "The Ultimate Scratchpad for C#, F# and VB",
"Link": "https://www.linqpad.net/",
"Free": true
}
],
"Code Review": [
{
"Title": "Gerrit",
"Description": "Web based code review and repository management for Git",
"Link": "https://www.gerritcodereview.com/",
"Free": true
}
],
"Network Analysis": [
{
"Title": "Wireshark",
"Description": "Packet capture and protocol analysis",
"Link": "https://www.wireshark.org/",
"Free": true
},
{
"Title": "Nmap",
"Description": "Free and open source utility for network discovery and security auditing.",
"Link": "https://nmap.org/",
"Free": true
}
],
"Monitoring": [
{
"Title": "Visual Ping",
"Description": "Sends notifications when a web page has changed",
"Link": "https://visualping.io/",
"Free": true
}
]
}

0 comments on commit fe0bc0a

Please sign in to comment.