Skip to content

Commit

Permalink
added snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
xkeshav committed Oct 15, 2024
1 parent bbd480a commit 4041869
Show file tree
Hide file tree
Showing 10 changed files with 491 additions and 243 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# These are supported funding model platforms

github: xkeshav
patreon: xkeshav
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# Pull Request Template

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have checked my code and corrected any misspellings

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
**Relates #[issue number] OR Closes #[issue number]**
Include here a short description of what behavior this Pull Request introduces.
Outline any new dependencies introduced. Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context

### Files changed

Fixes # (issue)
Include one to two lines on the necessary changes to each file.

## Type of change

Expand All @@ -27,15 +44,3 @@ Please describe the tests that you ran to verify your changes. Provide instructi
- Browser:
- Device:
- Toolchain:

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have checked my code and corrected any misspellings
24 changes: 24 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: markdown-lint
run-name: learning github action from workflow
env:
DOCS_CHANGED: false
on:
push:
branches:
Expand All @@ -17,5 +19,27 @@ jobs:
with:
node-version: "20"

- name: Check changed files
run: |
echo "### File Check! :rocket:" >> $GITHUB_STEP_SUMMARY
# Check if there is a previous commit
if git rev-parse HEAD^ >/dev/null 2>&1; then
# Get a list of changed files between the last commit and the previous commit
changed_files=$(git diff --name-only HEAD^ HEAD)
else
# In case of no previous commit, use the initial commit
changed_files=$(git diff --name-only HEAD)
fi
# Check if any of the changed files have a .md extension
echo "Changed files: $changed_files"
if echo "$changed_files" | grep -q '\.md$'; then
echo "DOCS_CHANGED=true" >> $GITHUB_ENV
else
echo "DOCS_CHANGED=false" >> $GITHUB_ENV
fi
echo "${{env.DOCS_CHANGED }} or $DOCS_CHANGED"
- name: Lint Markdown files
if: ${{env.DOCS_CHANGED == true}}
uses: ./.github/actions/md-lint
17 changes: 17 additions & 0 deletions .vscode/info.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"xk": {
"scope": "markdown, json",
"prefix": "xk",
"body": ["${1|xkeshav,xkeshav@gmail.com,Keshav Mohta|}"],
"description": "say my email",
},
"current date": {
"scope": "astro, javascript, typescript",
"prefix": "now",
"body": [
"Date: $CURRENT_DATE $CURRENT_MONTH_NAME_SHORT $CURRENT_YEAR $CURRENT_HOUR:$CURRENT_MINUTE $CURRENT_TIMEZONE_OFFSET",
"$0",
],
"description": "print current date and time in dd mmm yyyy hh:mm +0:00 format",
},
}
14 changes: 6 additions & 8 deletions .vscode/template.code-snippets → .vscode/log.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
"console-obj": {
"scope": "javascript, javascriptreact, typescript, typescriptreact",
"prefix": "cl",
"body": [
"console.log({ $0 });"
],
"description": "destructured console log"
"body": ["console.log({ $0 });"],
"description": "destructured console log",
},
"log-clip": {
"scope": "javascript, javascriptreact, typescript, typescriptreact",
"prefix": "log-clip",
"body": ["//${3: ${CLIPBOARD/(.*)\\./$2/g}}", "console.log({$CLIPBOARD})"],
"description": "clip to console"
"description": "clip to console",
},
"createDocumentFragment": {
"scope": "javascript, javascriptreact, typescript, typescriptreact",
"prefix": "cdf",
"body": "const ${1:varName} = document.createDocumentFragment();${0}",
"description": "Creates an element using document.createDoumentFragment"
}
}
"description": "Creates an element using document.createDoumentFragment",
},
}
64 changes: 64 additions & 0 deletions .vscode/pkg.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"create package json": {
"scope": "javascript,typescript,json",
"prefix": "cpj",
"description": "Creates Basic entry for a package.json",
"body": [
"{",
"\t\"name\": \"@${1:username}/${2:project}\",",
"\t\"version\": \"0.0.1\",",
"\t\"main\": \"src/index.js\",",
"\t\"author\": {",
"\t\t\"name\": \"$1\",",
"\t\t\"email\": \"$3\"",
"\t},",
"\t\"license\": \"MIT\",",
"\t\"description\": \"This is a $2 codebase repository.\",",
"\t\"scripts\": {",
"\t\t\"start\": \"tsc\"",
"\t},",
"\n\t\"📣\": \"^^ above fields might be duplicate so verify before save\",\n",
"\t\"private\": false,",
"\t\"displayName\": \"$2\",",
"\t\"publisher\": \"$1\",",
"\t\"homepage\": \"https://github.com/$1/$2/blob/main/README.md\",",
"\t\"bugs\": {",
"\t\t\"url\": \"https://github.com/$1/$2/issues\",",
"\t\t\"email\": \"$1\"",
"\t},",
"\t\"repository\": {",
"\t\t\"type\": \"git\",",
"\t\t\"url\": \"https://github.com/$1/$2.git\"",
"\t},",
"\t\"keywords\": [",
"\t\t\"project\",",
"\t\t\"github\",",
"\t\t\"template\"",
"\t],",
"\t\"contributors\": [{",
"\t\t\"name\": \"$1\",",
"\t\t\"email\": \"$3\"",
"\t}],",
"\t\"dependencies\": {},",
"\t\"timestamp\": {",
"\t\t\"createdOn\": \"$CURRENT_DAY_NAME_SHORT,$CURRENT_DATE $CURRENT_MONTH_NAME_SHORT $CURRENT_YEAR $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_TIMEZONE_OFFSET\"",
"\t},",
"\t\"devDependencies\":{",
"\t},",
"\t\"peerDependencies\": {},",
"\t\"browserslist\": {",
"\t\t\"production\": [",
"\t\t\t\">0.2%\",",
"\t\t\t\"not dead\",",
"\t\t\t\"not op_mini all\"",
"\t\t],",
"\t\t\"development\": [",
"\t\t\t\"last 1 chrome version\",",
"\t\t\t\"last 1 firefox version\",",
"\t\t\t\"last 1 safari version\"",
"\t\t]",
"\t}",
"}"
]
}
}
64 changes: 0 additions & 64 deletions .vscode/pkg.json

This file was deleted.

Loading

0 comments on commit 4041869

Please sign in to comment.