Skip to content

Instantly share code, notes, and snippets.

Avatar
🌠
Coding in the MultiVerse

Nishant Srivastava nisrulz

🌠
Coding in the MultiVerse
View GitHub Profile
@nisrulz
nisrulz / Readme.md
Last active Aug 24, 2021
Script to setup and start a standalone Android Emulator on a macOS machine.
View Readme.md

Standalone Android Emulator on a macOS

Script to setup and start a standalone Android Emulator on a macOS machine.

Setup

./setup_android_emu.sh
@nisrulz
nisrulz / setjdk.sh
Last active May 26, 2021
Bash function to switch jdk version in the terminal session only.
View setjdk.sh
# Function to switch JDK versions
# Usage:
# > setjdk # switch to latest jdk
# > setjdk 8 # switch to jdk 1.8
# > setjdk 11 # switch to jdk 11
function setjdk() {
oldStyleVersion=8
requestedVersion=$1
finalVersion=""
@nisrulz
nisrulz / Log.kt
Created Apr 14, 2021
Extension function to get the classname as log tag
View Log.kt
// Extension function to get the classname as log tag
val Any.TAG: String
get() {
return if (!javaClass.isAnonymousClass) {
val name = javaClass.simpleName
if (name.length <= 23) name else name.substring(0, 23)// first 23 chars
} else {
val name = javaClass.name
if (name.length <= 23) name else name.substring(name.length - 23, name.length)// last 23 chars
}
@nisrulz
nisrulz / Readme.md
Created Feb 15, 2021
Stylus style for making Google Meet's raise hand button stand out
View Readme.md

Stylus style for making Google Meet's raise hand button stand out

  • Install Stylus Browser Extension
  • Goto Google Meet
  • Click on Stylus extension icon in top right corner in toolbar
  • Hover over meet.google.com inside the popup and click to add a style
  • Copy paste the style in opened box and save
@nisrulz
nisrulz / 0 push to talk.md
Created Mar 22, 2020 — forked from caseywatts/0 push to talk.md
Push To Talk - Google Meet Bookmarklet
View 0 push to talk.md

Short link to this page: http://caseywatts.com/ptt

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Push To Talk in a Google Hangout (Meet)

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
    • Name: PTT (push to talk) or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
    • URL: (paste in the bookmarklet.js contents below)
  2. In a Meet, click on the bookmarklet
@nisrulz
nisrulz / build_akira_for_ubuntu.sh
Last active Apr 17, 2020
Build from source and install Akira on Ubuntu (18.0.4.2)
View build_akira_for_ubuntu.sh
#!/bin/bash
# This is the main script, only execute this to install all dependencies and finally Akira.
# Once done, you can find Akira icon in your applications menu.
# Execute by: ./build_akira_for_ubuntu.sh
# Install Vala Language:
sudo apt install vala-0.40-doc valac-0.40-vapi valac
# Build Granite (make sure this script is in the same folder)
@nisrulz
nisrulz / androidDevAliases.sh
Created Apr 15, 2018
All of my android development aliases.
View androidDevAliases.sh
# I use ZSH, here is what I added to my .zshrc file (config file)
# at ~/.zshrc
# ------------------ Android ------------------ #
# Have the adb accessible, by including it in the PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:path/to/android_sdk/platform-tools/"
# Setup your Android SDK path in ANDROID_HOME variable
export ANDROID_HOME=~/sdks/android_sdk
@nisrulz
nisrulz / appBuildInstallLaunchAlias.sh
Last active Jan 20, 2020
Append these aliases to your bashrc/zshrc and you will have access to commands which will allow you to install apk and launch apk
View appBuildInstallLaunchAlias.sh
# I use ZSH, here is what I added to my .zshrc file (config file)
# at ~/.zshrc
# Have the adb accessible, by including it in the PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:path/to/android_sdk/platform-tools/"
# Setup your Android SDK path in ANDROID_HOME variable
export ANDROID_HOME=~/sdks/android_sdk
# Setup aapt tool so it accessible using a single command
View SystemUiHelper.java
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nisrulz
nisrulz / MainActivity.java
Created Sep 17, 2017
Making your Android Library, Lifecycle-Aware blog post code snippet: MainActivity class after lifecycle components have been integrated
View MainActivity.java
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Add Lifecycle Observer
getLifecycle().addObserver(AwesomeLibMain.getInstance());
}