Lot of small changes

This commit is contained in:
2024-01-03 11:04:20 +01:00
parent 71b5d1313a
commit 00c6530485
9 changed files with 166 additions and 83 deletions

View File

@ -0,0 +1,31 @@
snippet base "tonitch's makefile base" b
.PHONY: all clean run
VERSION = 0.0.1
LIBS =
CMACRO = -DVERSION=\"$(VERSION)\"
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO)
LDFLAGS = $(shell pkg-config $(LIBS) --libs)
all: main
main: main.o
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o
rm -f main
bear: clean
bear -- make
run: main
./$<
endsnippet

View File

@ -62,3 +62,38 @@ priority -1
snippet "(\w+)" "latex default" r
\\`!p snip.rv = match.group(1)` $1
endsnippet
snippet task "Create a task list item"
- [ ] ${1:${VISUAL:item}}
endsnippet
snippet rest "add a restAPI endpoint" b
#### ${1:${VISUAL:Title}}
<details>
<summary><code>${2:${VISUAL:GET}}</code> <code><b>/${3:${VISUAL:Endpoint}}</b></code> <code>${4:${VISUAL:Description}}</code></summary>
##### Parameters
> | name | type | data type | description |
> |-----------|-----------|-------------------------|-----------------------------------------------------------------------|
> | None | required | object (JSON or YAML) | N/A |
##### Responses
> | http code | content-type | response |
> |---------------|-----------------------------------|---------------------------------------------------------------------|
> | \`200\` | \`text/plain;charset=UTF-8\` | \`Configuration created successfully\` |
> | \`400\` | \`application/json\` | \`{"code":"400","message":"Bad Request"}\` |
##### Example cURL
> \`\`\`javascript
> curl -X $2 -H "Content-Type: application/json" http://localhost:8889/$3
> \`\`\`
</details>
---------------------------------------------------------------------------------------
endsnippet

View File

@ -0,0 +1,18 @@
snippet base "Base" b
openapi: 3.0.0
info:
title: ${1:${VISUAL:Title}}
description: ${2:${VISUAL:Title}}
version: 0.0.1
servers:
- url: ${3:${VISUAL:https://example.com/api}}
description: ${4:${VISUAL:default api point for the service}}
$0
endsnippet
snippet desc "Description" b
description: ${1:${VISUAL:Description}}
endsnippet