A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| function enableContextMenu(aggressive = true) { | |
| void(document.ondragstart=null); | |
| void(document.onselectstart=null); | |
| void(document.onclick=null); | |
| void(document.onmousedown=null); | |
| void(document.onmouseup=null); | |
| void(document.body.oncontextmenu=null); | |
| enableRightClickLight(document); | |
| if (aggressive) { | |
| enableRightClick(document); |
| body { | |
| display: flex; | |
| /*horizontal center*/ | |
| justify-content: center; | |
| /*vertial center*/ | |
| align-items: center; | |
| /*center body*/ |
| file_name=$1 | |
| echo Compiling $file_name... | |
| javac $file_name | |
| echo Successfully compiled $file_name. | |
| echo Executing $file_name... | |
| shift | |
| java ${file_name%%.java} $@ |
A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
| #!/bin/bash | |
| DIR="./build" | |
| if [ -d "$DIR" ]; then | |
| rm -r "$DIR" | |
| fi | |
| mkdir build | |
| cd build | |
| cp -r ../public/elements . |
| python -c "import os;print(sum(os.path.getsize(f) for f in os.listdir('.') if os.path.isfile(f)), 'bytes')" |
| # run `python kaggle.py` | |
| from google.colab import drive | |
| drive.mount('/content/gdrive') | |
| import os, json | |
| os.system('mkdir ~/.kaggle;touch ~/.kaggle/kaggle.json') | |
| api_token = {"username":"username","key":"api_key"} | |
| with open('/root/.kaggle/kaggle.json', 'w') as f: | |
| json.dump(api_token, f) | |
| os.system('chmod 600 ~/.kaggle/kaggle.json') |
| <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" | |
| onclick="document.querySelector('.navbar-menu').classList.toggle('is-active');document.querySelector('.navbar-burger').classList.toggle('is-active');"> | |
| <span aria-hidden="true"></span> | |
| <span aria-hidden="true"></span> | |
| <span aria-hidden="true"></span> | |
| </a> |
| read -p 'Repo git link: ' repolink;echo '[1] Cloning repo...';git clone $repolink repo &> /dev/null;echo ' Cloned repo';cd repo;echo '[2] Moving files...';mv {.,}* .. &>/dev/null;echo ' Moved files';cd ..;echo '[3] Removing parent directory...';rm -r repo;echo ' Removed parent directory'; echo 'repl repo initialization complete' |
| #!/bin/bash | |
| # first run chmod +x ./repl-repo1.sh | |
| # then ./repl-repo.sh [link-to-repo.git] | |
| echo '[1] Cloning repo...' | |
| git clone $1 repo &> /dev/null | |
| echo ' Cloned repo' | |
| cd repo | |
| echo '[2] Moving files...' | |
| mv {.,}* .. &>/dev/null | |
| echo ' Moved files' |