Skip to content

Instantly share code, notes, and snippets.

Working from home

Sumit Sahoo sumitsahoo

Working from home
View GitHub Profile
sumitsahoo /
Last active Sep 28, 2020
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 /
Created Jul 29, 2020
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 / Dockerfile
Last active Jul 15, 2020
Start strapi in dev configuration
View Dockerfile
# Use the official lightweight Node.js image.
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 / see_user_tables.sql
Created Jul 15, 2020
See all user defined tables in PostgreSQL
View see_user_tables.sql
schemaname != 'pg_catalog'
AND schemaname != 'information_schema';
sumitsahoo /
Created Jun 24, 2020
Update brew and cleanup
brew update && brew upgrade && brew cleanup
sumitsahoo / Util.kt
Created Jun 24, 2020
Make status bar transparent
View Util.kt
fun makeStatusbarTransparent(activity: AppCompatActivity) {
activity.window.apply {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
statusBarColor = Color.TRANSPARENT
sumitsahoo /
Created Jun 22, 2020 — forked from ceduliocezar/
How easily run Sonar Qube and PostgresSQL with Docker Containers


After installing Docker, follow three steps:
Step 1:
Run: docker network create mynet

Step 2:
Run: docker run --name sonar-postgres -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -d -p 5432:5432 --net mynet postgres

Step 3:
Run: docker run --name sonarqube -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=sonar -e SONARQUBE_JDBC_URL=jdbc:postgresql://sonar-postgres:5432/sonar -d --net mynet sonarqube:5.6

sumitsahoo / uninstall_app.kt
Created Jun 1, 2020
Uninstall app using package name
View uninstall_app.kt
// Add below permission to AndroidManifest.xml file
// <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
// After that use below code to uninstall an app
val intent = Intent(Intent.ACTION_DELETE) = Uri.parse("package:com.sumit.demo")
sumitsahoo /
Created May 13, 2020
Remove JDK from macOS
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Application\ Support/Oracle/Java/
sudo rm -rf /Library/Java/JavaVirtualMachines
View android_material_design_colours.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- google's material design colours from -->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
You can’t perform that action at this time.