mirror of
https://github.com/sharevb/it-tools.git
synced 2026-12-03 10:00:17 +03:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb343eacf7 | ||
|
|
cb5b462e11 | ||
|
|
9eac9cb2a9 | ||
|
|
23f82d956a |
No files matched your search
@@ -15,7 +15,7 @@ jobs:
|
|||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get Playwright version
|
- name: Get Playwright version
|
||||||
|
|||||||
Vendored
+3
-9
@@ -126,25 +126,18 @@ declare module '@vue/runtime-core' {
|
|||||||
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
|
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
|
||||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
||||||
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||||
|
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
|
||||||
|
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
|
||||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||||
NCode: typeof import('naive-ui')['NCode']
|
|
||||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||||
NDivider: typeof import('naive-ui')['NDivider']
|
|
||||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
|
||||||
NGi: typeof import('naive-ui')['NGi']
|
|
||||||
NGrid: typeof import('naive-ui')['NGrid']
|
|
||||||
NH1: typeof import('naive-ui')['NH1']
|
NH1: typeof import('naive-ui')['NH1']
|
||||||
NH3: typeof import('naive-ui')['NH3']
|
NH3: typeof import('naive-ui')['NH3']
|
||||||
NIcon: typeof import('naive-ui')['NIcon']
|
NIcon: typeof import('naive-ui')['NIcon']
|
||||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
|
||||||
NLabel: typeof import('naive-ui')['NLabel']
|
|
||||||
NLayout: typeof import('naive-ui')['NLayout']
|
NLayout: typeof import('naive-ui')['NLayout']
|
||||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||||
NMenu: typeof import('naive-ui')['NMenu']
|
NMenu: typeof import('naive-ui')['NMenu']
|
||||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
|
||||||
NSpin: typeof import('naive-ui')['NSpin']
|
|
||||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||||
@@ -159,6 +152,7 @@ declare module '@vue/runtime-core' {
|
|||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
|
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
|
||||||
|
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
|
||||||
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
|
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
|
||||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
|
|||||||
*/
|
*/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: './src',
|
testDir: './src',
|
||||||
testMatch: /.*\.e2e\.(spec\.)?ts/,
|
testMatch: /\.e2e\.(spec\.)?ts$/,
|
||||||
/* Run tests in files in parallel */
|
/* Run tests in files in parallel */
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||||
@@ -57,7 +57,7 @@ export default defineConfig({
|
|||||||
&& {
|
&& {
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run preview',
|
command: 'npm run preview',
|
||||||
url: 'http://127.0.0.1:5050',
|
url: 'http://localhost:5050',
|
||||||
reuseExistingServer: !isCI,
|
reuseExistingServer: !isCI,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
|
|||||||
mb-2
|
mb-2
|
||||||
/>
|
/>
|
||||||
<n-form-item label="Salt count: " label-placement="left" label-width="120">
|
<n-form-item label="Salt count: " label-placement="left" label-width="120">
|
||||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="10" :min="0" w-full />
|
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<c-input-text :value="hashed" readonly text-center />
|
<c-input-text :value="hashed" readonly text-center />
|
||||||
|
|||||||
+8
-1
@@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
|||||||
|
|
||||||
import { tool as textToUnicode } from './text-to-unicode';
|
import { tool as textToUnicode } from './text-to-unicode';
|
||||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||||
|
import { tool as nanoMemo } from './nano-memo';
|
||||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||||
@@ -137,7 +138,6 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
{
|
{
|
||||||
name: 'Development',
|
name: 'Development',
|
||||||
components: [
|
components: [
|
||||||
gitMemo,
|
|
||||||
randomPortGenerator,
|
randomPortGenerator,
|
||||||
crontabGenerator,
|
crontabGenerator,
|
||||||
jsonViewer,
|
jsonViewer,
|
||||||
@@ -150,6 +150,13 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
yamlViewer,
|
yamlViewer,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'CheatSheets',
|
||||||
|
components: [
|
||||||
|
gitMemo,
|
||||||
|
nanoMemo,
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Network',
|
name: 'Network',
|
||||||
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ describe('integer-base-converter', () => {
|
|||||||
expect(convertBase({ value: '10100101', fromBase: 2, toBase: 16 })).toEqual('a5');
|
expect(convertBase({ value: '10100101', fromBase: 2, toBase: 16 })).toEqual('a5');
|
||||||
expect(convertBase({ value: '192654', fromBase: 10, toBase: 8 })).toEqual('570216');
|
expect(convertBase({ value: '192654', fromBase: 10, toBase: 8 })).toEqual('570216');
|
||||||
expect(convertBase({ value: 'zz', fromBase: 64, toBase: 10 })).toEqual('2275');
|
expect(convertBase({ value: 'zz', fromBase: 64, toBase: 10 })).toEqual('2275');
|
||||||
|
expect(convertBase({ value: '42540766411283223938465490632011909384', fromBase: 10, toBase: 10 })).toEqual('42540766411283223938465490632011909384');
|
||||||
|
expect(convertBase({ value: '42540766411283223938465490632011909384', fromBase: 10, toBase: 16 })).toEqual('20010db8000085a300000000ac1f8908');
|
||||||
|
expect(convertBase({ value: '20010db8000085a300000000ac1f8908', fromBase: 16, toBase: 10 })).toEqual('42540766411283223938465490632011909384');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,16 +5,16 @@ export function convertBase({ value, fromBase, toBase }: { value: string; fromBa
|
|||||||
let decValue = value
|
let decValue = value
|
||||||
.split('')
|
.split('')
|
||||||
.reverse()
|
.reverse()
|
||||||
.reduce((carry: number, digit: string, index: number) => {
|
.reduce((carry: bigint, digit: string, index: number) => {
|
||||||
if (!fromRange.includes(digit)) {
|
if (!fromRange.includes(digit)) {
|
||||||
throw new Error(`Invalid digit "${digit}" for base ${fromBase}.`);
|
throw new Error(`Invalid digit "${digit}" for base ${fromBase}.`);
|
||||||
}
|
}
|
||||||
return (carry += fromRange.indexOf(digit) * fromBase ** index);
|
return (carry += BigInt(fromRange.indexOf(digit)) * BigInt(fromBase) ** BigInt(index));
|
||||||
}, 0);
|
}, 0n);
|
||||||
let newValue = '';
|
let newValue = '';
|
||||||
while (decValue > 0) {
|
while (decValue > 0) {
|
||||||
newValue = toRange[decValue % toBase] + newValue;
|
newValue = toRange[Number(decValue % BigInt(toBase))] + newValue;
|
||||||
decValue = (decValue - (decValue % toBase)) / toBase;
|
decValue = (decValue - (decValue % BigInt(toBase))) / BigInt(toBase);
|
||||||
}
|
}
|
||||||
return newValue || '0';
|
return newValue || '0';
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { FileText } from '@vicons/tabler';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'Nano CheatSheet',
|
||||||
|
path: '/nano-memo',
|
||||||
|
description: 'Nano Editor Cheatsheet',
|
||||||
|
keywords: ['nano', 'memo', 'cheatsheet', 'sheet'],
|
||||||
|
component: () => import('./nano-memo.vue'),
|
||||||
|
icon: FileText,
|
||||||
|
createdAt: new Date('2024-04-20'),
|
||||||
|
});
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
Overview of nano's shortcuts
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
# The editor's keystrokes and their functions
|
||||||
|
|
||||||
|
## File handling**
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+S | Save current file |
|
||||||
|
| Ctrl+O | Offer to write file ("Save as") |
|
||||||
|
| Ctrl+R | Insert a file into current one |
|
||||||
|
| Ctrl+X | Close buffer, exit from nano |
|
||||||
|
|
||||||
|
## **Editing**
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+K | Cut current line into cutbuffer |
|
||||||
|
| Alt+6 | Copy current line into cutbuffer |
|
||||||
|
| Ctrl+U | Paste contents of cutbuffer |
|
||||||
|
| Alt+T | Cut until end of buffer |
|
||||||
|
| Ctrl+\] | Complete current word |
|
||||||
|
| Alt+3 | Comment/uncomment line/region |
|
||||||
|
| Alt+U | Undo last action |
|
||||||
|
| Alt+E | Redo last undone action |
|
||||||
|
|
||||||
|
## **Search and replace**
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+Q | Start backward search |
|
||||||
|
| Ctrl+W | Start forward search |
|
||||||
|
| Alt+Q | Find next occurrence backward |
|
||||||
|
| Alt+W | Find next occurrence forward |
|
||||||
|
| Alt+R | Start a replacing session |
|
||||||
|
|
||||||
|
## Deletion
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+H | Delete character before cursor |
|
||||||
|
| Ctrl+D | Delete character under cursor |
|
||||||
|
| Alt+Bsp | Delete word to the left |
|
||||||
|
| Ctrl+Del | Delete word to the right |
|
||||||
|
| Alt+Del | Delete current line |
|
||||||
|
|
||||||
|
## Operations
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+T | Execute some command |
|
||||||
|
| Ctrl+J | Justify paragraph or region |
|
||||||
|
| Alt+J | Justify entire buffer |
|
||||||
|
| Alt+B | Run a syntax check |
|
||||||
|
| Alt+F | Run a formatter/fixer/arranger |
|
||||||
|
| Alt+: | Start/stop recording of macro |
|
||||||
|
| Alt+; | Replay macro |
|
||||||
|
|
||||||
|
## Moving around
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+B | One character backward |
|
||||||
|
| Ctrl+F | One character forward |
|
||||||
|
| Ctrl+**←** | One word backward |
|
||||||
|
| Ctrl+**→** | One word forward |
|
||||||
|
| Ctrl+A | To start of line |
|
||||||
|
| Ctrl+E | To end of line |
|
||||||
|
| Ctrl+P | One line up |
|
||||||
|
| Ctrl+N | One line down |
|
||||||
|
| Ctrl+**↑** | To previous block |
|
||||||
|
| Ctrl+**↓** | To next block |
|
||||||
|
| Ctrl+Y | One page up |
|
||||||
|
| Ctrl+V | One page down |
|
||||||
|
| Alt+\\ | To top of buffer |
|
||||||
|
| Alt+/ | To end of buffer |
|
||||||
|
|
||||||
|
## Special movement
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Alt+G | Go to specified line |
|
||||||
|
| Alt+\] | Go to complementary bracket |
|
||||||
|
| Alt+**↑** | Scroll viewport up |
|
||||||
|
| Alt+**↓** | Scroll viewport down |
|
||||||
|
| Alt+< | Switch to preceding buffer |
|
||||||
|
| Alt+> | Switch to succeeding buffer |
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Ctrl+C | Report cursor position |
|
||||||
|
| Alt+D | Report line/word/character count |
|
||||||
|
| Ctrl+G | Display help text |
|
||||||
|
|
||||||
|
## Various
|
||||||
|
|
||||||
|
| Shortcut | Description |
|
||||||
|
|:--|:--|
|
||||||
|
| Alt+A | Turn the mark on/off |
|
||||||
|
| Tab | Indent marked region |
|
||||||
|
| Shift+Tab | Unindent marked region |
|
||||||
|
| Alt+V | Enter next keystroke verbatim |
|
||||||
|
| Alt+N | Turn line numbers on/off |
|
||||||
|
| Alt+P | Turn visible whitespace on/off |
|
||||||
|
| Alt+X | Hide or unhide the help lines |
|
||||||
|
| Ctrl+L | Refresh the screen |
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useThemeVars } from 'naive-ui';
|
||||||
|
import Memo from './nano-memo.content.md';
|
||||||
|
|
||||||
|
const themeVars = useThemeVars();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<Memo />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
::v-deep(pre) {
|
||||||
|
margin: 0;
|
||||||
|
padding: 15px 22px;
|
||||||
|
background-color: v-bind('themeVars.cardColor');
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -23,7 +23,7 @@ const decodeInput = ref('Hello%20world%20%3A)');
|
|||||||
const decodeOutput = computed(() => withDefaultOnError(() => decodeURIComponent(decodeInput.value), ''));
|
const decodeOutput = computed(() => withDefaultOnError(() => decodeURIComponent(decodeInput.value), ''));
|
||||||
|
|
||||||
const decodeValidation = useValidation({
|
const decodeValidation = useValidation({
|
||||||
source: encodeInput,
|
source: decodeInput,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
validator: value => isNotThrowing(() => decodeURIComponent(value)),
|
validator: value => isNotThrowing(() => decodeURIComponent(value)),
|
||||||
|
|||||||
Reference in new issue
Block a user