Skip to content

Instantly share code, notes, and snippets.

View nisrulz's full-sized avatar
🌌
Coding in the MultiVerse

Nishant Srivastava nisrulz

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

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 14:59
Bash function to switch jdk version in the terminal session only.
# 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 April 14, 2021 08:33
Extension function to get the classname as log tag
// 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 February 15, 2021 10:04
Stylus style for making Google Meet's raise hand button stand out

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 March 22, 2020 23:16 — forked from caseywatts/0 push to talk.md
Push To Talk - Google Meet Bookmarklet

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 April 17, 2020 07:27
Build from source and install Akira on Ubuntu (18.0.4.2)
#!/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 April 15, 2018 12:18
All of my android development aliases.
# 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 January 20, 2020 16:01
Append these aliases to your bashrc/zshrc and you will have access to commands which will allow you to install apk and launch apk
# 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
@nisrulz
nisrulz / SystemUiHelper.java
Created October 28, 2017 01:55 — forked from chrisbanes/SystemUiHelper.java
SystemUiHelper
/*
* 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 September 17, 2017 22:35
Making your Android Library, Lifecycle-Aware blog post code snippet: MainActivity class after lifecycle components have been integrated
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());
}