Skip to content

Instantly share code, notes, and snippets.

View legendmohe's full-sized avatar
🎯
Focusing

Xinyu He legendmohe

🎯
Focusing
View GitHub Profile
@legendmohe
legendmohe / default.custom.yaml
Created July 14, 2023 05:54
小狼毫配置
customization:
distribution_code_name: Weasel
distribution_version: 0.15.0.0
generator: "Rime::SwitcherSettings"
modified_time: "Tue Jul 11 12:06:45 2023"
rime_version: 1.8.5
patch:
"menu/page_size": 9
schema_list:
- {schema: double_pinyin_flypy}
logfilter_version=2.1.5
/**
* 不为空的时候才给lazy赋值
*/
public fun <T> lazyNotNull(initializer: () -> T?): Lazy<T?> = SynchronizedLazyNotNullImpl(initializer)
internal object UNINITIALIZED_VALUE
private class SynchronizedLazyNotNullImpl<out T>(initializer: () -> T?, lock: Any? = null) : Lazy<T?>,
java.io.Serializable {
private var initializer: (() -> T?)? = initializer
" let mapleader=","
let mapleader=" "
nnoremap <Space> <Nop>
" easymotion "
set easymotion
nmap f <Plug>(easymotion-f)
nmap F <Plug>(easymotion-F)
" surround "
@legendmohe
legendmohe / SparseIntArray.java
Created June 23, 2021 08:50
SparseIntArray in Java
public class SparseIntArray<T> {
/* Define Object DELETED */
private static final Object DELETED = new Object();
/* Flag for garbage collection */
private boolean garbage = false;
/* Default Capacity */
private static final int DEFAULT_CAPACITY = 10;
/* Variables for keys, values and size */
@legendmohe
legendmohe / .zshrc
Created May 24, 2021 08:07
mac zsh config
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@legendmohe
legendmohe / find_same_res.py
Created March 26, 2021 04:26
在两个目录查找同名文件
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""find_same_res.py: ..."""
__author__ = "hexinyu"
import os
import argparse
import time

dump:

For analysis of this file, run !analyze -v
12: kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************
Set-Culture en-US
$env:LC_ALL='C.UTF-8'
$env:PYTHONIOENCODING='utf-8'
# load modules
Import-Module posh-git
Import-Module PSReadLine
Import-Module ZLocation
@legendmohe
legendmohe / PLoading.java
Created March 15, 2019 08:35
基于 拓扑排序 的 渐进加载小框架
package com.legendmohe;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**