Skip to content

Instantly share code, notes, and snippets.

@BlazerYoo
BlazerYoo / burger.html
Created June 20, 2021 19:23
Activate Bulma navbar burger
<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>
@BlazerYoo
BlazerYoo / kaggle.py
Last active June 28, 2021 20:21
Download Kaggle data to Google Drive with authentication pipeline
# 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')
@BlazerYoo
BlazerYoo / directory_size.sh
Last active June 28, 2021 02:34
Terminal calculate directory size
python -c "import os;print(sum(os.path.getsize(f) for f in os.listdir('.') if os.path.isfile(f)), 'bytes')"
@BlazerYoo
BlazerYoo / build.sh
Created July 10, 2021 18:53
Generating static files for web app running on ExpressJs and Bulma (main folder is public and follows https://bulma.io/documentation/customize/with-node-sass/)
#!/bin/bash
DIR="./build"
if [ -d "$DIR" ]; then
rm -r "$DIR"
fi
mkdir build
cd build
cp -r ../public/elements .
@BlazerYoo
BlazerYoo / README.md
Created August 11, 2021 03:03 — forked from Tynael/README.md
How to use npx to run gist based scripts
@BlazerYoo
BlazerYoo / j.sh
Last active October 20, 2021 03:20
Compile and execute Java programs with one command
file_name=$1
echo Compiling $file_name...
javac $file_name
echo Successfully compiled $file_name.
echo Executing $file_name...
shift
java ${file_name%%.java} $@
@BlazerYoo
BlazerYoo / center.css
Last active July 20, 2022 20:07
Center all content in HTML
body {
display: flex;
/*horizontal center*/
justify-content: center;
/*vertial center*/
align-items: center;
/*center body*/
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);
javascript: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); removeContextMenuOnAll('body'); removeContextMenuOnAll('img'); removeContextMenuOnAll('td'); } } function removeContextMenuOnAll(tagName) { var elements = document.getElementsByTagName(tagName); for (var i = 0; i < elements.length; i++) { enableRightClick(elements[i]); enablePointerEvents(elements[i]); } } function enableRightClickLight(el) { el || (el = document); el.addEventListener('contextmenu', bringBackDefault, true); } function enableRightClick(el) { el || (el = document); el.addEventListener('contextmenu', bringBackDefault, true); el.addEventListener('dragstart', bringBackDefault, true); el.addEventListener('selectstart', bringBackDefault, true); el.addEventListener('c
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16