Skip to content

Instantly share code, notes, and snippets.

View sumitsahoo's full-sized avatar
👾
Architecting…

Sumit Sahoo sumitsahoo

👾
Architecting…
View GitHub Profile
@sumitsahoo
sumitsahoo / set_git_user.sh
Created February 29, 2024 12:56
Set local git user name and email
git config --local user.name "Your Name"
git config --local user.email "youremail@example.com"
@sumitsahoo
sumitsahoo / settings.json
Created May 28, 2023 15:23
Set VS Code terminal font
"terminal.integrated.fontSize": 13,
"terminal.integrated.fontFamily": "'MesloLGS NF','JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",
@sumitsahoo
sumitsahoo / remove_dock_delay.sh
Last active May 19, 2023 17:49
Remove dock delay in macOS
# Remove delay
defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock
# Faster animation
# defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0.65 && killall Dock
# Revert back
# defaults delete com.apple.dock autohide && defaults delete com.apple.dock autohide-delay && defaults delete com.apple.dock autohide-time-modifier && killall Dock
@sumitsahoo
sumitsahoo / delete_android_studio.sh
Last active July 28, 2021 17:12
Delete Android Studio (Mac)
# Deletes the Android Studio application
# Note that this may be different depending on what you named the application as, or whether you downloaded the preview version
rm -Rf /Applications/Android\ Studio.app
# Delete All Android Studio related preferences
# The asterisk here should target all folders/files beginning with the string before it
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/Google/AndroidStudio*
# Deletes the Android Studio's plist file
rm -Rf ~/Library/Preferences/com.google.android.*
# Deletes the Android Emulator's plist file
@sumitsahoo
sumitsahoo / add_permission.sh
Last active October 23, 2020 11:49
Fix brew permission from another account in macOS
# First create a user group and add users who are going to use shared brew
# User group : brew-usergroup
echo $(brew --prefix)
echo $(groups $(whoami))
sudo dseditgroup -o edit -a $(whoami) -t user brew-usergroup
sudo chgrp -R brew-usergroup $(brew --prefix)/*
sudo chmod -R g+rwX $(brew --prefix)/*
ls -lah $(brew --prefix)
@sumitsahoo
sumitsahoo / JsonValidator.java
Created July 29, 2020 07:42
Check if a string is a valid JSON
private static boolean isJson(String Json) {
try {
new JSONObject(Json);
} catch (JSONException ex) {
try {
new JSONArray(Json);
} catch (JSONException ex1) {
return false;
}
}
@sumitsahoo
sumitsahoo / Dockerfile
Last active July 15, 2020 11:49
Start strapi in dev configuration
# Use the official lightweight Node.js image.
# https://hub.docker.com/_/node
FROM node:14.5.0-slim
# Create and change to the app directory.
WORKDIR /usr/src/app
# Set PROD/DEV environment
ENV NODE_ENV=development
#ENV NODE_ENV=production
@sumitsahoo
sumitsahoo / see_user_tables.sql
Created July 15, 2020 07:59
See all user defined tables in PostgreSQL
SELECT
*
FROM
pg_catalog.pg_tables
WHERE
schemaname != 'pg_catalog'
AND schemaname != 'information_schema';
@sumitsahoo
sumitsahoo / update_brew.sh
Created June 24, 2020 15:55
Update brew and cleanup
brew update && brew upgrade && brew cleanup
@sumitsahoo
sumitsahoo / Util.kt
Created June 24, 2020 12:11
Make status bar transparent
fun makeStatusbarTransparent(activity: AppCompatActivity) {
activity.window.apply {
clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
statusBarColor = Color.TRANSPARENT
}
}