Skip to content

Commit

Permalink
fix: add nginx utils
Browse files Browse the repository at this point in the history
  • Loading branch information
liblaf committed May 4, 2023
1 parent 141d7c0 commit df05e43
Show file tree
Hide file tree
Showing 56 changed files with 1,164 additions and 863 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
layout conda

source_env_if_exists .envrc.private
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Dependencies
run: poetry install --no-interaction
- name: Build Executable
run: poetry run make rename
run: poetry run make dist
env:
RUNNER_OS: ${{ runner.os }}
RUNNER_ARCH: ${{ runner.arch }}
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
-----Initial gitignore.io list----
-----Save to /home/liblaf/.gi_list-----

# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

Expand Down Expand Up @@ -177,3 +174,5 @@ poetry.toml
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python

.envrc.private
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ ci:

repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: "v2.42.1"
rev: "3.1.0"
hooks:
- id: commitizen
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
rev: "v3.0.0-alpha.9-for-vscode"
hooks:
- id: prettier
stages:
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cSpell.words": ["typer"],
"files.associations": {
".envrc": "shellscript",
".envrc.private": "shellscript"
}
}
100 changes: 46 additions & 54 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,81 +1,73 @@
NAME := utils.py
NAME := utils

BIN := $(HOME)/.local/bin
BUILD := $(CURDIR)/build
DATA := $(CURDIR)/data
DIST := $(CURDIR)/dist
DOCS := $(CURDIR)/docs
SITE := $(CURDIR)/site
DATA := $(CURDIR)/data
DIST := $(CURDIR)/dist
DOCS := $(CURDIR)/docs

DOCS_SRC_LIST += $(DOCS)/awesome-github.md
DOCS_SRC_LIST += $(DOCS)/awesome-websites.md
DOCS_SRC_LIST += $(DOCS)/index.md

OS != echo $(RUNNER_OS) | tr '[:upper:]' '[:lower:]'
ARCH != echo $(RUNNER_ARCH) | tr '[:upper:]' '[:lower:]'

ifneq ($(and $(OS), $(ARCH)), )
NAME := $(NAME)-$(OS)-$(ARCH)
endif

OS := $(shell echo $(RUNNER_OS) | tr '[:upper:]' '[:lower:]')
ARCH := $(shell echo $(RUNNER_ARCH) | tr '[:upper:]' '[:lower:]')
ifeq ($(OS), windows)
EXE := .exe
else
EXE :=
endif
TARGET := $(DIST)/$(NAME)$(EXE)

GITHUB_TOKEN :=
EXECUTABLE := $(DIST)/$(NAME)$(EXE)

build: $(TARGET)
all:

clean:
$(RM) --recursive $(BUILD)
$(RM) --recursive $(DIST)
$(RM) --recursive $(SITE)
$(RM) $(CURDIR)/*.spec
dist: $(EXECUTABLE)

docs: $(DOCS)/awesome-github.md $(DOCS)/awesome-websites.md $(DOCS)/index.md
docs: $(DOCS_SRC_LIST)

docs-build: $(CURDIR)/mkdocs.yaml docs
mkdocs build --config-file $< --site-dir $(SITE)
docs-build: $(DOCS_SRC_LIST)
mkdocs build

docs-gh-deploy: $(CURDIR)/mkdocs.yaml docs
mkdocs gh-deploy --force --no-history --config-file $< --site-dir $(SITE)
docs-serve: $(DOCS_SRC_LIST)
mkdocs serve

docs-serve: $(CURDIR)/mkdocs.yaml docs
mkdocs serve --config-file $<
docs-gh-deploy: $(DOCS_SRC_LIST)
mkdocs gh-deploy

install: $(TARGET) | $(BIN)
install --target-directory=$(BIN) $<
poetry: $(CURDIR)/poetry.lock $(CURDIR)/requirements.txt

pretty:
isort --profile black $(CURDIR)
black $(CURDIR)
pretty: prettier pretty-python

poetry run utils.py sort yaml $(DATA)/github.yaml
poetry run utils.py sort yaml $(DATA)/websites.yaml
prettier --write $(CURDIR)/**/*.md
prettier --write $(CURDIR)/**/*.yaml
prettier: | $(CURDIR)/.gitignore
prettier --write --ignore-path $| $(CURDIR)

rename: $(TARGET)
ifneq ($(and $(OS), $(ARCH)), )
mv $< $(DIST)/$(NAME)-$(OS)-$(ARCH)$(EXE)
endif
pretty-python:
isort --profile black $(CURDIR)
black $(CURDIR)

$(BIN):
mkdir --parents $@
$(CURDIR)/poetry.lock: pyproject.toml
poetry lock

$(DOCS):
mkdir --parents $@
$(CURDIR)/requirements.txt: $(CURDIR)/poetry.lock
poetry export --output requirements.txt --without-hashes --without-urls

ifeq ($(GITHUB_TOKEN),)
SORT_GITHUB_OPTIONS :=
else
SORT_GITHUB_OPTIONS := --token $(GITHUB_TOKEN)
endif
$(DOCS)/awesome-github.md: $(DATA)/github.yaml | $(DOCS)
poetry run utils.py sort github $(SORT_GITHUB_OPTIONS) $< > $@
$(DOCS)/awesome-github.md: $(DATA)/github.yaml
poetry run utils sort github --in-place --markdown $@ $<
prettier --write $<
prettier --write $@

$(DOCS)/awesome-websites.md: $(DATA)/websites.yaml | $(DOCS)
poetry run utils.py sort url $< > $@
$(DOCS)/awesome-websites.md: $(DATA)/websites.yaml
poetry run utils sort website --in-place --markdown $@ $<
prettier --write $<
prettier --write $@

$(DOCS)/index.md: $(CURDIR)/main.py | $(DOCS)
typer $< utils docs --name $(NAME) --output $@
$(DOCS)/index.md:
typer utils.cmd utils docs --output $@
prettier --write $@

$(TARGET):
pyinstaller --distpath $(DIST) --workpath $(BUILD) --onefile --name $(NAME) $(CURDIR)/main.py
$(EXECUTABLE): $(CURDIR)/main.py
pyinstaller --onefile --name $(NAME) $<
146 changes: 73 additions & 73 deletions data/github.yaml
Original file line number Diff line number Diff line change
@@ -1,127 +1,127 @@
Awesome:
- Kazhnuz/awesome-gnome
- agarrharr/awesome-cli-apps
- avelino/awesome-go
- sindresorhus/awesome
- vinta/awesome-python
- awesome-selfhosted/awesome-selfhosted
- avelino/awesome-go
- sindresorhus/awesome-nodejs
- fffaraz/awesome-cpp
- ibraheemdev/modern-unix
- sindresorhus/awesome
- sindresorhus/awesome-nodejs
- vinta/awesome-python
- agarrharr/awesome-cli-apps
- Kazhnuz/awesome-gnome
C/C++:
- microsoft/vcpkg
CLI:
- BurntSushi/ripgrep
- ClementTsang/bottom
- ImageMagick/ImageMagick
- ajeetdsouza/zoxide
- bitwarden/clients
- boyter/scc
- charmbracelet/glow
- charmbracelet/gum
- charmbracelet/vhs
- cli/cli
- commitizen/cz-cli
- dandavison/delta
- dundee/gdu
- dylanaraps/neofetch
- gokcehan/lf
- httpie/httpie
- jesseduffield/lazygit
- junegunn/fzf
- lsd-rs/lsd
- mermaid-js/mermaid-cli
- muesli/duf
- neovim/neovim
- ogham/dog
- orf/gping
- pappasam/toml-sort
- pre-commit/pre-commit
- junegunn/fzf
- prettier/prettier
- rclone/rclone
- tldr-pages/tldr
- sharkdp/bat
- rclone/rclone
- BurntSushi/ripgrep
- jesseduffield/lazygit
- cli/cli
- tmux/tmux
- httpie/httpie
- sharkdp/fd
- sharkdp/hyperfine
- stedolan/jq
- dylanaraps/neofetch
- dandavison/delta
- tj/git-extras
- tldr-pages/tldr
- tmux/tmux
- sharkdp/hyperfine
- commitizen/cz-cli
- charmbracelet/gum
- charmbracelet/glow
- muesli/duf
- charmbracelet/vhs
- ajeetdsouza/zoxide
- pre-commit/pre-commit
- lsd-rs/lsd
- ImageMagick/ImageMagick
- vercel/serve
- orf/gping
- ClementTsang/bottom
- bitwarden/clients
- gokcehan/lf
- ogham/dog
- boyter/scc
- dundee/gdu
- mermaid-js/mermaid-cli
- pappasam/toml-sort
Desktop:
- Fndroid/clash_for_windows_pkg
- TheAssassin/AppImageLauncher
- YerongAI/Office-Tool
- agalwood/Motrix
- kovidgoyal/kitty
- libpinyin/ibus-libpinyin
- microsoft/PowerToys
- microsoft/vscode
- notofonts/noto-cjk
- pbatard/rufus
- ryanoasis/nerd-fonts
- microsoft/PowerToys
- tonsky/FiraCode
- Fndroid/clash_for_windows_pkg
- ventoy/Ventoy
- ryanoasis/nerd-fonts
- agalwood/Motrix
- pbatard/rufus
- kovidgoyal/kitty
- videolan/vlc
- zotero/zotero
- YerongAI/Office-Tool
- TheAssassin/AppImageLauncher
- notofonts/noto-cjk
- libpinyin/ibus-libpinyin
GNOME:
- micheleg/dash-to-dock
- paperwm/PaperWM
- paradoxxxzero/gnome-shell-system-monitor-applet
- ubuntu/gnome-shell-extension-appindicator
Go:
- dsnet/try
- spf13/cobra
- sirupsen/logrus
- stretchr/testify
- emirpasic/gods
- mvdan/sh
- mholt/archiver
- go-survey/survey
- pterm/pterm
- gosimple/slug
- mholt/archiver
- mvdan/sh
- otiai10/copy
- pterm/pterm
- sirupsen/logrus
- spf13/cobra
- stretchr/testify
- dsnet/try
Node.js:
- ant-design/ant-design
- facebook/react
- vuejs/vue
- vercel/next.js
- vercel/serve
- ant-design/ant-design
- vercel/vercel
- vuejs/vue
- vuepress-theme-hope/vuepress-theme-hope
- vercel/serve
- vuepress/vuepress-next
- vuepress-theme-hope/vuepress-theme-hope
Python:
- PyCQA/isort
- psf/requests
- Textualize/rich
- conda/conda
- pandas-dev/pandas
- psf/black
- httpie/httpie
- python-poetry/poetry
- numpy/numpy
- taichi-dev/taichi
- matplotlib/matplotlib
- scipy/scipy
- tiangolo/typer
- mwaskom/seaborn
- numpy/numpy
- pandas-dev/pandas
- pappasam/toml-sort
- pre-commit/pre-commit
- psf/black
- psf/requests
- pyinstaller/pyinstaller
- pypa/pipx
- python-poetry/poetry
- PyCQA/isort
- conda/conda
- pyvista/pyvista
- pyvista/tetgen
- scipy/scipy
- taichi-dev/taichi
- tiangolo/typer
- tmbo/questionary
- pyvista/tetgen
- pappasam/toml-sort
Self-Hosted:
- squidfunk/mkdocs-material
- upptime/upptime
- bastienwirtz/homer
- qkqpttgf/OneManager-php
- spencerwooo/onedrive-vercel-index
- squidfunk/mkdocs-material
- upptime/upptime
- vuepress-theme-hope/vuepress-theme-hope
Zsh:
- Game4Move78/zsh-bitwarden
- conda-incubator/conda-zsh-completion
- marlonrichert/zsh-autocomplete
- ohmyzsh/ohmyzsh
- starship/starship
- zsh-users/zsh-syntax-highlighting
- marlonrichert/zsh-autocomplete
- conda-incubator/conda-zsh-completion
- Game4Move78/zsh-bitwarden
Loading

0 comments on commit df05e43

Please sign in to comment.