Skip to content

Instantly share code, notes, and snippets.

View hritik5102's full-sized avatar
:electron:
console.log("Learn to code")

Hritik Jaiswal hritik5102

:electron:
console.log("Learn to code")
View GitHub Profile
@hritik5102
hritik5102 / defer-script.html
Created April 9, 2024 10:52
Defer attribute in Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Async vs Defer</title>
<script>
console.log('Start HTML Parsing');
</script>
@hritik5102
hritik5102 / async-script.html
Last active April 8, 2024 21:42
Async (load-first order)
<p>...content before scripts...</p>
<script>
document.addEventListener('DOMContentLoaded', () => alert("DOM ready!"));
</script>
<script async src="https://javascript.info/article/script-async-defer/long.js"></script>
<script async src="https://javascript.info/article/script-async-defer/small.js"></script>
<p>...content after scripts...</p>
@hritik5102
hritik5102 / index.html
Last active April 8, 2024 20:21
Normal Script Loading - Example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Async vs Defer</title>
<script>
console.log('Start HTML Parsing');
</script>
</head>
@hritik5102
hritik5102 / talkback-android-commands.md
Last active February 15, 2024 14:33
Talkback ( Android ) Commands - Screen reader
Action One-finger gesture Multi-finger gesture
Move to the next item on the screen Swipe Right --
Move to the previous item on the screen Swipe Left --
Select an item Tap --
Scroll up or down 2-finger swipe up or down --
Scroll left or right 2-finger swipe left or right --
Activate Double-tap --
Long press the focused item Double-tap and hold --
Move up the slider ( Increasing the volume ) Up, or right then left --
@hritik5102
hritik5102 / voiceover-macos-commands.md
Last active February 15, 2024 14:17
VoiceOver ( MacOS ) Commands
Action Command
Move to the next item on the screen Vo + Right Arrow
Move to the previous item on the screen Vo + Left Arrow
Click on any element Vo + Spacebar
Increase the pitch Vo + Command + Up Arrow
Decrease the pitch Vo + Command + Down Arrow
Move focus of voiceover on a current webpage Vo + Shift + Down Arrow
Navigation by heading [ 85% percentage of users navigate via heading ] Vo + Command + H
Open the rotor ( To list down all the interactive elements ) Vo + U ( Press the right arrow to move around the different interactive element )
@hritik5102
hritik5102 / settings.json
Last active September 27, 2021 14:51
How to add ruler in VSCode ?
"[git-commit]": {
"editor.rulers": [{
"column": 50,
"color": "#50e782"
},
{
"column":72,
"color": "#ff7b00"
}],
"editor.wordWrap": "on",
@hritik5102
hritik5102 / Bert_inference.py
Last active May 2, 2021 17:27
BERT Inference
import os
# For Removing this warning : "Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import logging
logging.getLogger('tensorflow').disabled = True
# "0" means no logging. # For Removing XLA warnings
import tensorflow as tf
@hritik5102
hritik5102 / python-upgrade-package.md
Last active April 17, 2024 13:49
How To Update All Python Packages

Python Package Upgrade Checklist

Get a list of all the outdated packages

$ pip list --outdated

Open a command shell by typing ‘powershell’ in the Search Box of the Task bar
Update All Python Packages On Windows

@hritik5102
hritik5102 / git-automation.sh
Created March 29, 2021 19:26
Automate repetitive tasks with custom Git commands
#!/bin/sh
# Run the file inside terminal
# $ bash git-automation.sh "Commit message"
echo "Git Automation Starts ....."
message=$1 # First parameter will be the commit message
currentBranch=$(git symbolic-ref --short -q HEAD) # Getting the current branch
if [ ! -z "$1" ] # checking if the commit message is present. If not then aborting.
@hritik5102
hritik5102 / streamlit_app.py
Last active March 27, 2021 08:12
streamlit app
# --------------------------#
# Author : Hritik Jaiswal
# Github : https://github.com/hritik5102
# --------------------------#
# Import package
import streamlit as st
import pandas as pd
from PIL import Image