This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
from groq import Groq | |
import pyperclip | |
import re | |
from fuzzywuzzy import process | |
import fire | |
from rich.console import Console | |
from rich.markdown import Markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("MemberVisibilityCanBePrivate", "RemoveExplicitTypeArguments") | |
package com.duomi.parser | |
class ParseException(msg: String, src: Source) : RuntimeException("$msg, occur at src: $src") | |
var enableAutoSkipSpace = true | |
class Source(val src: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T> given(desc: String = "", block: () -> T): TestRoutine<T> { | |
return TestRoutine("given: $desc", block) | |
} | |
class TestRoutine<T>( | |
private val message: String = "", | |
private val block: () -> T | |
) { | |
fun <R> when_(desc: String = "", whenBlock: (T) -> R): TestRoutine<R> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
USAGE = """ | |
# 需要的依赖 | |
brew install graphviz # 可视化渲染 | |
python3 -m pip install simpletemplate # 生成dot 语言的文本描述 | |
python3 -m pip install fire # 解析命令行参数 | |
Usage: deps-code [--exlude 想要排除的类] [--engine graphviz 渲染引擎,默认为dot] interesting-code-path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
USAGE = """ | |
# 需要的依赖 | |
brew install graphviz # 可视化渲染 | |
python3 -m pip install simpletemplate # 生成dot 语言的文本描述 | |
python3 -m pip install fire # 解析命令行参数 | |
Usage: deps-gradle [--pattern re] [--src_pattern re] [--target_pattern re] [--engine graphviz渲染引擎,默认为dot] interesting-code-path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
COLOR_NORMAL="\033[0m" | |
COLOR_GREEN="\033[1;32m" | |
COLOR_YELLOW="\033[1;33m" | |
COLOR_RED="\033[1;35m" | |
function error() { | |
echo -e "${COLOR_RED}[error]: $1${COLOR_NORMAL}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from parser import ( | |
a, | |
sepby, | |
maybe, | |
many, | |
string, | |
java_float, | |
java_int, | |
const, | |
forward_decl, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import abstractmethod | |
import re | |
from typing import Callable, Any, List, Sequence, Union, Optional | |
import logging | |
class State: | |
def __init__(self, src: str): | |
self.src = src | |
self._index = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
""" | |
install: | |
pip3 install fire | |
""" | |
import re | |
import fire | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
""" | |
# install requirements: | |
pip3 install fire # 解析命令行参数 | |
pip3 install simpletemplate # 生成代码 | |
pip3 install pyperclip # 控制剪切版 | |
pip3 install termcolor # 彩色打印 | |
""" |
NewerOlder