This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // other allowed node types | |
| const allowNodes: number[] = [Node.TEXT_NODE, Node.DOCUMENT_FRAGMENT_NODE] | |
| // allowed tags | |
| const allowTags = ['div', 'span', 'p', 'img', 'strong', 'i', 'b', 's', 'br', 'a', 'blockquote', 'code', 'del', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'kbd', 'ol', 'ul', 'li', 'sub', 'sup'] | |
| // allowed tag's attributes | |
| const allowAttrs = ['src', 'width', 'height', 'alt', 'title', 'href', 'style'] | |
| // generate almost unique hash that avoid key warning | |
| const unsafeHash = () => Math.random().toString(36).substring(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| type ComponentProps, | |
| createElement, | |
| type ElementType, | |
| type ForwardedRef, | |
| forwardRef, | |
| type MutableRefObject, | |
| type ReactDOM, | |
| type ReactElement, | |
| type Ref, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script setup> | |
| import useEventBus from './lib/event-bus' | |
| const bus = useEventBus() | |
| bus | |
| .on('session-change', (...args) => { | |
| // TODO Session Change | |
| console.log('session change event fired', args) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div ref="container"></div> | |
| </template> | |
| <script setup lang="ts"> | |
| import {defineEmits, onBeforeUnmount, onMounted, ref, toRefs, watch} from 'vue'; | |
| import {editor as editorType, IDisposable} from 'monaco-editor'; | |
| import ICodeEditor = editorType.ICodeEditor; | |
| export interface CodeEditorProps { | |
| modelValue: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Array Cartesian Product | |
| */ | |
| const cartesian = <T,>(...arr: (T extends unknown[] ? never : T)[][]) => | |
| arr.reduce((a, b) => a.flatMap((x) => b.map((y) => [...x, y])), [ | |
| [] as T[], | |
| ] as T[][]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WSL2 network port forwarding script v1 | |
| # for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell, | |
| # for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter. | |
| # written by Daehyuk Ahn, Aug-1-2020 | |
| # edited by Ukjin Yang, Jun-7-2022 (Windows Server 2022 also works!) | |
| # Improved features: more detailed logs for Task Scheduler, saved IP check, etc. | |
| If ($Args[0] -eq "list") { | |
| netsh interface portproxy show v4tov4; | |
| exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type React from 'react'; | |
| import { createContext, useContext, useEffect, useMemo, useState } from 'react'; | |
| /** | |
| * 레이아웃 키값 Map | |
| * @date 2022. 4. 20. - 오후 3:51:50 | |
| * | |
| * @export | |
| * @interface LayoutMap | |
| * @typedef {LayoutMap} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function GetRecentFolder(path) | |
| On Error Resume Next | |
| Dim fso, folder, version | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| Set GetRecentFolder = Nothing | |
| For Each folder in fso.GetFolder(path).SubFolders | |
| version = CInt(Left(folder.Name, Instr(folder.Name, ".") - 1)) | |
| If Err.Number = 0 And version > 0 Then | |
| Set GetRecentFolder = folder | |
| Else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Component | |
| public class ExampleComponent { | |
| @Autowired | |
| // @Qualifier("myProperties") | |
| // @Resource(name = "myProperties") | |
| private Properties myProperties; | |
| public String getMyConfig() { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "profiles": | |
| { | |
| "list": | |
| [ | |
| { | |
| "commandline": "%PROGRAMFILES%/git/usr/bin/bash.exe -i -l", | |
| "guid": "{00000000-0000-0000-ba54-000000000002}", | |
| "icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico", | |
| "name": "Git bash", |