Skip to content

Instantly share code, notes, and snippets.

View HymanZHAN's full-sized avatar
⌨️
Keep learning!

Xucong Zhan HymanZHAN

⌨️
Keep learning!
View GitHub Profile
@HymanZHAN
HymanZHAN / Default.xml
Created May 3, 2024 09:33
IntelliJ Java Code Style
<code_scheme name="Default" version="173">
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
ls -s modified *.mp4 --no-quotes | cat -n | while read n f; do mv "$f" "$(printf "%s - %s" $n $f)"; done
@HymanZHAN
HymanZHAN / .zshrc
Last active August 17, 2022 01:34
WSL 2 .zshrc
# change default working directory
if [ "$PWD" = '/mnt/c/Users/zhanx' ]
then
cd
fi
# enabling some built-in features
zstyle ':completion:*' menu select
fpath+=~/.zfunc
autoload -U compinit && compinit
@HymanZHAN
HymanZHAN / wsl.ps1
Created April 2, 2020 17:08
Powershell 7 Profile for use within WSL
# Installed Module
Import-Module posh-git
# Aliases
Set-Alias -Name ll -Value Get-ChildItem
Set-Alias -Name quit -Value exit
Set-Alias -Name code -Value '/mnt/c/Users/zhanx/AppData/Local/Programs/Microsoft VS Code/bin/code'
# Built-In PSReadLine Options
Set-PSReadLineOption -HistoryNoDuplicates
@HymanZHAN
HymanZHAN / Activate.ps1
Created April 1, 2020 15:51
Custom (actually just commented line 56) Activate.ps1 of virtualenv to use with starship.
$script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
function global:deactivate([switch] $NonDestructive) {
if (Test-Path variable:_OLD_VIRTUAL_PATH) {
$env:PATH = $variable:_OLD_VIRTUAL_PATH
Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global
}
if (Test-Path function:_old_virtual_prompt) {
@HymanZHAN
HymanZHAN / personal.ps1
Last active August 16, 2022 13:36
Personal PS1 profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
# Env
$ENV:STARSHIP_CONFIG = "$HOME\.starship\starship.toml"
# Installed Module
Import-Module posh-git
Import-Module npm-completion
@HymanZHAN
HymanZHAN / .zshrc
Last active March 18, 2020 16:10
zsh configuration
# If you come from bash you might have to change your $PATH.
#
#
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/xzhan/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
@HymanZHAN
HymanZHAN / settings.json
Last active March 18, 2020 18:05
Django Development VSCode Formatting and Linting Settings
{
"python.pythonPath": "env/bin/python",
"python.linting.pylintArgs": ["--load-plugins", "pylint_django", "--max-line-length=100"],
"python.formatting.autopep8Args": ["--max-line-length", "150"],
"beautify.language": {
"html": ["htm", "html", "django-html"]
},
"beautify.config": {
"indent_size": 4,
"wrap_line_length": 150,
@HymanZHAN
HymanZHAN / html.json
Last active April 29, 2022 01:39
Some Handy HTML Snippets for Jinja2 Templates (updating)
{
"Jinja For": {
"prefix": "jj-for",
"body": ["{% for ${2:element} in ${1:array} %}", "\t$0", "{% endfor %}"],
"description": "For loop in Jinja2"
},
"Jinja If": {
"prefix": "jj-if",
"body": ["{% if ${1:expression} %}", "\t$0", "{% endif %}"],
"description": "If statement in Jinja2"