Compare commits

..
Author SHA1 Message Date
sharevb 6896d03a3a feat(new tools): iCal Generator/Merger/Parser
iCal file generator, merger and parser
2024-10-14 19:44:46 +02:00
Corentin THOMASSET 1c35ac3704 docs(author): updated author links (#1316) 2024-09-27 12:49:11 +00:00
Corentin Thomasset 72517002f3 refactor(regex-tester): better description 2024-09-27 10:40:56 +02:00
32 changed files with 645 additions and 887 deletions

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ Big thanks to all the people who have already contributed!
## Credits
Coded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).
Coded with ❤️ by [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=readme).
This project is continuously deployed using [vercel.com](https://vercel.com).
+12 -1
View File
@@ -89,6 +89,9 @@ declare module '@vue/runtime-core' {
HtmlWysiwygEditor: typeof import('./src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue')['default']
HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default']
IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default']
IcalGenerator: typeof import('./src/tools/ical-generator/ical-generator.vue')['default']
IcalMerger: typeof import('./src/tools/ical-merger/ical-merger.vue')['default']
IcalParser: typeof import('./src/tools/ical-parser/ical-parser.vue')['default']
'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default']
'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default']
IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default']
@@ -130,19 +133,28 @@ declare module '@vue/runtime-core' {
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NCode: typeof import('naive-ui')['NCode']
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDivider: typeof import('naive-ui')['NDivider']
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']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NRadio: typeof import('naive-ui')['NRadio']
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSpace: typeof import('naive-ui')['NSpace']
NTable: typeof import('naive-ui')['NTable']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
@@ -166,7 +178,6 @@ declare module '@vue/runtime-core' {
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
StacktracePrettier: typeof import('./src/tools/stacktrace-prettier/stacktrace-prettier.vue')['default']
StringObfuscator: typeof import('./src/tools/string-obfuscator/string-obfuscator.vue')['default']
SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default']
TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default']
+1 -1
View File
@@ -38,7 +38,7 @@ about:
# Über IT-Tools
Diese wunderbare Website, erstellt mit ❤ von [Corentin
Thomasset](https://github.com/CorentinTh), sammelt nützliche Tools für
Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), sammelt nützliche Tools für
Entwickler und Menschen, die in der IT arbeiten. Wenn du sie nützlich
findest, teile sie gerne mit Personen, von denen du denkst, dass sie sie
ebenfalls nützlich finden könnten, und vergiss nicht, sie in deiner
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# About IT-Tools
This wonderful website, made with ❤ by [Corentin Thomasset](https://github.com/CorentinTh) , aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don't forget to bookmark it in your shortcut bar!
This wonderful website, made with ❤ by [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) , aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don't forget to bookmark it in your shortcut bar!
IT Tools is open-source (under the MIT license) and free, and will always be, but it costs me money to host and renew the domain name. If you want to support my work, and encourage me to add more tools, please consider supporting by [sponsoring me](https://www.buymeacoffee.com/cthmsst).
+3 -3
View File
@@ -30,7 +30,7 @@ about:
content: >
# Sobre IT-Tools
Este maravilloso sitio web, hecho con ❤ por [Corentin Thomasset](https://github.com/CorentinTh) , agrega herramientas útiles para desarrolladores y personas que trabajan en IT. Si lo encuentra útil, no dude en compartirlo con las personas que crea que también pueden encontrarlo útil y ¡no olvide marcarlo como favorito en su barra de accesos directos!
Este maravilloso sitio web, hecho con ❤ por [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) , agrega herramientas útiles para desarrolladores y personas que trabajan en IT. Si lo encuentra útil, no dude en compartirlo con las personas que crea que también pueden encontrarlo útil y ¡no olvide marcarlo como favorito en su barra de accesos directos!
IT Tools es de código abierto (under the MIT license) y gratis, y siempre lo será, pero me cuesta dinero alojar y renovar el nombre de dominio. Si desea apoyar mi trabajo y animarme a agregar más herramientas, considere apoyarme a través de[sponsoring me](https://www.buymeacoffee.com/cthmsst).
@@ -39,7 +39,7 @@ about:
IT Tools está creado en Vue.js (Vue 3) con la biblioteca de componentes Naive UI y Vercel lo aloja y lo implementa continuamente. En algunas herramientas se utilizan bibliotecas de código abierto de terceros; puede encontrar la lista completa en [package.json](https://github.com/CorentinTh/it-tools/blob/main/package.json) archivo del repositorio.
## ¿Encontraste un error? ¿Falta una herramienta?
Si necesita una herramienta que actualmente no está presente aquí y cree que puede ser útil, puede enviar una solicitud de función en el [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) en el repositorio de GitHub.
Y si encontró un error o algo no funciona como se esperaba, presente un reporte de error en el [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) en el repositorio de GitHub.
@@ -68,4 +68,4 @@ tools:
math: Math
measurement: Measurement
text: Text
data: Data
data: Data
+1 -1
View File
@@ -29,7 +29,7 @@ about:
content: >
# À propos de IT-Tools
Ce merveilleux site, fait avec ❤ par [Corentin Thomasset](https://github.com/CorentinTh), regroupe des outils utiles pour les développeurs et les personnes travaillant dans l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de le mettre dans vos favoris !
Ce merveilleux site, fait avec ❤ par [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), regroupe des outils utiles pour les développeurs et les personnes travaillant dans l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de le mettre dans vos favoris !
IT Tools est open-source (sous licence MIT) et gratuit, et le restera toujours, mais cela me coûte de l'argent pour l'héberger et renouveler le nom de domaine. Si vous voulez soutenir mon travail, et m'encourager à ajouter plus d'outils, n'hésitez pas à me [soutenir](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Sobre o IT-Tools
Este site maravilhoso, feito com ❤ por [Corentin Thomasset](https://github.com/CorentinTh), junta ferramentas úteis para desenvolvedores e outras pessoas que trabalham com TI. Se você achar o site útil, fique à vontade para compartilhar com quem também possa gostar e não esqueça de salvar o bookmark na sua barra de atalhos!
Este site maravilhoso, feito com ❤ por [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), junta ferramentas úteis para desenvolvedores e outras pessoas que trabalham com TI. Se você achar o site útil, fique à vontade para compartilhar com quem também possa gostar e não esqueça de salvar o bookmark na sua barra de atalhos!
O IT Tools é código aberto (sob a licença MIT), é gratuito, e sempre será, mas custa dinheiro para hospedar e renovar o domínio. Se quiser apoiar meu trabalho e me encorajar a adicionar mais ferramentas, por favor considere [ser patrocinador](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Про IT-Tools
Цей чудовий вебсайт, створений з ❤ [Corentin Thomasset](https://github.com/CorentinTh), агрегує корисні інструменти для розробників і людей, які працюють в сфері IT. Якщо вам це корисно, будь ласка, поділіться цим з людьми, які, на вашу думку, також можуть знайти його корисним, і не забудьте додати його до закладок у вашій панелі швидкого доступу!
Цей чудовий вебсайт, створений з ❤ [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), агрегує корисні інструменти для розробників і людей, які працюють в сфері IT. Якщо вам це корисно, будь ласка, поділіться цим з людьми, які, на вашу думку, також можуть знайти його корисним, і не забудьте додати його до закладок у вашій панелі швидкого доступу!
IT Tools є відкритим програмним забезпеченням (під ліцензією MIT) і безкоштовним, і завжди буде таким, але мені коштує гроші для хостингу і продовження доменного імені. Якщо ви хочете підтримати мою роботу і підтримати мене у додаванні нових інструментів, розгляньте можливість підтримки, [спонсоруючи мене](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# Về IT-Tools
Website tuyệt vời này, được tạo ra bằng ❤ bởi [Corentin Thomasset](https://github.com/CorentinTh), tổng hợp các công cụ hữu ích cho nhà phát triển và những người làm việc trong lĩnh vực IT. Nếu bạn thấy nó hữu ích, xin đừng ngần ngại chia sẻ cho những người mà bạn nghĩ sẽ thấy nó hữu ích và đừng quên đánh dấu nó trong thanh lối tắt của bạn!
Website tuyệt vời này, được tạo ra bằng ❤ bởi [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about), tổng hợp các công cụ hữu ích cho nhà phát triển và những người làm việc trong lĩnh vực IT. Nếu bạn thấy nó hữu ích, xin đừng ngần ngại chia sẻ cho những người mà bạn nghĩ sẽ thấy nó hữu ích và đừng quên đánh dấu nó trong thanh lối tắt của bạn!
IT Tools là mã nguồn mở (dưới giấy phép MIT) và miễn phí, và sẽ luôn như vậy, nhưng tôi phải trả tiền để lưu trữ và gia hạn tên miền. Nếu bạn muốn hỗ trợ công việc của tôi, và khích lệ tôi thêm nhiều công cụ hơn, hãy xem xét hỗ trợ bằng cách [tài trợ cho tôi](https://www.buymeacoffee.com/cthmsst).
+1 -1
View File
@@ -30,7 +30,7 @@ about:
content: >
# 关于 IT-Tools
IT-Tools 由 [Corentin Thomasset](https://github.com/CorentinTh) 用 ❤ 开发,汇集了对开发人员和 IT 从业者有用的工具。如果对您有帮助,请将其分享给您的朋友,并且添加到收藏夹中!
IT-Tools 由 [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) 用 ❤ 开发,汇集了对开发人员和 IT 从业者有用的工具。如果对您有帮助,请将其分享给您的朋友,并且添加到收藏夹中!
IT-Tools 永久免费且开源(MIT 许可证),但需要资金用于托管和续订域名。如果您想支持我的工作,并鼓励我添加更多工具,请考虑通过 [赞助我](https://www.buymeacoffee.com/cthmsst) 进行支持。
+10 -13
View File
@@ -1,7 +1,14 @@
{
"name": "it-tools",
"version": "2024.5.13-a0bc346",
"packageManager": "pnpm@8.15.3",
"description": "Collection of handy online tools for developers, with great UX. ",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
"license": "GNU GPLv3",
"repository": {
"type": "git",
"url": "https://github.com/CorentinTh/it-tools"
},
"keywords": [
"productivity",
"converter",
@@ -13,12 +20,6 @@
"developer-tools",
"developer-productivity"
],
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://github.com/CorentinTh)",
"license": "GNU GPLv3",
"repository": {
"type": "git",
"url": "https://github.com/CorentinTh/it-tools"
},
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && NODE_OPTIONS=--max_old_space_size=4096 vite build",
@@ -58,7 +59,6 @@
"cronstrue": "^2.26.0",
"crypto-js": "^4.1.1",
"date-fns": "^2.29.3",
"dom-to-image-more": "^3.4.5",
"dompurify": "^3.0.6",
"email-normalizer": "^1.0.0",
"emojilib": "^3.0.10",
@@ -68,10 +68,10 @@
"highlight.js": "^11.7.0",
"iarna-toml-esm": "^3.0.5",
"ibantools": "^4.3.3",
"javastack.js": "^1.0.2",
"ical-generator": "^8.0.0",
"ical.js": "^2.1.0",
"js-base64": "^3.7.6",
"json5": "^2.2.3",
"jsstack.js": "^2.0.0",
"jwt-decode": "^3.1.2",
"libphonenumber-js": "^1.10.28",
"lodash": "^4.17.21",
@@ -82,13 +82,11 @@
"monaco-editor": "^0.43.0",
"naive-ui": "^2.35.0",
"netmask": "^2.0.2",
"netstack.js": "^2.0.0",
"node-forge": "^1.3.1",
"oui-data": "^1.0.10",
"pdf-signature-reader": "^1.4.2",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.8",
"pythonstack.js": "^1.0.2",
"qrcode": "^1.5.1",
"randexp": "^0.5.3",
"sql-formatter": "^13.0.0",
@@ -150,6 +148,5 @@
"vitest": "^0.34.0",
"workbox-window": "^7.0.0",
"zx": "^7.2.1"
},
"packageManager": "pnpm@8.15.3"
}
}
+70 -659
View File
File diff suppressed because it is too large. Load diff
+38 -4
View File
@@ -7,8 +7,15 @@ import sqlHljs from 'highlight.js/lib/languages/sql';
import xmlHljs from 'highlight.js/lib/languages/xml';
import yamlHljs from 'highlight.js/lib/languages/yaml';
import iniHljs from 'highlight.js/lib/languages/ini';
import bashHljs from 'highlight.js/lib/languages/bash';
import markdownHljs from 'highlight.js/lib/languages/markdown';
import jsHljs from 'highlight.js/lib/languages/javascript';
import cssHljs from 'highlight.js/lib/languages/css';
import goHljs from 'highlight.js/lib/languages/go';
import csharpHljs from 'highlight.js/lib/languages/csharp';
import { Base64 } from 'js-base64';
import { useCopy } from '@/composable/copy';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
const props = withDefaults(
defineProps<{
@@ -17,12 +24,17 @@ const props = withDefaults(
language?: string
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
copyMessage?: string
wordWrap?: boolean
downloadFileName?: string
downloadButtonText?: string
}>(),
{
followHeightOf: null,
language: 'txt',
copyPlacement: 'top-right',
copyMessage: 'Copy to clipboard',
downloadFileName: '',
downloadButtonText: 'Download',
},
);
hljs.registerLanguage('sql', sqlHljs);
@@ -31,13 +43,25 @@ hljs.registerLanguage('html', xmlHljs);
hljs.registerLanguage('xml', xmlHljs);
hljs.registerLanguage('yaml', yamlHljs);
hljs.registerLanguage('toml', iniHljs);
hljs.registerLanguage('bash', bashHljs);
hljs.registerLanguage('markdown', markdownHljs);
hljs.registerLanguage('css', cssHljs);
hljs.registerLanguage('javascript', jsHljs);
hljs.registerLanguage('go', goHljs);
hljs.registerLanguage('csharp', csharpHljs);
const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(props);
const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } = toRefs(props);
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value);
const valueBase64 = computed(() => Base64.encode(value.value));
const { download } = useDownloadFileFromBase64(
{
source: valueBase64,
filename: downloadFileName,
});
</script>
<template>
@@ -49,11 +73,16 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
>
<n-config-provider :hljs="hljs">
<n-code :code="value" :language="language" :trim="false" data-test-id="area-content" />
<n-code :code="value" :language="language" :word-wrap="wordWrap" :trim="false" data-test-id="area-content" />
</n-config-provider>
</n-scrollbar>
<div absolute right-10px top-10px>
<c-tooltip v-if="value" :tooltip="tooltipText" position="left">
<div
v-if="value && copyPlacement !== 'none'"
absolute right-10px
:top-10px="copyPlacement === 'top-right' ? '' : 'no'"
:bottom-10px="copyPlacement === 'bottom-right' ? '' : 'no'"
>
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
<c-button circle important:h-10 important:w-10 @click="copy()">
<n-icon size="22" :component="Copy" />
</c-button>
@@ -65,6 +94,11 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.
{{ tooltipText }}
</c-button>
</div>
<div v-if="downloadFileName !== '' && value !== ''" mt-5 flex justify-center>
<c-button secondary @click="download">
{{ downloadButtonText }}
</c-button>
</div>
</div>
</template>
+14 -13
View File
@@ -1,6 +1,7 @@
import { extension as getExtensionFromMimeType, extension as getMimeTypeFromExtension } from 'mime-types';
import type { Ref } from 'vue';
import type { MaybeRef, Ref } from 'vue';
import _ from 'lodash';
import { get } from '@vueuse/core';
export {
getMimeTypeFromBase64,
@@ -75,21 +76,11 @@ function downloadFromBase64({ sourceValue, filename, extension, fileMimeType }:
}
function useDownloadFileFromBase64(
{ source, filename, extension, fileMimeType }:
{ source: Ref<string>; filename?: string; extension?: string; fileMimeType?: string }) {
return {
download() {
downloadFromBase64({ sourceValue: source.value, filename, extension, fileMimeType });
},
};
}
function useDownloadFileFromBase64Refs(
{ source, filename, extension }:
{ source: Ref<string>; filename?: Ref<string>; extension?: Ref<string> }) {
{ source: MaybeRef<string>; filename?: MaybeRef<string>; extension?: MaybeRef<string> }) {
return {
download() {
downloadFromBase64({ sourceValue: source.value, filename: filename?.value, extension: extension?.value });
downloadFromBase64({ sourceValue: get(source), filename: get(filename), extension: get(extension) });
},
};
}
@@ -116,3 +107,13 @@ function previewImageFromBase64(base64String: string): HTMLImageElement {
return img;
}
function useDownloadFileFromBase64Refs(
{ source, filename, extension }:
{ source: Ref<string>; filename?: Ref<string>; extension?: Ref<string> }) {
return {
download() {
downloadFromBase64({ sourceValue: source.value, filename: filename?.value, extension: extension?.value });
},
};
}
+1 -1
View File
@@ -81,7 +81,7 @@ const tools = computed<ToolCategory[]>(() => [
</div>
<div>
© {{ new Date().getFullYear() }}
<c-link target="_blank" rel="noopener" href="https://github.com/CorentinTh">
<c-link target="_blank" rel="noopener" href="https://corentin.tech?utm_source=it-tools&utm_medium=footer">
Corentin Thomasset
</c-link>
</div>
+127
View File
@@ -0,0 +1,127 @@
<script setup lang="ts">
import slugify from '@sindresorhus/slugify';
import ical, { ICalCalendarMethod } from 'ical-generator';
import { Base64 } from 'js-base64';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
interface Event {
startend: [number, number]
summary?: string
description?: string
location?: string
url?: string
}
const events = ref<Array<Event>>([{
startend: [Date.now(), Date.now()],
summary: 'An event',
}]);
function deleteEvent(index: number) {
if (events.value.length === 1) {
return;
}
events.value.splice(index, 1);
}
function addEvent() {
const now = Date.now();
events.value.push({
startend: [now, now + 3600 * 1000],
summary: 'An event',
});
}
const output = computed(() => {
try {
const calendar = ical({ name: events.value[0]?.summary || 'unamed' });
// A method is required for outlook to display event as an invitation
calendar.method(ICalCalendarMethod.REQUEST);
for (const event of events.value) {
calendar.createEvent({
start: new Date(event.startend[0]).toUTCString(),
end: new Date(event.startend[0]).toUTCString(),
summary: event.summary,
description: event.description,
location: event.location,
url: event.url,
});
}
return { ical: calendar.toString() };
}
catch (e: any) {
return { error: e.toString() };
}
});
const outputBase64 = computed(() => Base64.encode(output.value?.ical || ''));
const customOutputFileName = ref('');
const outputFileName = computed(() => {
if (customOutputFileName.value) {
return customOutputFileName.value;
}
return slugify(events.value[0]?.summary || 'unamed');
});
const { download } = useDownloadFileFromBase64(
{
source: outputBase64,
filename: outputFileName,
extension: 'ics',
});
</script>
<template>
<div>
<div mb-2 flex items-baseline gap-2>
<c-input-text
v-model:value="outputFileName"
placeholder="Generated if empty"
label="Output filename:"
label-position="left"
mb-2
/>
<c-button v-if="output.ical" @click="download">
Download ICS
</c-button>
</div>
<c-alert v-if="output.error" mb-2>
{{ output.error }}
</c-alert>
<c-card v-for="(event, index) in events" :key="index" mb-2>
<n-form-item label="Title:" label-placement="left">
<n-input v-model:value="event.summary" :allow-input="(value:string) => !!value" />
</n-form-item>
<n-form-item label="Dates and hours:" label-placement="left">
<n-date-picker v-model:value="event.startend" type="datetimerange" />
</n-form-item>
<c-input-text
v-model:value="event.description"
label="Description"
placeholder="Put a description here"
multiline
rows="2"
mb-2
/>
<c-input-text
v-model:value="event.url"
label="Url:"
label-position="left"
placeholder="Put an url here"
mb-2
/>
<div flex justify-center>
<c-button @click="deleteEvent(index)">
Delete
</c-button>
</div>
</c-card>
<div mt-2 flex justify-center>
<c-button @click="addEvent">
Add Event
</c-button>
</div>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { CalendarEvent } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'ICAL Generator',
path: '/ical-generator',
description: 'Generate ICAL/ICS file from event infos',
keywords: ['ical', 'calendar', 'event', 'generator'],
component: () => import('./ical-generator.vue'),
icon: CalendarEvent,
createdAt: new Date('2024-08-15'),
});
@@ -0,0 +1,82 @@
import { describe, expect, it } from 'vitest';
import { mergeIcals } from './ical-merger.service';
describe('ical-merger', () => {
describe('mergeIcals', () => {
it('merge correctly', () => {
expect(mergeIcals([
`BEGIN:VCALENDAR
PRODID:-//xyz Corp//NONSGML PDA Calendar Version 1.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:19960704T120000Z
UID:uid1@example.com
ORGANIZER:mailto:jsmith@example.com
DTSTART:19960918T143000Z
DTEND:19960920T220000Z
STATUS:CONFIRMED
CATEGORIES:CONFERENCE
SUMMARY:Networld+Interop Conference
DESCRIPTION:Networld+Interop Conference
and Exhibit\\nAtlanta World Congress Center\\n
Atlanta\\, Georgia
END:VEVENT
END:VCALENDAR`,
`BEGIN:VCALENDAR
METHOD:xyz
VERSION:2.0
PRODID:-//ABC Corporation//NONSGML My Product//EN
BEGIN:VEVENT
DTSTAMP:19970324T120000Z
SEQUENCE:0
UID:uid3@example.com
ORGANIZER:mailto:jdoe@example.com
ATTENDEE;RSVP=TRUE:mailto:jsmith@example.com
DTSTART:19970324T123000Z
DTEND:19970324T210000Z
CATEGORIES:MEETING,PROJECT
CLASS:PUBLIC
SUMMARY:Calendaring Interoperability Planning Meeting
DESCRIPTION:Discuss how we can test c&s interoperability\\n
using iCalendar and other IETF standards.
LOCATION:LDB Lobby
ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/
conf/bkgrnd.ps
END:VEVENT
END:VCALENDAR`,
])).to.eq(
`BEGIN:VCALENDAR
PRODID:it-tools-ical-merger
VERSION:1.0
BEGIN:VEVENT
DTSTAMP:19960704T120000Z
UID:uid1@example.com
ORGANIZER:mailto:jsmith@example.com
DTSTART:19960918T143000Z
DTEND:19960920T220000Z
STATUS:CONFIRMED
CATEGORIES:CONFERENCE
SUMMARY:Networld+Interop Conference
DESCRIPTION:Networld+Interop Conference and Exhibit\\nAtlanta World Congress
Center\\nAtlanta\\, Georgia
END:VEVENT
BEGIN:VEVENT
DTSTAMP:19970324T120000Z
SEQUENCE:0
UID:uid3@example.com
ORGANIZER:mailto:jdoe@example.com
ATTENDEE;RSVP=TRUE:mailto:jsmith@example.com
DTSTART:19970324T123000Z
DTEND:19970324T210000Z
CATEGORIES:MEETING,PROJECT
CLASS:PUBLIC
SUMMARY:Calendaring Interoperability Planning Meeting
DESCRIPTION:Discuss how we can test c&s interoperability\\nusing iCalendar a
nd other IETF standards.
LOCATION:LDB Lobby
ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/conf/bkgrnd.ps
END:VEVENT
END:VCALENDAR`.replace(/\n/g, '\r\n'));
});
});
});
@@ -0,0 +1,45 @@
import ICAL from 'ical.js';
export function mergeIcals(inputs: Array<string>, options: {
calname?: string
timezone?: string
caldesc?: string
} = {}) {
let calendar;
for (const input of inputs) {
try {
const jcal = ICAL.parse(input);
const cal = new ICAL.Component(jcal);
if (!calendar) {
calendar = cal;
calendar.updatePropertyWithValue('prodid', 'it-tools-ical-merger');
calendar.updatePropertyWithValue('version', '1.0');
if (options.calname) {
calendar.updatePropertyWithValue('x-wr-calname', options.calname);
}
if (options.timezone) {
calendar.updatePropertyWithValue('x-wr-timezone', options.timezone);
}
if (options.caldesc) {
calendar.updatePropertyWithValue('x-wr-caldesc', options.caldesc);
}
}
else {
for (const vevent of cal.getAllSubcomponents('vevent')) {
calendar.addSubcomponent(vevent);
}
}
}
catch (e) {
throw new Error(`Failed to merge: ${e}\n\nWith input: ${input}`);
}
}
if (!calendar) {
throw new Error('No icals parsed successfully');
}
return calendar.toString();
}
+96
View File
@@ -0,0 +1,96 @@
<script setup lang="ts">
import { mergeIcals } from './ical-merger.service';
const fileInputs = ref<Array<File>>([]);
const mergedOutput = ref('');
const calendarName = ref('');
const calendarDescription = ref('');
const errors = ref('');
function onUploads(files: Array<File>) {
fileInputs.value = [...fileInputs.value, ...files];
}
function deleteFile(index: number) {
fileInputs.value.splice(index, 1);
}
async function mergeFiles() {
const fileBuffers: Array<string> = [];
for (const file of fileInputs.value) {
fileBuffers.push(await readFileAsString(file));
}
errors.value = '';
mergedOutput.value = '';
try {
mergedOutput.value = mergeIcals(fileBuffers);
}
catch (e: any) {
errors.value = e.toString();
}
}
function readFileAsString(file: File) {
return new Promise<string>((resolve, reject) => {
const fr = new FileReader();
fr.onload = () => {
resolve(fr.result as string || '');
};
fr.onerror = reject;
fr.readAsText(file);
});
}
</script>
<template>
<div>
<c-file-upload
title="Drag and drop iCal file here, or click to select a file"
multiple
mb-2
@files-upload="onUploads"
/>
<n-form-item label="Title:" label-placement="left">
<n-input v-model:value="calendarName" placeholder="Please input merge calendar title..." />
</n-form-item>
<n-form-item label="Description:">
<n-input v-model:value="calendarDescription" placeholder="Please input merged calendar description..." />
</n-form-item>
<ul>
<li v-for="(file, index) in fileInputs" :key="index" mb-1>
<n-button mr-2 @click="deleteFile(index)">
Delete
</n-button>
File to merge: {{ file.name }}
</li>
</ul>
<div flex justify-center>
<n-button @click="mergeFiles">
Merge iCal files
</n-button>
</div>
<n-divider />
<c-alert v-if="errors" mb-2>
{{ errors }}
</c-alert>
<textarea-copyable
v-if="mergedOutput"
v-model:value="mergedOutput"
download-file-name="merge.ics"
download-button-text="Download merged iCal"
label="Merged ICAL"
mb-2
/>
</div>
</template>
<style lang="less" scoped>
::v-deep(.n-upload-trigger) {
width: 100%;
}
</style>
+12
View File
@@ -0,0 +1,12 @@
import { CalendarPlus } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'iCal Merger',
path: '/ical-merger',
description: 'Merge many iCal file to a single',
keywords: ['ical', 'ics', 'merger'],
component: () => import('./ical-merger.vue'),
icon: CalendarPlus,
createdAt: new Date('2024-08-15'),
});
+96
View File
@@ -0,0 +1,96 @@
<script setup lang="ts">
import type { Ref } from 'vue';
import ICAL from 'ical.js';
const inputType = ref<'file' | 'content'>('file');
const icalContent = ref('');
const fileInput = ref() as Ref<File | null>;
const icalInfosRaw = computedAsync(async () => {
const file = fileInput.value;
const content = icalContent.value;
try {
if (inputType.value === 'file' && file) {
const jcal = ICAL.parse(await readFileAsString(file));
return new ICAL.Component(jcal);
}
else {
const jcal = ICAL.parse(content);
return new ICAL.Component(jcal);
}
}
catch (e: any) {
return {
error: e.toString(),
};
}
});
async function onUpload(file: File) {
if (file) {
fileInput.value = file;
}
}
watch(icalContent, (_, newValue) => {
if (newValue !== '') {
fileInput.value = null;
}
});
function readFileAsString(file: File) {
return new Promise<string>((resolve, reject) => {
const fr = new FileReader();
fr.onload = () => {
resolve(fr.result as string || '');
};
fr.onerror = reject;
fr.readAsText(file);
});
}
</script>
<template>
<div>
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="file"
label="File"
/>
<n-radio
value="content"
label="Content"
/>
</n-space>
</n-radio-group>
<c-file-upload
v-if="inputType === 'file'"
title="Drag and drop iCal file here, or click to select a file"
@file-upload="onUpload"
/>
<c-input-text
v-if="inputType === 'content'"
v-model:value="icalContent"
label="iCal Content"
placeholder="Paste your iCal content here"
multiline
mb-2
/>
<n-divider />
<textarea-copyable
label="Parsed iCal"
mb-2
:value="JSON.stringify(icalInfosRaw, null, 2)"
/>
</div>
</template>
<style lang="less" scoped>
::v-deep(.n-upload-trigger) {
width: 100%;
}
</style>
+12
View File
@@ -0,0 +1,12 @@
import { CalendarEvent } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'ICAL File Parser',
path: '/ical-parser',
description: 'Parse ICAL/ICS file to event display',
keywords: ['ical', 'ics', 'calendar', 'parser'],
component: () => import('./ical-parser.vue'),
icon: CalendarEvent,
createdAt: new Date('2024-08-15'),
});
+6 -2
View File
@@ -2,7 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as emailNormalizer } from './email-normalizer';
import { tool as stacktracePrettier } from './stacktrace-prettier';
import { tool as icalMerger } from './ical-merger';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
@@ -13,6 +13,8 @@ import { tool as jsonToXml } from './json-to-xml';
import { tool as regexTester } from './regex-tester';
import { tool as regexMemo } from './regex-memo';
import { tool as markdownToHtml } from './markdown-to-html';
import { tool as icalParser } from './ical-parser';
import { tool as icalGenerator } from './ical-generator';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -161,7 +163,6 @@ export const toolsByCategory: ToolCategory[] = [
emailNormalizer,
regexTester,
regexMemo,
stacktracePrettier,
],
},
{
@@ -186,6 +187,9 @@ export const toolsByCategory: ToolCategory[] = [
textDiff,
numeronymGenerator,
asciiTextDrawer,
icalGenerator,
icalParser,
icalMerger,
],
},
{
+1 -1
View File
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Regex Tester',
path: '/regex-tester',
description: 'Regex Tester',
description: 'Test your regular expressions with sample text.',
keywords: ['regex', 'tester', 'sample', 'expression'],
component: () => import('./regex-tester.vue'),
icon: Language,
-3
View File
@@ -1,3 +0,0 @@
declare module "dom-to-image-more" {
export function toPng(el: HTMLElement | undefined, options?: { bgcolor: string }) : Promise<string>;
}
-12
View File
@@ -1,12 +0,0 @@
import { Stack } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Stacktrace prettier',
path: '/stacktrace-prettier',
description: 'Highlight .Net and JS stacktraces',
keywords: ['stacktrace', 'prettier', 'highlighter'],
component: () => import('./stacktrace-prettier.vue'),
icon: Stack,
createdAt: new Date('2024-08-15'),
});
-3
View File
@@ -1,3 +0,0 @@
declare module "javastack.js" {
export default function javastack(selector: string, options: { prettyprint: boolean }) : void;
}
-3
View File
@@ -1,3 +0,0 @@
declare module "jsstack.js" {
export default function jsstack(selector: string) : void;
}
-5
View File
@@ -1,5 +0,0 @@
declare module "netstack.js" {
export default class netstack {
constructor(el: HTMLElement | undefined, options: { prettyprint: boolean })
}
}
-3
View File
@@ -1,3 +0,0 @@
declare module "pythonstack.js" {
export default function pythonstack(selector: string, options: { prettyprint: boolean }) : void;
}
@@ -1,153 +0,0 @@
<script setup lang="ts">
import JSStack from 'jsstack.js';
import JavaStack from 'javastack.js';
import PythonStack from 'pythonstack.js';
import NetStack from 'netstack.js';
import domtoimage from 'dom-to-image-more';
import { useQueryParamOrStorage } from '@/composable/queryParams';
import { useStyleStore } from '@/stores/style.store';
import { useCopy } from '@/composable/copy';
const styleStore = useStyleStore();
const stackType = useQueryParamOrStorage<'net' | 'js' | 'java' | 'python'>({ name: 'type', storageName: 'stackfmt:type', defaultValue: 'net' });
const stackTrace = ref('');
const formatedStackTrace = ref<HTMLElement>();
const stackTraceText = ref('');
watchEffect(() => {
if (!formatedStackTrace.value) {
return;
}
let cleanedStackTrace;
try {
cleanedStackTrace = JSON.parse(stackTrace.value);
}
catch (_) {
cleanedStackTrace = stackTrace.value.replace(/(\\r)?\\n/g, '\n').replace(/(?:^['"])|(?:['"]$)/, '');
};
try {
if (stackType.value === 'js') {
formatedStackTrace.value.textContent = cleanedStackTrace;
JSStack('.stacktrace');
}
else if (stackType.value === 'java') {
formatedStackTrace.value.textContent = cleanedStackTrace;
JavaStack('.stacktrace', { prettyprint: true });
}
else if (stackType.value === 'python') {
formatedStackTrace.value.textContent = cleanedStackTrace;
PythonStack('.stacktrace', { prettyprint: true });
}
else if (stackType.value === 'net') {
formatedStackTrace.value.innerText = cleanedStackTrace;
const _ = new NetStack(formatedStackTrace.value, { prettyprint: true });
}
stackTraceText.value = formatedStackTrace.value.innerText;
}
catch {}
});
const stackTraceMarkdown = computed(() => {
let lang;
if (stackType.value === 'net') {
lang = 'csharp';
}
else if (stackType.value === 'js') {
lang = 'javascript';
}
else if (stackType.value === 'java') {
lang = 'java';
}
else if (stackType.value === 'python') {
lang = 'python';
}
return `\`\`\`${lang}\n${formatedStackTrace.value?.innerText}\n\`\`\``;
});
const { copy: copyText } = useCopy({ source: stackTraceText, text: 'Formatted stacktrace copied to the clipboard' });
const { copy: copyMarkdown } = useCopy({ source: stackTraceMarkdown, text: 'Markdown Formatted stacktrace copied to the clipboard' });
async function downloadAsPNG() {
const dataUrl = await domtoimage.toPng(formatedStackTrace.value, { bgcolor: styleStore.isDarkTheme ? '#333' : '#fff' });
const link = document.createElement('a');
link.download = 'stacktrace.png';
link.href = dataUrl;
link.click();
}
const wrap = ref(true);
</script>
<template>
<div max-w-600px>
<n-radio-group v-model:value="stackType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="net"
label=".Net"
/>
<n-radio
value="js"
label="Javascript"
/>
<n-radio
value="python"
label="Python"
/>
<n-radio
value="java"
label="Java"
/>
</n-space>
</n-radio-group>
<div mb-2 flex justify-center>
<n-checkbox v-model:checked="wrap">
Wrap lines?
</n-checkbox>
</div>
<c-input-text
v-model:value="stackTrace"
label="Stacktrace"
placeholder="Paste your stacktrace here.."
multiline
rows="5"
/>
<n-divider />
<pre ref="formatedStackTrace" class="stacktrace" :style="{ padding: '20px', whiteSpace: wrap ? 'pre-wrap' : 'pre', overflowX: 'auto', wordBreak: 'break-all' }" />
<div v-if="stackTraceText" flex justify-center gap-1>
<c-button @click="copyText()">
Copy Formatted (Text)
</c-button>
<c-button @click="copyMarkdown()">
Copy Formatted (Markdown)
</c-button>
<c-button @click="downloadAsPNG()">
Download as PNG
</c-button>
</div>
</div>
</template>
<style lang="less" scoped>
::v-deep(.stacktrace) {
pre, code {background-color:#333 !important; color: #fff !important;}
.st-type {color: #0a8472; font-weight: bolder;}
.st-method {color: #70c9ba; font-weight: bolder;}
.st-frame-params {color: #ffffff; font-weight: normal;}
.st-param-type {color: #0a8472;}
.st-param-name {color: #ffffff;}
.st-file {color:#f8b068;}
.st-line {color:#ff4f68;}
.st-methodName {color: #70c9ba;font-weight: bolder;}
.st-column {color: #f8b068;}
.st-lineNumber {color: #ff4f68;}
.st-fileName {color: #85dbff;}
.st-intro {color: #0044dd;}
.st-exception {color: #e40000;}
}
</style>