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
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
Enable-RemoteDesktop | |
cinst intellijidea-community | |
cinst jdk11 | |
cinst jdk8 | |
cinst git | |
cinst notepadplusplus | |
cinst vscode | |
cinst beyondcompare |
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
@echo off | |
:: install Chocolatey, please make sure you are running cmd as administrator | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:: install necessary components of Java development environment and some useful stuff | |
cinst intellijidea-community git jdk8 jdk11 vscode notepadplusplus eclipse netbeans-jse maven gradle everything f.lux -y |
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.Stack; | |
public class TreeNode { | |
public int val; | |
public TreeNode left; | |
public TreeNode right; | |
public TreeNode(int x) { | |
val = x; | |
} |
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
# download 3.21.2-03 or latest version if you want: latest-unix.tar.gz | |
wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.21.2-03-unix.tar.gz | |
tar xvzf nexus-3.21.2-03-unix.tar.gz | |
# if you use latest-unix.tar.gz the extracted directory name might be different | |
cd nexus-3.21.2-03/bin | |
# start nexus in background and check status | |
./nexus start | |
./nexus status | |
# access http://localhost:8081 with admin/admin123 |
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
/** | |
* Initialize JFX toolkit if you are not running in JavaFX GUI environment | |
* It supports mp3, wav and is much easier to use | |
*/ | |
void cheer() { | |
PlatformImpl.startup(() -> { | |
Media hit = new Media(new File("audios/cheer.mp3").toURI().toString()); | |
MediaPlayer mediaPlayer = new MediaPlayer(hit); | |
mediaPlayer.play(); | |
}); |
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
private Image bgImage; | |
@Override | |
public void update(Graphics g) { | |
if (bgImage == null) bgImage = this.createImage(WIDTH, HEIGHT); | |
Graphics bg = bgImage.getGraphics(); | |
bg.setColor(Color.BLACK); | |
bg.fillRect(0, 0, WIDTH, HEIGHT); | |
this.paintComponent(bg); | |
} |
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
wget https://www-us.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz | |
sudo tar xf apache-maven-*.tar.gz -C /opt | |
sudo ln -s /opt/apache-maven-3.6.0 /opt/maven | |
sudo nano /etc/profile.d/maven.sh | |
# commit these 4 lines | |
export JAVA_HOME=/usr/lib/jvm/default-java | |
export M2_HOME=/opt/maven | |
export MAVEN_HOME=/opt/maven | |
export PATH=${M2_HOME}/bin:${PATH} | |
sudo chmod +x /etc/profile.d/maven.sh |
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
# auto accept oracle license agreement | |
echo oracle-java13-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections | |
# install oracle jdk13 and set environment variables | |
sudo add-apt-repository ppa:linuxuprising/java -y | |
sudo apt-get update | |
sudo apt-get install oracle-java13-installer -yq | |
sudo apt-get install oracle-java13-set-default -yq | |
# set JAVA_HOME variable and link jdk13 to default location also |