This file contains hidden or 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
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class MusicalScaleGenerator { | |
private final Map<Integer, List<Integer>> scaleTransitions = new HashMap<>(); | |
private final int TARGET_SUM = 12; | |
private final List<List<Integer>> validScales = new ArrayList<>(); |
This file contains hidden or 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
# use Tmux only if current term program is Apple Terminal | |
if [ "$TERM_PROGRAM" = 'Apple_Terminal' ]; then | |
tmux has -t hack &> /dev/null | |
if [ $? != 0 ]; then | |
tmux new -s hack | |
elif [ -z $TMUX ]; then | |
tmux attach -t hack | |
fi | |
fi |
This file contains hidden or 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
" Have j and k navigate visual lines rather than logical ones | |
nmap j gj | |
nmap k gk | |
" I like using H and L for beginning/end of line | |
nmap H ^ | |
nmap L $ | |
" Quickly remove search highlights | |
nmap <F9> :nohl |
This file contains hidden or 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
if status is-interactive | |
# Commands to run in interactive sessions can go here | |
end | |
# Misc | |
set fish_greeting "Hello Fish!" | |
set TERM "xterm-256color" | |
# set EDITOR "nvim" | |
#export LANG=zh_TW.UTF-8 |
This file contains hidden or 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
# Optimize mp4 | |
# Usage: optimizeVideo video_file | |
function optimizeVideo | |
set video_file $argv[1] | |
ffmpeg -i "$video_file" -vcodec h264 -acodec mp2 "$video_file.mp4" | |
end | |
# Convert video to gif file. | |
# Usage: video2gif video_file | |
function video2gif |
This file contains hidden or 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
tasks.withType<Test>().all { | |
testLogging { | |
events("passed", "skipped", "failed") | |
outputs.upToDateWhen { false } | |
showStandardStreams = true | |
} | |
maxParallelForks = Runtime.getRuntime().availableProcessors().div(2).coerceAtLeast(1) | |
} |
This file contains hidden or 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
liou.rayyuan.ebooksearchtaiwan.debug | |
https://taiwan-ebook-lover.github.io/searches/mA8m91o8ylnY9hIGzQDL |
This file contains hidden or 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
#!/bin/bash | |
find ~/.android/avd -name "config.ini" | while read line | |
do | |
awk '!/audio/' $line > tmp | |
rm $line | |
mv tmp $line | |
echo "hw.audioInput = no" >> $line | |
echo "hw.audioOutput = no" >> $line | |
done |
This file contains hidden or 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
# Personal Feeling: using the following jvm config is smoother than default | |
# My Machine: Macbook pro M1max 64GB | |
# More Info: https://github.com/FoxxMD/intellij-jvm-options-explained | |
# Prerequisite (Intellij < 2022.2) | |
# 1. Install JetBrain Runtime 17 osx-aarch64 for Apple Silicon, https://github.com/JetBrains/JetBrainsRuntime/releases | |
# 2. Switch the runtime from JetBrain Runtime 11 to 17, https://www.jetbrains.com/help/idea/switching-boot-jdk.html | |
# JetBrain Toolbox |
This file contains hidden or 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
-Xms1024m | |
-Xmx4096m | |
-XX:ReservedCodeCacheSize=512m | |
-XX:+IgnoreUnrecognizedVMOptions | |
-XX:+UseG1GC | |
-XX:SoftRefLRUPolicyMSPerMB=50 | |
-XX:CICompilerCount=2 | |
-XX:+HeapDumpOnOutOfMemoryError | |
-XX:-OmitStackTraceInFastThrow | |
-ea |