Skip to content

Instantly share code, notes, and snippets.

@minghu6
minghu6 / easycoll.rs
Created November 8, 2022 09:16
Rust easy collections used for algprithm demonstration
use std::{borrow::Borrow, collections::{HashMap, VecDeque}, fmt::Debug, hash::Hash};
////////////////////////////////////////////////////////////////////////////////
//// Macro
#[macro_export]
macro_rules! get {
($var:expr => $($e:expr),+) => {
{
@minghu6
minghu6 / .bash_aliases
Created August 18, 2022 16:05
bash aliases
alias m6pwd="rlwrap python -m minghu6.tools.pwd_keeper"
alias pm="rlwrap python -m"
alias m6ff="python -m minghu6.tools.ff"
alias m6uuid="python -m minghu6.tools.path2uuid"
alias m6auto_resume="python -m minghu6.tools.auto_resume"
alias m6text="pm minghu6.tools.text"
alias ssd="sudo sslocal -c ~/.shadowsocks.json --log-file ~/log/shadowsocks.log -d start"
alias ccl="rlwrap ~/coding/CL/official-repos/ccl-dev/ccl/lx86cl64"
alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.9.2-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.9.2-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
@minghu6
minghu6 / pr_joke1.rb
Last active November 8, 2022 09:04
a joke about code contributing and review
# pr joker1
review_queue = PRQ.new
mypr = :mypr
while conflict? review_queue.wait(mypr)
fix_and_rebase mypr
review_queue.push mypr
end
@minghu6
minghu6 / jardbg
Last active November 8, 2022 07:43
debug jar in command (using IDE like eclipse to connect)
#! /bin/bash
DEFAULT_PORT=9009;
port=$DEFAULT_PORT;
pring_usage(){
echo "Usage: jardb [-p=port default: $DEFAULT_PORT] target-jar";
}
while getopts ":p:h" optname
@minghu6
minghu6 / .gitconfig
Last active February 24, 2023 02:03 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[user]
name = minghu6
email = a19678zy@163.com
[color]