{
6 | // Create the mocha test
7 | const mocha = new Mocha({
8 | ui: 'tdd',
9 | });
10 | mocha.useColors(true);
11 |
12 | const testsRoot = path.resolve(__dirname, '..');
13 |
14 | return new Promise((c, e) => {
15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
16 | if (err) {
17 | return e(err);
18 | }
19 |
20 | // Add files to the test suite
21 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
22 |
23 | try {
24 | // Run the mocha test
25 | mocha.run(failures => {
26 | if (failures > 0) {
27 | e(new Error(`${failures} tests failed.`));
28 | } else {
29 | c();
30 | }
31 | });
32 | } catch (err) {
33 | e(err);
34 | }
35 | });
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/InterrogationMark.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgInterrogationMark = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
16 | )
17 | export default SvgInterrogationMark
18 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/SearchMedium.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgSearchMedium = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
18 | )
19 | export default SvgSearchMedium
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/SearchSmall.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgSearchSmall = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
18 | )
19 | export default SvgSearchSmall
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/indexes.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/shared/types.ts:
--------------------------------------------------------------------------------
1 | // 通用数据结构定义
2 |
3 | // 链接类型
4 | export enum LinkType {
5 | // 文章
6 | Article = 'Article',
7 |
8 | // 系列文章
9 | Series = 'Series',
10 |
11 | // 论文
12 | Paper = 'Paper',
13 |
14 | // 书籍
15 | Book = 'Book',
16 |
17 | // 视频教程
18 | Course = 'Course',
19 |
20 | // 资源集合
21 | Collection = 'Collection',
22 |
23 | // 幻灯片
24 | Slide = 'Slide',
25 |
26 | // 开源的项目或者框架、库
27 | Project = 'Project',
28 |
29 | Unknown = '未知'
30 | }
31 |
32 | export interface LinkItem {
33 | objectID: string; // md5(href)
34 |
35 | // 基本信息
36 | title: string;
37 | href: string;
38 | // 描述
39 | desc: string;
40 | // 原始数据
41 | raw: string;
42 |
43 | // 额外信息
44 | year: string;
45 | type: LinkType;
46 |
47 | author?: string;
48 | version?: string;
49 |
50 | // 文件名
51 | fileName: string;
52 | // 文件路径
53 | fileHref: string;
54 | // 从文件路径,以及文件名中获取到类目
55 | categories: string[];
56 | }
57 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/Picture.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgPicture = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
16 | )
17 | export default SvgPicture
18 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/SearchBox.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import styled from 'styled-components'
3 | import { connectSearchBox } from 'react-instantsearch-dom'
4 |
5 | import Input from 'components/Input'
6 | import { SearchMedium } from 'components/icons'
7 |
8 | const SearchIcon = styled(SearchMedium)`
9 | max-width: 20px;
10 | color: ${(p) => p.theme.colors.gray[2]};
11 | `
12 |
13 | const SearchBox = connectSearchBox(({ currentRefinement, refine }) => {
14 | const [value, setValue] = React.useState(currentRefinement)
15 |
16 | React.useEffect(() => {
17 | refine(value)
18 | }, [value])
19 |
20 | return (
21 | setValue(e.target.value)}
25 | clear={() => setValue('')}
26 | placeholder="Search something"
27 | icon={ }
28 | style={{ width: 520 }}
29 | />
30 | )
31 | })
32 |
33 | export default SearchBox
34 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/Indexes.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgIndexes = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
18 | )
19 | export default SvgIndexes
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/app/loading.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import styled from 'styled-components'
3 | import Spinner from '../svg/spinner'
4 |
5 | export default class Loading extends Component {
6 |
7 | constructor(props) {
8 | super(props)
9 |
10 | this.state = {
11 | show: false,
12 | }
13 |
14 | this.loadingDelay = this.loadingDelay.bind(this)
15 | this.timer = setTimeout(this.loadingDelay, 250)
16 | }
17 |
18 | componentWillUnmount() {
19 | clearTimeout(this.timer)
20 | }
21 |
22 | loadingDelay() {
23 | this.setState({ show: true })
24 | }
25 |
26 | render() {
27 | const { show } = this.state
28 | return show ? (
29 |
30 |
31 |
32 | ) : null
33 | }
34 | }
35 |
36 | const Load = styled.div`
37 | position: absolute;
38 | right: 18px;
39 | top: 12px;
40 | `
--------------------------------------------------------------------------------
/picgo-plugin-ngte-migrater/dist/i18n/zh-CN.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.zh = void 0;
4 | /* eslint-disable no-template-curly-in-string */
5 | /* eslint-disable comma-dangle */
6 | exports.zh = {
7 | PIC_MIGRATER_CHOOSE_FILE: '选择文件',
8 | PIC_MIGRATER_CHOOSE_FOLDER: '选择文件夹',
9 | PIC_MIGRATER_PROCESSING: '迁移进行中...',
10 | PIC_MIGRATER_BE_PATIENT: '请耐心等待',
11 | PIC_MIGRATER_SUCCESS: '迁移完成',
12 | PIC_MIGRATER_FAIL: '${file} 迁移失败',
13 | PIC_MIGRATER_FAIL_TIP: '无成功迁移的图片,请检查 URL 是否存在或者图床配置问题',
14 | PIC_MIGRATER_SUCCESS_TIP: '图片迁移成功:${success}张, 图片迁移失败:${fail}张',
15 | // config
16 | PIC_MIGRATER_CONFIG_TIP_TITLE: '请先进行配置',
17 | PIC_MIGRATER_CONFIG_TIP_BODY: '点击 配置plugin,配置插件之后方可使用',
18 | PIC_MIGRATER_CONFIG_NEW_FILE_SUFFIX: '新文件名后缀',
19 | PIC_MIGRATER_CONFIG_INCLUDE: '只包含',
20 | PIC_MIGRATER_CONFIG_EXCLUDE: '不包含',
21 | PIC_MIGRATER_CONFIG_OLD_CONTENT_WRITE_TO_NEW_FILE: '旧内容写入新文件',
22 | PIC_MIGRATER_CONFIG_TIPS: '请输入路径或者URL'
23 | };
24 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/.github/release-draft-template.yml:
--------------------------------------------------------------------------------
1 | name-template: 'v$RESOLVED_VERSION 🌻'
2 | tag-template: 'v$RESOLVED_VERSION'
3 | exclude-labels:
4 | - 'skip-changelog'
5 | version-resolver:
6 | minor:
7 | labels:
8 | - 'breaking-change'
9 | default: patch
10 | categories:
11 | - title: '⚠️ Breaking changes'
12 | label: 'breaking-change'
13 | - title: '🚀 Enhancements'
14 | label: 'enhancement'
15 | - title: '🐛 Bug Fixes'
16 | label: 'bug'
17 | - title: '🔒 Security'
18 | label: 'security'
19 | template: |
20 | ## Changes
21 |
22 | $CHANGES
23 |
24 | Thanks again to $CONTRIBUTORS! 🎉
25 | no-changes-template: 'Changes are coming soon 😎'
26 | sort-direction: 'ascending'
27 | replacers:
28 | - search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
29 | replace: ''
30 | - search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
31 | replace: ''
32 | - search: '/(?:and )?@bors(?:\[bot\])?,?/g'
33 | replace: ''
34 | - search: '/(?:and )?@meili-bot,?/g'
35 | replace: ''
36 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/config/dict.ts:
--------------------------------------------------------------------------------
1 | export const term = {
2 | 'Coder Essentials': '编程通识基础',
3 | Reference: '资料索引'
4 | };
5 |
6 | // 待忽略的文件与目录
7 | export const ignoreFilesOrDirs = [
8 | '.DS_Store',
9 | '',
10 | '.stash',
11 | 'README.md',
12 | 'Index.md',
13 | 'LICENSE',
14 | 'README-en.md',
15 | 'toc.md',
16 | 'Template.md',
17 | '.gitkeep',
18 | '.gitattributes',
19 | '.gitbook.yaml',
20 | '.meta',
21 | '.mindmap',
22 | 'meta.yml',
23 | 'ABOUT.md',
24 | 'ROADMAP.md',
25 | '.gitignore',
26 | 'meta.json'
27 | ];
28 |
29 | export const appendix = `
30 |
31 | # 狗粮
32 |
33 | 如果觉得本系列对你有所帮助,欢迎给我家布丁买点狗粮(支付宝扫码)~
34 |
35 | 
36 |
37 |
38 |
39 | # 版权
40 |
41 | 
42 |
43 | 
44 |
45 |
46 | 笔者所有文章遵循 [知识共享 署名-非商业性使用-禁止演绎 4.0 国际许可协议](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh),欢迎转载,尊重版权。
47 |
48 | `;
49 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/index.js:
--------------------------------------------------------------------------------
1 | export { default as ArrowDown } from './ArrowDown'
2 | export { default as Cross } from './Cross'
3 | export { default as DiscordLogo } from './DiscordLogo'
4 | export { default as DocumentBig } from './DocumentBig'
5 | export { default as DocumentMedium } from './DocumentMedium'
6 | export { default as GithubLogo } from './GithubLogo'
7 | export { default as Indexes } from './Indexes'
8 | export { default as InterrogationMark } from './InterrogationMark'
9 | export { default as Key } from './Key'
10 | export { default as KeyBig } from './KeyBig'
11 | export { default as LogoText } from './LogoText'
12 | export { default as MeilisearchLogo } from './MeilisearchLogo'
13 | export { default as Picture } from './Picture'
14 | export { default as SearchMedium } from './SearchMedium'
15 | export { default as SearchSmall } from './SearchSmall'
16 | export { default as SettingsBig } from './SettingsBig'
17 | export { default as SettingsMedium } from './SettingsMedium'
18 | export { default as Speed } from './Speed'
19 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/Link.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import styled from 'styled-components'
3 | import PropTypes from 'prop-types'
4 |
5 | const A = styled.a`
6 | color: ${(p) => p.theme.colors.main.default};
7 | text-decoration: underline;
8 | transition: color 300ms;
9 | outline: none;
10 | &:hover,
11 | &:focus {
12 | color: ${(p) => p.theme.colors.main.hover};
13 | }
14 | `
15 |
16 | const Link = ({ href, target = '_blank', children, ...props }) => (
17 |
18 | {children}
19 |
20 | )
21 |
22 | Link.propTypes = {
23 | /**
24 | * The link where the user should be redirected
25 | */
26 | href: PropTypes.string,
27 | /**
28 | * How the user should be redirected
29 | */
30 | target: PropTypes.string,
31 | /**
32 | * The text that should be cliquable
33 | */
34 | children: PropTypes.node,
35 | }
36 |
37 | Link.defaultProps = {
38 | href: null,
39 | target: '_blank',
40 | children: null,
41 | }
42 |
43 | export default Link
44 |
--------------------------------------------------------------------------------
/dd-alfred/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "alfred-sg",
3 | "version": "0.0.8",
4 | "description": "Search through the xCompass, Docs & Links powered by Soogle",
5 | "license": "MIT",
6 | "repository": "wxyyxc1992/xCompass",
7 | "author": {
8 | "name": "wxyyxc1992",
9 | "email": "384924552@qq.com",
10 | "url": "https://github.com/wxyyxc1992/xCompass"
11 | },
12 | "engines": {
13 | "node": ">=4"
14 | },
15 | "scripts": {
16 | "test": "xo && ava",
17 | "postinstall": "alfy-init",
18 | "preuninstall": "alfy-cleanup"
19 | },
20 | "files": [
21 | "index.js",
22 | "icon.png",
23 | "info.plist",
24 | "icons",
25 | "lib"
26 | ],
27 | "keywords": [
28 | "alfred",
29 | "workflow",
30 | "xcompass",
31 | "Soogle",
32 | "documentation",
33 | "productivity"
34 | ],
35 | "dependencies": {
36 | "alfy": "^0.7.0",
37 | "algoliasearch": "^3.32.0"
38 | },
39 | "devDependencies": {
40 | "alfy-test": "^0.3.0",
41 | "ava": "*",
42 | "path-exists": "^3.0.0",
43 | "xo": "*"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/cli/calc-sum.ts:
--------------------------------------------------------------------------------
1 | import * as walkSync from "walk-sync";
2 |
3 | // const destDir = "/Users/zhangzixiong/Downloads/张梓雄/替换 5240";
4 | const destDir =
5 | "/Users/zhangzixiong/Library/Containers/com.kingsoft.wpsoffice.mac/Data/Library/Application Support/Kingsoft/WPS Cloud Files/userdata/qing/filecache/27701737/联泰/财务、采购、公共关系/发票/2022/待报销/张梓雄/B3";
6 |
7 | // const destDir =
8 | // "/Users/zhangzixiong/Library/Containers/com.kingsoft.wpsoffice.mac/Data/Library/Application Support/Kingsoft/WPS Cloud Files/userdata/qing/filecache/27701737/联泰/财务、采购、公共关系/发票/2022/待分配";
9 |
10 | const files = walkSync(destDir);
11 | let count = 0;
12 | const totalNum = files.reduce((prev, cur) => {
13 | const fileName = cur.split("/")[0];
14 |
15 | if (!fileName && !fileName.endsWith("pdf")) {
16 | return prev;
17 | }
18 |
19 | count++;
20 |
21 | if (fileName.includes("(")) {
22 | console.log(fileName, Number(fileName.split("-")[0]));
23 | }
24 |
25 | return prev + (Number(fileName.split("-")[0]) || 0);
26 | }, 0);
27 |
28 | console.log(count, totalNum);
29 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/util/markdown/__test__/md.test.ts:
--------------------------------------------------------------------------------
1 | import { LinkType } from './../../../shared/types';
2 | import {
3 | simpleTitle,
4 | titleWithYear,
5 | titleWithYearAndType,
6 | titleWithType
7 | } from './cases';
8 | import { extractInfoFromTitle } from '../md';
9 |
10 | test('simpleTitle', () => {
11 | expect(extractInfoFromTitle(simpleTitle)).toEqual({
12 | year: '未知',
13 | title: 'I am title',
14 | type: LinkType.Article
15 | });
16 | });
17 |
18 | test('titleWithYear', () => {
19 | expect(extractInfoFromTitle(titleWithYear)).toEqual({
20 | year: '2017',
21 | title: 'I am title',
22 | type: LinkType.Article
23 | });
24 | });
25 |
26 | test('titleWithType', () => {
27 | expect(extractInfoFromTitle(titleWithType)).toEqual({
28 | year: '未知',
29 | title: 'I am title',
30 | type: LinkType.Book
31 | });
32 | });
33 |
34 | test('titleWithYearAndType', () => {
35 | expect(extractInfoFromTitle(titleWithYearAndType)).toEqual({
36 | year: '2017',
37 | title: 'I am title',
38 | type: LinkType.Book
39 | });
40 | });
41 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/vscode-sg-translate/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that launches the extension inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "runtimeExecutable": "${execPath}",
13 | "args": [
14 | "--extensionDevelopmentPath=${workspaceFolder}"
15 | ]
16 | },
17 | {
18 | "name": "Extension Tests",
19 | "type": "extensionHost",
20 | "request": "launch",
21 | "runtimeExecutable": "${execPath}",
22 | "args": [
23 | "--extensionDevelopmentPath=${workspaceFolder}",
24 | "--extensionTestsPath=${workspaceFolder}/test"
25 | ]
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/dd-translator-for-coder/vscode-sg-translate/README.md:
--------------------------------------------------------------------------------
1 | # Vscode Google Translate
2 |
3 | [](https://github.com/funkyremi/vscode-google-translate)
4 |  
5 |
6 | Quickly translate selected text right in your code 🚀
7 |
8 | 
9 |
10 | ## Usage
11 |
12 | 1. Select some text to translate
13 | 1. Press `ALT+SHIFT+T`
14 | 1. Select the output languages you want and enjoy 👍
15 |
16 | ## Keyboard shortcut
17 |
18 | If the keyboard shortcut doesn't work for you, you have two options:
19 |
20 | - Open the command palette and manually select 'Translate selection(s)'
21 | - Open your keyboard shortcuts, search for 'Translate selection(s)' and set a new shortcut for this command.
22 |
23 | # Motivation & Credits
24 |
25 | - [vscode-google-translate](https://github.com/funkyremi/vscode-google-translate)
26 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/stories/Sidebar.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Box from 'components/Box'
4 | import Sidebar from 'components/Sidebar'
5 | import { SettingsBig } from 'components/icons'
6 |
7 | export default {
8 | title: 'Components/Sidebar',
9 | component: Sidebar,
10 | parameters: {
11 | layout: 'fullscreen',
12 | },
13 | }
14 |
15 | const Template = (args) => (
16 |
17 |
18 |
19 | )
20 |
21 | export const Default = Template.bind({})
22 | Default.args = {
23 | children: (
24 |
25 | I’m a sidebar
26 |
27 | ),
28 | }
29 |
30 | export const WithIcon = Template.bind({})
31 | WithIcon.args = {
32 | sidebarIcon: ,
33 | children: (
34 |
35 | I’m a sidebar
36 |
37 | ),
38 | }
39 |
40 | export const DefaultClosed = Template.bind({})
41 | DefaultClosed.args = {
42 | visible: false,
43 | children: (
44 |
45 | I’m a sidebar
46 |
47 | ),
48 | }
49 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "toc",
3 | "version": "1.0.0",
4 | "description": "doc sync & index",
5 | "main": "index.js",
6 | "scripts": {
7 | "ts": "ts-node",
8 | "test": "jest"
9 | },
10 | "author": "wxyyxc1992@github",
11 | "license": "ISC",
12 | "dependencies": {
13 | "add": "^2.0.6",
14 | "algoliasearch": "^3.30.0",
15 | "bloom-filters": "^0.5.2",
16 | "bloomfilter": "^0.0.18",
17 | "chalk": "^2.1.0",
18 | "commander": "^2.11.0",
19 | "debug": "^3.1.0",
20 | "fs-extra": "^4.0.2",
21 | "github-api": "^3.0.0",
22 | "html-to-text": "^3.3.0",
23 | "isomorphic-fetch": "^2.2.1",
24 | "markdown-toc": "^1.2.0",
25 | "md5": "^2.2.1",
26 | "meilisearch": "^0.18.1",
27 | "walk-sync": "^0.3.2"
28 | },
29 | "devDependencies": {
30 | "@types/fs-extra": "^5.0.4",
31 | "@types/jest": "^23.3.5",
32 | "@types/md5": "^2.1.33",
33 | "@types/node": "^8.0.31",
34 | "jest": "^23.6.0",
35 | "ts-jest": "^23.10.4",
36 | "ts-node": "^7.0.1",
37 | "typescript": "^3.1.3"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@m-fe/docsify-x",
3 | "version": "0.0.11",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "bin": {
7 | "docsify-x-auto-sidebar": "./bin/docsify-auto-sidebar.js",
8 | "docsify-x-init": "./bin/docsify-init.js",
9 | "generate-x-ts-docs": "./bin/generate-ts-docs.js",
10 | "docsify-sync-to-hugo": "./bin/docsify-sync-to-hugo.js"
11 | },
12 | "scripts": {
13 | "build": "tsc",
14 | "ts": "ts-node"
15 | },
16 | "devDependencies": {
17 | "@m-fe/app-config": "^0.7.1",
18 | "@m-fe/tsconfig": "^0.0.4",
19 | "@types/jest": "^24.0.11",
20 | "@types/mkdirp": "^0.5.2",
21 | "@types/node": "^14.14.9",
22 | "@types/yargs": "^12.0.11",
23 | "typescript": "^3.4.5"
24 | },
25 | "dependencies": {
26 | "@microsoft/api-extractor-model": "^7.0.28",
27 | "@microsoft/ts-command-line": "^4.2.3",
28 | "colors": "^1.3.3",
29 | "fs-extra": "^9.0.1",
30 | "mkdirp": "^0.5.1",
31 | "yargs": "^13.2.2",
32 | "walk-sync": "^0.3.2"
33 | },
34 | "resolutions": {
35 | "@types/react": "*"
36 | }
37 | }
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/.github/workflows/publish-build.yml:
--------------------------------------------------------------------------------
1 | name: publish-build
2 | on:
3 | release:
4 | types: [released]
5 |
6 | jobs:
7 | build-project:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v3
11 | - name: Setup node and cache
12 | uses: actions/setup-node@v3
13 | with:
14 | node-version: 16
15 | cache: "yarn"
16 | cache-dependency-path: yarn.lock
17 | - name: Check release validity
18 | run: sh .github/scripts/check-release.sh
19 | - name: Install project dependencies
20 | run: yarn install
21 | - name: Build project
22 | run: yarn build
23 | - name: Create ZIP folder
24 | uses: thedoctor0/zip-release@master
25 | with:
26 | filename: 'build.zip'
27 | directory: 'build'
28 | - name: Upload build to release
29 | uses: svenstaro/upload-release-action@v2
30 | with:
31 | repo_token: ${{ secrets.GITHUB_TOKEN }}
32 | file: build/build.zip
33 | tag: ${{ github.ref }}
34 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/nodes/DocLinkAnchor.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import {
5 | DocNode,
6 | DocNodeContainer,
7 | IDocNodeContainerParameters
8 | } from '@microsoft/tsdoc';
9 | import { CustomDocNodeKind } from './CustomDocNodeKind';
10 |
11 | /**
12 | * Constructor parameters for {@link DocEmphasisSpan}.
13 | */
14 | export interface IDocLinkAnchorParameters extends IDocNodeContainerParameters {
15 | id: string;
16 | }
17 |
18 | /**
19 | * Represents a span of text that is styled with CommonMark emphasis (italics), strong emphasis (boldface),
20 | * or both.
21 | */
22 | export class DocLinkAnchor extends DocNodeContainer {
23 | public readonly id: string;
24 |
25 | public constructor(parameters: IDocLinkAnchorParameters) {
26 | super(parameters);
27 | this.id = parameters.id;
28 | }
29 |
30 | /** @override */
31 | public get kind(): string {
32 | return CustomDocNodeKind.LinkAnchor;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/nodes/DocTableCell.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import {
5 | IDocNodeParameters,
6 | DocNode,
7 | DocSection
8 | } from '@microsoft/tsdoc';
9 | import { CustomDocNodeKind } from './CustomDocNodeKind';
10 |
11 | /**
12 | * Constructor parameters for {@link DocTableCell}.
13 | */
14 | export interface IDocTableCellParameters extends IDocNodeParameters {
15 | }
16 |
17 | /**
18 | * Represents table cell, similar to an HTML `` element.
19 | */
20 | export class DocTableCell extends DocNode {
21 | public readonly content: DocSection;
22 |
23 | public constructor(parameters: IDocTableCellParameters, sectionChildNodes?: ReadonlyArray) {
24 | super(parameters);
25 |
26 | this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);
27 | }
28 |
29 | /** @override */
30 | public get kind(): string {
31 | return CustomDocNodeKind.TableCell;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/EmptyView.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import Button from 'components/Button'
5 | import Box from 'components/Box'
6 |
7 | const EmptyView = ({ buttonLink, children, ...props }) => (
8 |
18 | {children}
19 |
27 | Need help?
28 |
29 |
30 | )
31 |
32 | EmptyView.propTypes = {
33 | /**
34 | * External link
35 | */
36 | buttonLink: PropTypes.string,
37 | /**
38 | * Children to be displayed
39 | */
40 | children: PropTypes.node,
41 | }
42 |
43 | EmptyView.defaultProps = {
44 | buttonLink: null,
45 | children: null,
46 | }
47 |
48 | export default EmptyView
49 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/cypress/e2e/test-no-api-key-required.cy.js:
--------------------------------------------------------------------------------
1 | const WAITING_TIME = Cypress.env('waitingTime')
2 |
3 | describe(`Test no API key required`, () => {
4 | before(() => {
5 | cy.deleteAllIndexes()
6 | cy.wait(WAITING_TIME)
7 | })
8 |
9 | beforeEach(() => {
10 | cy.visit('/')
11 | })
12 |
13 | it('Should visit the dashboard', () => {
14 | cy.url().should('match', /\//)
15 | })
16 |
17 | it('Should display the help cards view', () => {
18 | cy.contains(
19 | 'This dashboard will help you check the search results with ease.'
20 | )
21 | cy.contains('Set your API key (optional)')
22 | cy.contains('Select an index')
23 | })
24 |
25 | it('Should display a message telling that no api key is required', () => {
26 | cy.get('span').contains('Api Key').parent().click()
27 | cy.get('div[aria-label=settings-api-key]').within(() => {
28 | cy.contains('Enter your admin API key (optional)')
29 | cy.contains(
30 | 'You haven’t set an API key yet, if you want to set one you can read the documentation'
31 | )
32 | })
33 | })
34 | })
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 王下邀月熊(Chevalier)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-alfred/test/test-search.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | const algoliasearch = require('algoliasearch');
3 |
4 | const client = algoliasearch('35UOMI84K6', '632bd8009b7260d30a352e9d9b14d552');
5 | const docIndex = client.initIndex('doc');
6 | const linkIndex = client.initIndex('link');
7 |
8 | docIndex.setSettings({
9 | unretrievableAttributes: ['content']
10 | });
11 |
12 | const matcher = (input = 'REST') => {
13 | const tokens = input
14 | .trim()
15 | .toLowerCase()
16 | .split(' ');
17 |
18 | const isLink = tokens[0] === 'link';
19 |
20 | let index = isLink ? linkIndex : docIndex;
21 |
22 | index.search(
23 | {
24 | query: tokens.join(' '),
25 | hitsPerPage: 25
26 | },
27 | function(err, content) {
28 | if (err) throw err;
29 |
30 | console.table(
31 | (content.hits || []).map(hit => ({
32 | title: hit.fileName,
33 | autocomplete: hit.fileName,
34 | subtitle: hit.repo,
35 | keywords: hit.categories,
36 | arg: hit.href,
37 | quicklookurl: hit.href,
38 | icon: {
39 | path: `./icons/${isLink ? 'link' : 'doc'}.png`
40 | }
41 | }))
42 | );
43 | }
44 | );
45 | };
46 |
47 | matcher();
48 |
--------------------------------------------------------------------------------
/picgo-plugin-ngte-migrater/License:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Molunerfinn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/DocumentMedium.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgDocumentMedium = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
21 |
22 | )
23 | export default SvgDocumentMedium
24 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019-2022 Meili SAS
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 王下邀月熊(Chevalier)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/svg/invert.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import styled from 'styled-components'
3 |
4 | export default () => (
5 |
6 |
11 |
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/vscode-sg-translate/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 HookyQR
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/dd-docsify-x/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 ng-tech-edu: Next generation technology education(NGTE)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/cli/sync-hugo.ts:
--------------------------------------------------------------------------------
1 | import { generateSummary } from '../service/summary/generateSummary';
2 | import repos from '../config/repo-config';
3 | const os = require('os');
4 | const program = require('commander');
5 | const fs = require('fs-extra');
6 |
7 | program
8 | .version('0.0.1')
9 | .option(
10 | '-d, --directory [directory]',
11 | '工作目录,默认为当前目录',
12 | os.homedir() + '/Desktop'
13 | )
14 | .option('-l, --language [language]', '指定生成的语言版本 [zh/en]', 'zh');
15 |
16 | program.parse(process.argv);
17 |
18 | const targetDir = '/Users/apple/Workspace/Github/NGTE/ngte-docs';
19 |
20 | const skippedRepos = [
21 | 'Awesome-Lists',
22 | 'Awesome-CheatSheets',
23 | 'Awesome-CS-Books'
24 | ];
25 |
26 | (async () => {
27 | let summary = '# Summary \n';
28 |
29 | for (let repoName of Object.keys(repos)) {
30 | if (skippedRepos.indexOf(repoName) > -1) {
31 | console.log(repoName);
32 | continue;
33 | }
34 |
35 | const s = await generateSummary(repoName, targetDir);
36 |
37 | summary += s;
38 | }
39 |
40 | await fs.remove(`${targetDir}/SUMMARY.md`);
41 | await fs.outputFile(`${targetDir}/SUMMARY.md`, summary);
42 | })();
43 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Alessio Forte
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/cli/generate-summary.ts:
--------------------------------------------------------------------------------
1 | import { generateSummary } from '../service/summary/generateSummary';
2 | import repos from '../config/repo-config';
3 | const os = require('os');
4 | const program = require('commander');
5 | const fs = require('fs-extra');
6 |
7 | program
8 | .version('0.0.1')
9 | .option(
10 | '-d, --directory [directory]',
11 | '工作目录,默认为当前目录',
12 | os.homedir() + '/Desktop'
13 | )
14 | .option('-l, --language [language]', '指定生成的语言版本 [zh/en]', 'zh');
15 |
16 | program.parse(process.argv);
17 |
18 | const targetDir = '/Users/apple/Workspace/Github/NGTE/ngte-docs';
19 |
20 | const skippedRepos = [
21 | 'Awesome-Lists',
22 | 'Awesome-CheatSheets',
23 | 'Awesome-CS-Books'
24 | ];
25 |
26 | (async () => {
27 | let summary = '# Summary \n';
28 |
29 | for (let repoName of Object.keys(repos)) {
30 | if (skippedRepos.indexOf(repoName) > -1) {
31 | console.log(repoName);
32 | continue;
33 | }
34 |
35 | const s = await generateSummary(repoName, targetDir);
36 |
37 | summary += s;
38 | }
39 |
40 | await fs.remove(`${targetDir}/SUMMARY.md`);
41 | await fs.outputFile(`${targetDir}/SUMMARY.md`, summary);
42 | })();
43 |
--------------------------------------------------------------------------------
/dd-alfred/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Sam Verschueren (github.com/SamVerschueren)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/DocumentBig.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgDocumentBig = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
21 |
22 | )
23 | export default SvgDocumentBig
24 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/ScrollToTop.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Color from 'color'
3 | import styled from 'styled-components'
4 |
5 | import IconButton from 'components/IconButton'
6 | import ArrowDownIcon from 'components/icons/ArrowDown'
7 |
8 | const ArrowDown = styled(ArrowDownIcon)`
9 | transform: rotate(180deg);
10 | color: white;
11 | `
12 |
13 | const ScrollButton = styled(IconButton)`
14 | position: fixed;
15 | bottom: 40px;
16 | right: 40px;
17 | background-color: ${(p) => Color(p.theme.colors.gray[2]).alpha(0.4)};
18 | width: 40px;
19 | height: 40px;
20 | border-radius: 50%;
21 | display: flex;
22 | align-items: center;
23 | justify-content: center;
24 | transition: background-color 300ms;
25 |
26 | &:hover,
27 | &:focus {
28 | background-color: ${(p) => Color(p.theme.colors.gray[4])};
29 | }
30 | `
31 |
32 | const ScrollToTop = () => {
33 | const scrollToTop = () => {
34 | window.scroll({ top: 0, behavior: 'smooth' })
35 | }
36 |
37 | return (
38 | scrollToTop()} aria-label="scroll to top">
39 |
40 |
41 | )
42 | }
43 |
44 | export default ScrollToTop
45 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/cli/MarkdownAction.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';
5 | import { BaseAction } from './BaseAction';
6 | import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';
7 | import { ApiModel } from '@microsoft/api-extractor-model';
8 |
9 | export class MarkdownAction extends BaseAction {
10 | constructor(parser: ApiDocumenterCommandLine) {
11 | super({
12 | actionName: 'markdown',
13 | summary: 'Generate documentation as Markdown files (*.md)',
14 | documentation: 'Generates API documentation as a collection of files in'
15 | + ' Markdown format, suitable for example for publishing on a GitHub site.'
16 | });
17 | }
18 |
19 | protected onExecute(): Promise { // override
20 | const apiModel: ApiModel = this.buildApiModel();
21 | const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter(apiModel);
22 | markdownDocumenter.generateFiles(this.outputFolder);
23 | return Promise.resolve();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/app/app.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { connect } from 'react-redux'
3 | import LanguagesBar from './languages-bar'
4 | import Response from './response'
5 | import { setMainWindowSize } from './utils'
6 | import Textarea from './textarea'
7 | import Suggestions from './suggestions'
8 | import ErrorMessage from './error-message'
9 | import DidYouMean from './did-you-mean'
10 |
11 | class App extends Component {
12 |
13 | componentDidUpdate() {
14 | setTimeout(() => setMainWindowSize(), 300)
15 | }
16 |
17 | render() {
18 | return (
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | )
30 | }
31 | }
32 |
33 | const mapStateToProps = ({ dropdown, translate, error }) => ({ dropdown, translate, error })
34 |
35 | export default connect(mapStateToProps)(App)
36 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/Speed.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgSpeed = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
19 |
20 | )
21 | export default SvgSpeed
22 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/cypress/e2e/test-api-key-query-param.cy.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable cypress/no-unnecessary-waiting */
2 | const API_KEY = Cypress.env('apiKey')
3 | const WAITING_TIME = Cypress.env('waitingTime')
4 |
5 | describe(`Test API key required with query params`, () => {
6 | before(() => {
7 | cy.deleteAllIndexes()
8 |
9 | cy.wait(WAITING_TIME)
10 | cy.createIndex('movies')
11 | cy.wait(WAITING_TIME)
12 | cy.fixture('movies.json').then((movies) => {
13 | cy.addDocuments('movies', movies)
14 | cy.wait(WAITING_TIME)
15 | })
16 | })
17 |
18 | beforeEach(() => {
19 | cy.visit(`/?api_key=${API_KEY}`)
20 | })
21 |
22 | it('Should display the movies', () => {
23 | cy.get('ul')
24 | .children()
25 | .should(($p) => {
26 | expect($p).to.have.length(20)
27 | })
28 | })
29 |
30 | it('Should have the api key written in the modal', () => {
31 | // Test if the query parameter is written in the modal
32 | // meaning it is added in the local storage
33 | cy.get('span').contains('Api Key').parent().click()
34 | cy.get('div[aria-label=settings-api-key]').within(() => {
35 | cy.get('input[name="apiKey"]').should('have.value', API_KEY)
36 | })
37 | })
38 | })
39 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/nodes/DocEmphasisSpan.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import {
5 | DocNode,
6 | DocNodeContainer,
7 | IDocNodeContainerParameters
8 | } from '@microsoft/tsdoc';
9 | import { CustomDocNodeKind } from './CustomDocNodeKind';
10 |
11 | /**
12 | * Constructor parameters for {@link DocEmphasisSpan}.
13 | */
14 | export interface IDocEmphasisSpanParameters extends IDocNodeContainerParameters {
15 | bold?: boolean;
16 | italic?: boolean;
17 | }
18 |
19 | /**
20 | * Represents a span of text that is styled with CommonMark emphasis (italics), strong emphasis (boldface),
21 | * or both.
22 | */
23 | export class DocEmphasisSpan extends DocNodeContainer {
24 | public readonly bold: boolean;
25 | public readonly italic: boolean;
26 |
27 | public constructor(parameters: IDocEmphasisSpanParameters, children?: DocNode[]) {
28 | super(parameters, children);
29 | this.bold = !!parameters.bold;
30 | this.italic = !!parameters.italic;
31 | }
32 |
33 | /** @override */
34 | public get kind(): string {
35 | return CustomDocNodeKind.EmphasisSpan;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/nodes/DocNoteBox.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import {
5 | IDocNodeParameters,
6 | DocNode,
7 | DocSection
8 | } from '@microsoft/tsdoc';
9 | import { CustomDocNodeKind } from './CustomDocNodeKind';
10 |
11 | /**
12 | * Constructor parameters for {@link DocNoteBox}.
13 | */
14 | export interface IDocNoteBoxParameters extends IDocNodeParameters {
15 | }
16 |
17 | /**
18 | * Represents a note box, which is typically displayed as a bordered box containing informational text.
19 | */
20 | export class DocNoteBox extends DocNode {
21 | public readonly content: DocSection;
22 |
23 | public constructor(parameters: IDocNoteBoxParameters, sectionChildNodes?: ReadonlyArray) {
24 | super(parameters);
25 | this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);
26 | }
27 |
28 | /** @override */
29 | public get kind(): string {
30 | return CustomDocNodeKind.NoteBox;
31 | }
32 |
33 | /** @override */
34 | protected onGetChildNodes(): ReadonlyArray {
35 | return [this.content];
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/stories/Select.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Select from 'components/Select'
4 | import NoSelectOption from 'components/NoSelectOption'
5 | import { Indexes } from 'components/icons'
6 |
7 | export default {
8 | title: 'Components/Select',
9 | component: Select,
10 | }
11 |
12 | const options = [
13 | {
14 | uid: 'pokemon',
15 | stats: {
16 | numberOfDocuments: 809,
17 | },
18 | },
19 | {
20 | uid: 'movies',
21 | stats: {
22 | numberOfDocuments: 19546,
23 | },
24 | },
25 | ]
26 |
27 | const Template = (args) => {
28 | const [currentOption, setCurrentOption] = React.useState()
29 | return (
30 |
35 | )
36 | }
37 |
38 | export const Default = Template.bind({})
39 | Default.args = {
40 | options,
41 | }
42 |
43 | export const WithIcon = Template.bind({})
44 | WithIcon.args = {
45 | options,
46 | icon: ,
47 | }
48 |
49 | export const WithoutOptions = Template.bind({})
50 | WithoutOptions.args = {
51 | options: null,
52 | icon: ,
53 | noOptionComponent: ,
54 | }
55 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "env": {
4 | "browser": true,
5 | "es2021": true
6 | },
7 | "parserOptions": {
8 | "ecmaVersion": 2020
9 | },
10 | "extends": [
11 | "react-app",
12 | "airbnb",
13 | "plugin:jsx-a11y/recommended",
14 | "plugin:cypress/recommended",
15 | "eslint-config-prettier"
16 | ],
17 | "plugins": ["jsx-a11y", "prettier"],
18 | "settings": {
19 | "import/resolver": {
20 | "node": {
21 | "paths": ["src"]
22 | }
23 | }
24 | },
25 | "rules": {
26 | "semi": 0,
27 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
28 | "prettier/prettier": [
29 | "error",
30 | {
31 | "semi": false
32 | }
33 | ],
34 | "react/prop-types": 0,
35 | "jsx-indent-props": 0,
36 | "react/jsx-props-no-spreading": 0,
37 | "react/no-array-index-key": 0,
38 | "no-underscore-dangle": 0,
39 | "react-hooks/exhaustive-deps": 0,
40 | "react/function-component-definition": [
41 | 2,
42 | { "namedComponents": "arrow-function" }
43 | ],
44 | "react/no-arrow-function-lifecycle": 0,
45 | "react/no-invalid-html-attribute": 0,
46 | "react/no-unused-class-component-methods": 0
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by .ignore support plugin (hsz.mobi)
3 | ### Node template
4 | # Logs
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | # Runtime data
12 | pids
13 | *.pid
14 | *.seed
15 | *.pid.lock
16 |
17 | # Directory for instrumented libs generated by jscoverage/JSCover
18 | lib-cov
19 |
20 | # Coverage directory used by tools like istanbul
21 | coverage
22 |
23 | # nyc test coverage
24 | .nyc_output
25 |
26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27 | .grunt
28 |
29 | # Bower dependency directory (https://bower.io/)
30 | bower_components
31 |
32 | # node-waf configuration
33 | .lock-wscript
34 |
35 | # Compiled binary addons (http://nodejs.org/api/addons.html)
36 | build/Release
37 |
38 | # Dependency directories
39 | node_modules/
40 | jspm_packages/
41 |
42 | # Typescript v1 declaration files
43 | typings/
44 |
45 | # Optional npm cache directory
46 | .npm
47 |
48 | # Optional eslint cache
49 | .eslintcache
50 |
51 | # Optional REPL history
52 | .node_repl_history
53 |
54 | # Output of 'npm pack'
55 | *.tgz
56 |
57 | # Yarn Integrity file
58 | .yarn-integrity
59 |
60 | # dotenv environment variables file
61 | .env
62 |
63 | dist/
64 | /src/config/private.ts
65 | /toc.md
66 |
--------------------------------------------------------------------------------
/dd-coding-helper/vscode-extension/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run VSCode Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "runtimeExecutable": "${execPath}/vscode-extension",
13 | "args": [
14 | "--extensionDevelopmentPath=${workspaceFolder}/vscode-extension"
15 | ],
16 | "outFiles": [
17 | "${workspaceFolder}/vscode-extension/out/**/*.js"
18 | ],
19 | "preLaunchTask": "npm: watch"
20 | },
21 | {
22 | "name": "VSCode Extension Tests",
23 | "type": "extensionHost",
24 | "request": "launch",
25 | "runtimeExecutable": "${execPath}/vscode-extension",
26 | "args": [
27 | "--extensionDevelopmentPath=${workspaceFolder}/vscode-extension",
28 | "--extensionTestsPath=${workspaceFolder}/vscode-extension/out/test/suite/index"
29 | ],
30 | "outFiles": [
31 | "${workspaceFolder}/vscode-extension/out/test/**/*.js"
32 | ],
33 | "preLaunchTask": "npm: watch"
34 | }
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/GithubLogo.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgGithubLogo = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
15 |
16 | )
17 | export default SvgGithubLogo
18 |
--------------------------------------------------------------------------------
/picgo-plugin-ngte-migrater/dist/i18n/en.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.en = void 0;
4 | /* eslint-disable no-template-curly-in-string */
5 | /* eslint-disable comma-dangle */
6 | exports.en = {
7 | PIC_MIGRATER_CHOOSE_FILE: 'Choose File',
8 | PIC_MIGRATER_CHOOSE_FOLDER: 'Choose Folder',
9 | PIC_MIGRATER_PROCESSING: 'Migating...',
10 | PIC_MIGRATER_BE_PATIENT: 'Please be patient',
11 | PIC_MIGRATER_SUCCESS: 'Migate done',
12 | PIC_MIGRATER_FAIL: '${file} migrate fail',
13 | PIC_MIGRATER_FAIL_TIP: 'For pictures without successful migration, please check if the URL exists or the picBed configuration problem',
14 | PIC_MIGRATER_SUCCESS_TIP: 'Pictures migrate successfully: ${success}, failed: ${fail}',
15 | // config
16 | PIC_MIGRATER_CONFIG_TIP_TITLE: 'Please configure first',
17 | PIC_MIGRATER_CONFIG_TIP_BODY: 'Click Config plugin, then configure the plugin to be able to use',
18 | PIC_MIGRATER_CONFIG_NEW_FILE_SUFFIX: 'New file name suffix',
19 | PIC_MIGRATER_CONFIG_INCLUDE: 'Only include',
20 | PIC_MIGRATER_CONFIG_EXCLUDE: 'Only exclude',
21 | PIC_MIGRATER_CONFIG_OLD_CONTENT_WRITE_TO_NEW_FILE: 'Old content write to new file',
22 | PIC_MIGRATER_CONFIG_TIPS: 'Please enter the path or URL'
23 | };
24 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/app/css/app.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --headersColor: rgba(26, 26, 26, 0.9);
3 | --tinyLineColor: rgba(85, 85, 85, 0.3);
4 | --groundColor: rgba(42, 42, 42, 0.9);
5 | }
6 |
7 | body {
8 | margin: 0;
9 | padding: 0;
10 | width: 680px;
11 | position: fixed;
12 | overflow: hidden;
13 | }
14 |
15 | #input,
16 | #autocomplete {
17 | box-sizing: border-box;
18 | padding: 18px 44px 18px 18px;
19 | width: 100%;
20 | height: 60px;
21 | max-height: 300px;
22 | font-size: 18px;
23 | border: 0;
24 | background: none;
25 | resize: none;
26 | color: white;
27 | }
28 |
29 | #autocomplete {
30 | position: absolute;
31 | top: 25px;
32 | color: #555;
33 | z-index: 0
34 | }
35 |
36 | #input:focus,
37 | #autocomplete:focus {
38 | outline: none;
39 | }
40 |
41 | .inputContainer {
42 | position: relative;
43 | display: flex;
44 | overflow: hidden;
45 | }
46 |
47 | .speech {
48 | right: 0;
49 | position: absolute;
50 | padding: 18px 18px 18px 0;
51 | }
52 |
53 | .sgt {
54 | padding: 3px 18px;
55 | border-top: 1px solid var(--tinyLineColor);
56 | color: #aaa;
57 | font-size: 11px;
58 | cursor: default;
59 | line-height: 1.2em;
60 | }
61 |
62 | .on-sgt {
63 | background: var(--headersColor);
64 | }
65 |
66 | .sgt div:first-child {
67 | color: white;
68 | }
69 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/markdown/test/__snapshots__/CustomMarkdownEmitter.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`render Markdown from TSDoc 1`] = `
4 | StringBuilder {
5 | "_chunks": Array [
6 | "
7 | ## Simple bold test
8 |
9 | This is a bold word.
10 |
11 | ## All whitespace bold
12 |
13 |
14 |
15 | ## Newline bold
16 |
17 | line 1 line 2
18 |
19 | ## Newline bold with spaces
20 |
21 | line 1 line 2 line 3
22 |
23 | ## Adjacent bold regions
24 |
25 | one two three four non-boldfive
26 |
27 | ## Adjacent to other characters
28 |
29 | [a link](./index.md)bold non-boldmore-non-bold
30 |
31 | ## Bad characters
32 |
33 | \\\\*one\\\\*two\\\\* three\\\\*four
34 |
35 | ## Characters that should be escaped
36 |
37 | Double-encoded JSON: \\"{ \\\\\\\\\\"A\\\\\\\\\\": 123}\\"
38 |
39 | HTML chars: <script>alert(\\"\\\\[You\\\\] are \\\\#1!\\");</script>
40 |
41 | HTML escape: "
42 |
43 | 3 or more hyphens: - -- \\\\-\\\\-\\\\- \\\\-\\\\-\\\\-- \\\\-\\\\-\\\\--- \\\\-\\\\-\\\\-\\\\-\\\\-\\\\-
44 |
45 | ## HTML tag
46 |
47 | bold
48 |
49 | ## Table
50 |
51 | | Header 1 | Header 2 |
52 | | --- | --- |
53 | | Cell 1 | Cell 2 |
54 |
55 | ",
56 | ],
57 | }
58 | `;
59 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/cypress/support/commands.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 | const { MeiliSearch: Meilisearch } = require('meilisearch')
3 |
4 | const { apiKey, host } = Cypress.env()
5 |
6 | Cypress.Commands.add('deleteAllIndexes', async () => {
7 | try {
8 | const client = new Meilisearch({
9 | host,
10 | apiKey,
11 | })
12 | const { results: indexes } = await client.getIndexes()
13 | indexes.forEach(async (index) => {
14 | const task = await client.deleteIndex(index.uid)
15 | await client.waitForTask(task.taskUid)
16 | })
17 | } catch (e) {
18 | console.log({ e })
19 | }
20 | })
21 |
22 | Cypress.Commands.add('createIndex', async (uid) => {
23 | try {
24 | const client = new Meilisearch({
25 | host,
26 | apiKey,
27 | })
28 | const task = await client.createIndex(uid)
29 | await client.waitForTask(task.taskUid)
30 | } catch (e) {
31 | console.log({ e })
32 | }
33 | })
34 |
35 | Cypress.Commands.add('addDocuments', async (uid, documents) => {
36 | try {
37 | const client = new Meilisearch({
38 | host,
39 | apiKey,
40 | })
41 | const index = await client.getIndex(uid)
42 | const task = await index.addDocuments(documents)
43 | await client.waitForTask(task.taskUid)
44 | } catch (e) {
45 | console.log({ e })
46 | }
47 | })
48 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/GlobalStyle.js:
--------------------------------------------------------------------------------
1 | import { createGlobalStyle } from 'styled-components'
2 |
3 | const GlobalStyle = createGlobalStyle`
4 | html, body {
5 | margin: 0;
6 | }
7 | * {
8 | font-family: 'Work Sans';
9 | box-sizing: border-box;
10 | }
11 |
12 | mark, ::selection {
13 | background-color: ${(p) => p.theme.colors.main.light};
14 | }
15 |
16 | @font-face {
17 | font-family: 'Work Sans';
18 | src: url("fonts/Work_Sans/light.woff2") format("woff2");
19 | font-weight: 300;
20 | font-style: normal;
21 | }
22 |
23 | @font-face {
24 | font-family: 'Work Sans';
25 | src: url("fonts/Work_Sans/regular.woff2") format("woff2");
26 | font-weight: 400;
27 | font-style: normal;
28 | }
29 |
30 | @font-face {
31 | font-family: 'Work Sans';
32 | src: url("fonts/Work_Sans/medium.woff2") format("woff2");
33 | font-weight: 500;
34 | font-style: normal;
35 | }
36 |
37 | @font-face {
38 | font-family: 'Work Sans';
39 | src: url("fonts/Work_Sans/bold.woff2") format("woff2");
40 | font-weight: 700;
41 | font-style: normal;
42 | }
43 |
44 | @font-face {
45 | font-family: 'Barlow';
46 | src: url("fonts/Barlow/regular.woff2") format("woff2");
47 | font-weight: 400;
48 | font-style: normal;
49 | }
50 |
51 | `
52 |
53 | export default GlobalStyle
54 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/github_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/vendor/_docsify/edit-on-github.js:
--------------------------------------------------------------------------------
1 | (function(win) {
2 | win.EditOnGithubPlugin = {};
3 |
4 | function create(opts) {
5 | if (!opts.repo) throw new Error('Must specify at least repo dir');
6 |
7 | opts = opts || {};
8 | opts.title = opts.title || 'Edit on github';
9 | opts.docDir = opts.docDir == null ? 'docs' : opts.docDir;
10 |
11 | function getEditUrl(docName, frontmatter) {
12 | if (frontmatter && frontmatter.noEdit) return null;
13 | let url = [];
14 | if (frontmatter && frontmatter.originalPath) {
15 | url = [opts.repo, 'edit/master', frontmatter.originalPath];
16 | } else {
17 | url = [opts.repo, 'edit/master', opts.docDir, docName];
18 | }
19 | return url.filter(item => item).join('/');
20 | }
21 |
22 | return function(hook, vm) {
23 | hook.afterEach(function(html) {
24 | let editLink = getEditUrl(vm.route.file, vm.frontmatter);
25 | var header = [
26 | '',
33 | ].join('');
34 | return editLink ? header + html : html;
35 | });
36 | };
37 | }
38 |
39 | win.EditOnGithubPlugin.create = create;
40 | })(window);
41 |
--------------------------------------------------------------------------------
/dd-docsify-x/tools/src/api-documenter/nodes/DocHeading.ts:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2 | // See LICENSE in the project root for license information.
3 |
4 | import {
5 | IDocNodeParameters,
6 | DocNode
7 | } from '@microsoft/tsdoc';
8 | import { CustomDocNodeKind } from './CustomDocNodeKind';
9 |
10 | /**
11 | * Constructor parameters for {@link DocHeading}.
12 | */
13 | export interface IDocHeadingParameters extends IDocNodeParameters {
14 | title: string;
15 | level?: number;
16 | }
17 |
18 | /**
19 | * Represents a section header similar to an HTML `` or `` element.
20 | */
21 | export class DocHeading extends DocNode {
22 | public readonly title: string;
23 | public readonly level: number;
24 |
25 | /**
26 | * Don't call this directly. Instead use {@link TSDocParser}
27 | * @internal
28 | */
29 | public constructor(parameters: IDocHeadingParameters) {
30 | super(parameters);
31 | this.title = parameters.title;
32 | this.level = parameters.level !== undefined ? parameters.level : 1;
33 |
34 | if (this.level < 1 || this.level > 5) {
35 | throw new Error('IDocHeadingParameters.level must be a number between 1 and 5');
36 | }
37 | }
38 |
39 | /** @override */
40 | public get kind(): string {
41 | return CustomDocNodeKind.Heading;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/app/store.js:
--------------------------------------------------------------------------------
1 | import { createStore, combineReducers, applyMiddleware, compose } from 'redux'
2 | import createSagaMiddleware from 'redux-saga'
3 | import * as reducers from './reducers'
4 |
5 | const settings = require('electron-settings')
6 |
7 | const state = {
8 | langs: {
9 | from: 'en',
10 | to: 'it'
11 | },
12 | speed: {
13 | from: false,
14 | to: false
15 | },
16 | fromBar: {
17 | from1: 'en',
18 | from2: 'it',
19 | from3: 'es'
20 | },
21 | toBar: {
22 | to1: 'it',
23 | to2: 'en',
24 | to3: 'es'
25 | },
26 | fromActive: [true, false, false],
27 | toActive: [true, false, false]
28 | }
29 |
30 | var initialState = settings.has('settings') ? settings.get('settings') : state
31 |
32 | const sagaMiddleware = createSagaMiddleware()
33 | const middleware = [
34 | sagaMiddleware
35 | ]
36 |
37 | const allReducers = combineReducers(reducers)
38 |
39 | const composeEnhancers =
40 | typeof window === 'object' &&
41 | window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
42 | window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
43 | }) : compose;
44 |
45 | const enhancer = composeEnhancers(
46 | applyMiddleware(...middleware),
47 | );
48 |
49 | const store = createStore(
50 | allReducers,
51 | initialState,
52 | enhancer
53 | )
54 |
55 | store.runSaga = sagaMiddleware.run
56 |
57 | export default store
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/Key.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgKey = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
23 |
24 | )
25 | export default SvgKey
26 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/document_big.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/cli/generate-gitbook.ts:
--------------------------------------------------------------------------------
1 | import { generateToc } from "../service/toc/generateTocFromLocal";
2 | import repos from "../config/repo-config";
3 | import * as fs from "fs-extra";
4 | const os = require("os");
5 | const program = require("commander");
6 |
7 | program
8 | .version("0.0.1")
9 | .option("-r, --repo [repo]", "仓库名", "Web-Series")
10 | .option(
11 | "-d, --directory [directory]",
12 | "工作目录,默认为当前目录",
13 | os.homedir() + "/Desktop"
14 | )
15 | .option("-l, --language [language]", "指定生成的语言版本 [zh/en]", "zh");
16 |
17 | program.parse(process.argv);
18 |
19 | (async () => {
20 | for (let repoName of Object.keys(repos)) {
21 | try {
22 | await fs.remove(`${repos[repoName].localPath}/.meta/SUMMARY.md`);
23 |
24 | await fs.remove(`${repos[repoName].localPath}/.gitbook.yaml`);
25 |
26 | let summary = "# Summary \n";
27 |
28 | const s = await generateToc(repoName);
29 |
30 | summary += s;
31 |
32 | await fs.outputFile(
33 | `${repos[repoName].localPath}/.meta/SUMMARY.md`,
34 | summary
35 | );
36 |
37 | await fs.outputFile(
38 | `${repos[repoName].localPath}/.gitbook.yaml`,
39 | `root: ./
40 |
41 | structure:
42 | readme: ./README.md
43 | summary: ./.meta/SUMMARY.md
44 | `
45 | );
46 |
47 | console.log(`${repoName} - FINISHED`);
48 | } catch (e) {
49 | console.error(e);
50 | }
51 | }
52 | })();
53 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/components/checkbox.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import styled from 'styled-components'
3 |
4 | export const Checkbox = props => {
5 |
6 | const setValue = () => {
7 | props.onClick()
8 | }
9 |
10 | return (
11 | setValue()}
14 | >
15 |
19 |
20 |
21 |
22 | )
23 | }
24 |
25 | const Box = styled.div`
26 | width: 16px;
27 | height: 16px;
28 | border-radius: 3px;
29 | border: 1px solid #2a2a2a;
30 | background: ${props => props.check ? '#2182BD' : '#888'};
31 | & svg {
32 | fill: #fff;
33 | margin: 4px 3px;
34 | display: ${props => props.check ? 'block' : 'none'}
35 | }
36 | `
37 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/public/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/document_medium.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/vscode-sg-translate/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vscode-google-translate",
3 | "displayName": "Vscode Google Translate",
4 | "description": "Translate text right in your code",
5 | "publisher": "funkyremi",
6 | "version": "1.1.5",
7 | "icon": "icon.png",
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/funkyremi/vscode-google-translate.git"
11 | },
12 | "engines": {
13 | "vscode": "^1.29.0"
14 | },
15 | "categories": [
16 | "Formatters"
17 | ],
18 | "activationEvents": [
19 | "onCommand:extension.translateText"
20 | ],
21 | "main": "./extension",
22 | "contributes": {
23 | "commands": [
24 | {
25 | "command": "extension.translateText",
26 | "title": "Translate selection(s)"
27 | }
28 | ]
29 | },
30 | "keybindings": [
31 | {
32 | "key": "alt+shit+t",
33 | "command": "extension.translateText"
34 | }
35 | ],
36 | "scripts": {
37 | "postinstall": "node ./node_modules/vscode/bin/install",
38 | "test": "node ./node_modules/vscode/bin/test"
39 | },
40 | "devDependencies": {
41 | "@types/mocha": "^5.2.5",
42 | "@types/node": "^10.12.10",
43 | "eslint": "^4.11.0",
44 | "vscode": "^1.1.21"
45 | },
46 | "dependencies": {
47 | "google-translate-query": "^2.4.4"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/dist/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "transee",
3 | "productName": "Transee",
4 | "version": "1.2.6",
5 | "description": "Simple and useful tool for quick translation",
6 | "main": "./main/main.js",
7 | "license": "MIT",
8 | "author": "Alessio Forte",
9 | "scripts": {
10 | "start": "electron ./main/main.js",
11 | "build:mac": "electron-builder --mac",
12 | "build:win": "electron-builder --win",
13 | "build": "electron-builder --mac --win"
14 | },
15 | "repository": "https://github.com/alessioforte/transee.git",
16 | "homepage": "https://alessioforte.github.io/transee/",
17 | "build": {
18 | "productName": "Transee",
19 | "appId": "com.alessioforte.transee",
20 | "directories": {
21 | "output": "build"
22 | },
23 | "publish": [
24 | {
25 | "provider": "github",
26 | "owner": "alessioforte",
27 | "repo": "transee"
28 | }
29 | ],
30 | "mac": {
31 | "icon": "assets/transee.icns",
32 | "category": "utility.productivity.reference",
33 | "publish": "github"
34 | },
35 | "win": {
36 | "icon": "assets/transee.ico",
37 | "publish": "github"
38 | }
39 | },
40 | "devDependencies": {
41 | "electron": "^4.0.0",
42 | "electron-builder": "^20.39.0"
43 | },
44 | "dependencies": {
45 | "electron-settings": "^3.2.0",
46 | "electron-updater": "^4.0.6",
47 | "internet-available": "^1.0.0"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/meilisearch_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/KeyBig.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgKeyBig = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
23 |
24 | )
25 | export default SvgKeyBig
26 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 | # Transee
6 |
7 | Simple and useful tool for quick translation - reference to Google Translate
8 |
9 | 
10 |
11 |
12 |
13 | ### Installation
14 |
15 | 1. Clone the git repository from GitHub:
16 |
17 | git clone https://github.com/alessioforte/transee.git
18 |
19 | 2. Open the working directory:
20 |
21 | cd transee
22 |
23 | 3. Install the Node dependencies:
24 |
25 | npm install
26 |
27 | Instead of `npm install` you may also install with [yarn](https://github.com/yarnpkg/yarn).
28 |
29 | ### Running Transee
30 |
31 | To run a development version requires a few steps. The easiest way is just to use two
32 | terminals. One terminal can be used just to watch for changes to the code:
33 |
34 | npm run watch
35 |
36 | Now run Transee in another terminal:
37 |
38 | npm run dev
39 |
40 | The main process in src/main/ folder is just for development version. After `npm run dev` the bundles are created in dist/renderer/ folder
41 |
42 | To run a distribution version open dist/ directory and install Node dependencies:
43 |
44 | npm install
45 |
46 | and run:
47 |
48 | npm start
49 |
50 | # About
51 |
52 | ## Acknowledgements
53 |
54 | - [CopyTranslator](https://github.com/CopyTranslator/CopyTranslator): Foreign language reading and translation assistant based on copy and translate.
55 |
--------------------------------------------------------------------------------
/homepage/threejs-scroll-animation/favicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/dd-alfred/test/test.js:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 | import alfyTest from 'alfy-test';
3 |
4 | test('result', async t => {
5 | const alfy = alfyTest();
6 | const result = await alfy('ec2 accept reserved');
7 |
8 | t.deepEqual(result[0], {
9 | title: 'acceptReservedInstancesExchangeQuote',
10 | autocomplete: 'acceptReservedInstancesExchangeQuote',
11 | subtitle: 'Elastic Compute Cloud',
12 | arg:
13 | 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#acceptReservedInstancesExchangeQuote-property',
14 | quicklookurl:
15 | 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#acceptReservedInstancesExchangeQuote-property',
16 | icon: {
17 | path: './icons/EC2.png'
18 | },
19 | keywords: 'EC2 acceptReservedInstancesExchangeQuote Elastic Compute Cloud',
20 | count: 3
21 | });
22 | });
23 |
24 | test('fallback icon', async t => {
25 | const alfy = alfyTest();
26 | const result = await alfy('startsupport');
27 |
28 | t.deepEqual(result[0], {
29 | title: 'startSupportDataExport',
30 | autocomplete: 'startSupportDataExport',
31 | subtitle: 'Marketplace Commerce Analytics',
32 | arg:
33 | 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/MarketplaceCommerceAnalytics.html#startSupportDataExport-property',
34 | quicklookurl:
35 | 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/MarketplaceCommerceAnalytics.html#startSupportDataExport-property',
36 | icon: {
37 | path: './icons/aws.png'
38 | },
39 | keywords:
40 | 'MarketplaceCommerceAnalytics startSupportDataExport Marketplace Commerce Analytics',
41 | count: 1
42 | });
43 | });
44 |
--------------------------------------------------------------------------------
/picgo-plugin-ngte-migrater/dist/utils.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault =
3 | (this && this.__importDefault) ||
4 | function (mod) {
5 | return mod && mod.__esModule ? mod : { default: mod };
6 | };
7 | Object.defineProperty(exports, "__esModule", { value: true });
8 | exports.handleUrlEncode =
9 | exports.isUrlEncode =
10 | exports.isUrl =
11 | exports.getImageSize =
12 | void 0;
13 | const image_size_1 = __importDefault(require("image-size"));
14 | const getImageSize = (buffer) => {
15 | try {
16 | const size = (0, image_size_1.default)(buffer);
17 | return {
18 | real: true,
19 | width: size.width,
20 | height: size.height,
21 | type: size.type,
22 | };
23 | } catch (e) {
24 | // fallback to default size
25 | return {
26 | real: false,
27 | width: 200,
28 | height: 200,
29 | type: ".png",
30 | };
31 | }
32 | };
33 | exports.getImageSize = getImageSize;
34 | const isUrl = (url) => url.startsWith("http://") || url.startsWith("https://");
35 | exports.isUrl = isUrl;
36 | const isUrlEncode = (url) => {
37 | url = url || "";
38 | try {
39 | // the whole url encode or decode shold not use encodeURIComponent or decodeURIComponent
40 | return url !== decodeURI(url);
41 | } catch (e) {
42 | // if some error caught, try to let it go
43 | return true;
44 | }
45 | };
46 | exports.isUrlEncode = isUrlEncode;
47 | const handleUrlEncode = (url) => {
48 | if (!(0, exports.isUrlEncode)(url)) {
49 | url = encodeURI(url);
50 | }
51 | return url;
52 | };
53 | exports.handleUrlEncode = handleUrlEncode;
54 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/SettingsMedium.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgSettingsMedium = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
18 | )
19 | export default SvgSettingsMedium
20 |
--------------------------------------------------------------------------------
/homepage/threejs-scroll-animation/style.css:
--------------------------------------------------------------------------------
1 | @import url("https://use.typekit.net/jmk3xov.css");
2 |
3 | canvas {
4 | position: fixed;
5 | top: 0;
6 | left: 0;
7 | }
8 |
9 |
10 | :root {
11 | --dark-bg: rgba(15, 15, 15, 0.95);
12 | --spacing: 350px;
13 |
14 | font-family: brandon-grotesque, sans-serif;
15 | font-weight: 400;
16 | font-style: normal;
17 | }
18 |
19 |
20 | main {
21 | width: 100vw;
22 | color: white;
23 | z-index: 99;
24 | position: absolute;
25 | width: 100%;
26 | margin: 0px auto;
27 | padding: 120px 0px;
28 |
29 | display: grid;
30 | grid-template-columns: repeat(12, 1fr);
31 | }
32 |
33 | h1, h2, h3, blockquote {
34 | font-family: elevon, sans-serif;
35 | font-weight: 700;
36 | font-style: normal;
37 | }
38 |
39 | canvas {
40 | position: fixed;
41 | top: 0;
42 | left: 0;
43 | }
44 |
45 |
46 |
47 | header {
48 | background: var(--dark-bg);
49 | grid-column: 2 / span 5;
50 | font-size: 2.5rem;
51 | padding: 2rem;
52 | margin-bottom: var(--spacing);
53 | }
54 |
55 | section {
56 | grid-column: 2 / 8;
57 | padding: 1rem;
58 | background: var(--dark-bg);
59 | font-size: 1.25rem;
60 | line-height: 1.5;
61 | margin-bottom: var(--spacing);
62 | }
63 |
64 | blockquote {
65 | margin: 0;
66 | padding: 0;
67 | grid-column: 2 / span 9;
68 | margin-bottom: var(--spacing);
69 | }
70 |
71 | blockquote p {
72 | color: black;
73 | background-color: white;
74 | font-size: 4rem;
75 | display: inline;
76 | line-height: 1;
77 | }
78 |
79 | .left {
80 | grid-column: 6 / 12;
81 | }
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/theme.js:
--------------------------------------------------------------------------------
1 | const theme = {
2 | colors: {
3 | main: {
4 | default: '#E41359',
5 | hover: '#CA1B53',
6 | dark: '#73313D',
7 | light: '#FFDBE7',
8 | lighter: '#FDEEF3',
9 | },
10 | gray: [
11 | '#39486E', // 0
12 | '#4F5C7E',
13 | '#606C8B', // 2
14 | '#737E99',
15 | '#838DA5', // 4
16 | '#959DB3',
17 | '#A7AEC0', // 6
18 | '#BBC1CF',
19 | '#CBCFDB', // 8
20 | '#E4E7EE',
21 | '#EDEEF7', // 10
22 | '#FAFBFE',
23 | ],
24 | jsonVue: {
25 | string: '#86C3B8',
26 | keys: '#39486E',
27 | badgeBg: '#EDEEF7',
28 | badgeFg: '#82a0bc',
29 | keyNumber: '#39486E',
30 | arrows: '#E41359',
31 | integers: '#86C3B8',
32 | },
33 | },
34 | // 0, 1, 2, 3, 4, 5, 6, 7, 8
35 | space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
36 | fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72],
37 | breakpoints: {
38 | large: '1440',
39 | },
40 | }
41 |
42 | export const jsonTheme = {
43 | base00: 'white',
44 | base01: '#ddd',
45 | base02: theme.colors.jsonVue.badgeBg,
46 | base03: '#444',
47 | base04: 'purple',
48 | base05: '#444',
49 | base06: '#444',
50 | base07: theme.colors.jsonVue.keys,
51 | base08: '#444',
52 | base09: theme.colors.jsonVue.string,
53 | base0A: theme.colors.jsonVue.badgeFg,
54 | base0B: theme.colors.jsonVue.string,
55 | base0C: theme.colors.jsonVue.keyNumber,
56 | base0D: theme.colors.jsonVue.arrows,
57 | base0E: theme.colors.jsonVue.arrows,
58 | base0F: theme.colors.jsonVue.integers,
59 | }
60 |
61 | export default theme
62 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/cypress/e2e/test-search.cy.js:
--------------------------------------------------------------------------------
1 | const WAITING_TIME = Cypress.env('waitingTime')
2 |
3 | describe(`Test search`, () => {
4 | before(() => {
5 | // Recreate the movies index with documents in it
6 | cy.deleteAllIndexes()
7 | cy.wait(WAITING_TIME)
8 | cy.createIndex('movies')
9 | cy.wait(WAITING_TIME)
10 | cy.fixture('movies.json').then((movies) => {
11 | cy.addDocuments('movies', movies)
12 | cy.wait(WAITING_TIME)
13 | })
14 | })
15 |
16 | beforeEach(() => {
17 | cy.visit('/')
18 | })
19 |
20 | it('Should update the results according to the user’s search', () => {
21 | cy.get('input[type="search"]').type('Fifth Element')
22 | cy.get('ul')
23 | .children()
24 | .should(($p) => {
25 | expect($p).to.have.length(1)
26 | })
27 | })
28 |
29 | it('Should display a message if there are no result for the user’s search', () => {
30 | cy.get('input[type="search"]').type('zz')
31 | cy.contains('Sorry mate, no results matching your request')
32 | })
33 |
34 | it('Should display a "Load more" button if there are more than 20 results', () => {
35 | cy.get('input[type="search"]')
36 | cy.get('ul')
37 | .children()
38 | .should(($p) => {
39 | expect($p).to.have.length(20)
40 | })
41 | cy.contains('Load more')
42 | })
43 |
44 | it('Should load the next documents on click on the "Load more" button', () => {
45 | cy.get('span').contains('Load more').parent().click()
46 | cy.get('ul')
47 | .children()
48 | .should(($p) => {
49 | expect($p).to.have.length(33)
50 | })
51 | })
52 | })
53 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/SettingsBig.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgSettingsBig = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
18 | )
19 | export default SvgSettingsBig
20 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/svg/interrogation_mark.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/svg/spinner.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const spinnerColor = '#555'
4 |
5 | export default () => (
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
27 |
35 |
36 |
37 |
38 |
39 | )
--------------------------------------------------------------------------------
/dd-search-engine/sg-index-doc/src/cli/build-meili-index.ts:
--------------------------------------------------------------------------------
1 | const program = require("commander");
2 | import * as fs from "fs-extra";
3 | import * as path from "path";
4 | import { ReposityConfig } from "../config/repo-config";
5 |
6 | import { buildDocIndex } from "../service/index/buildDocIndexWithMeili";
7 |
8 | program
9 | .command("doc")
10 | .description("index docs from several repos")
11 | .action(async function () {
12 | const baseLocalDir = "/Users/zhangzixiong/Desktop/Docs";
13 |
14 | // 读取所有文章目录列表
15 | const firstDirs = fs.readdirSync(baseLocalDir);
16 |
17 | const ignores = [
18 | ".DS_Store",
19 | ".vscode",
20 | "tmp.txt",
21 | "commit-all.sh",
22 | "Private",
23 | "Playground",
24 | "Awesome-Lists",
25 | "Awesome-CS-Books-and-Digests",
26 | ];
27 |
28 | firstDirs
29 | .filter((d) => !ignores.includes(d))
30 | .forEach(async (dir) => {
31 | try {
32 | const dirPath = path.join(baseLocalDir, dir);
33 |
34 | const repos = fs
35 | .readdirSync(dirPath)
36 | .filter((d) => !ignores.includes(d))
37 | .map(
38 | (repoDirName) =>
39 | ({
40 | name: repoDirName,
41 | title: repoDirName,
42 | localPath: path.join(dirPath, repoDirName),
43 | description: repoDirName,
44 | sUrl: `https://ng-tech.icu/${repoDirName}`,
45 | } as ReposityConfig)
46 | );
47 |
48 | await buildDocIndex(repos);
49 | } catch (e) {
50 | console.error(e);
51 | }
52 | });
53 | });
54 |
55 | program.parse(process.argv);
56 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/icons/DiscordLogo.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | const SvgDiscordLogo = ({ title, titleId, ...props }) => (
3 |
10 | {title ? {title} : null}
11 |
17 |
23 |
24 | )
25 | export default SvgDiscordLogo
26 |
--------------------------------------------------------------------------------
/dd-search-engine/meilisearch-dashboard/src/components/Checkbox.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import styled from 'styled-components'
3 | import { Checkbox as ReakitCheckbox } from 'reakit/Checkbox'
4 |
5 | const StyledCheckbox = styled(ReakitCheckbox)`
6 | appearance: none;
7 | position: relative;
8 | border-radius: 4px;
9 | width: 16px;
10 | height: 16px;
11 | margin-right: 8px;
12 | border-width: 2px;
13 | border-style: solid;
14 | border-color: ${(p) => p.theme.colors.gray[7]};
15 | background-color: white;
16 | outline: none;
17 | cursor: pointer;
18 | transition: background-color 300ms, border-color 300ms;
19 |
20 | &[aria-checked='true'] {
21 | color: white;
22 | border-color: ${(p) => p.theme.colors.main.default};
23 | background-color: ${(p) => p.theme.colors.main.default};
24 | &:before {
25 | content: '✔';
26 | position: absolute;
27 | top: 50%;
28 | left: 50%;
29 | transform: translate(-50%, -50%);
30 | font-size: 10px;
31 | }
32 | }
33 | `
34 |
35 | const Label = styled.label`
36 | transition: color 300ms;
37 | cursor: pointer;
38 | outline: none;
39 | `
40 | const Container = styled.div`
41 | color: ${(p) => p.theme.colors.gray[3]};
42 |
43 | display: flex;
44 | align-items: center;
45 | &:hover {
46 | color: ${(p) => p.theme.colors.gray[0]};
47 | }
48 |
49 | ${StyledCheckbox}:focus + ${Label} {
50 | color: ${(p) => p.theme.colors.gray[0]};
51 | }
52 | `
53 |
54 | const Checkbox = ({
55 | children,
56 | checked,
57 | onChange,
58 | label = 'checkbox',
59 | ...props
60 | }) => (
61 |
62 |
63 | {children}
64 |
65 | )
66 |
67 | export default Checkbox
68 |
--------------------------------------------------------------------------------
/dd-translator-for-coder/electron-customizable-translator/src/renderer/app/langs-list.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { langsFrom, langsTo } from '../google-translate/langs'
3 |
4 | export default ({ lang1, lang2, lang3, active, setLang, side }) => {
5 |
6 | var langs = side ? langsFrom : langsTo
7 |
8 | function handleClick(i) {
9 | setLang(i)
10 | }
11 |
12 | function renderLangs() {
13 | var items = []
14 | for (let i in langs) {
15 | if (i == active) {
16 | items.push(
17 | {langs[i]}
25 |
26 | )
27 | continue
28 | }
29 | if (i === lang1 || i === lang2 || i === lang3) {
30 | items.push(
31 | handleClick(i)}
36 | >{langs[i]}
37 |
38 | )
39 | continue
40 | }
41 | items.push(
42 | handleClick(i)}
46 | >{langs[i]}
47 |
48 | )
49 | }
50 | return items
51 | }
52 |
53 | return (
54 | {renderLangs()}
55 | )
56 | }
--------------------------------------------------------------------------------