Skip to content

Instantly share code, notes, and snippets.

View nishantkp's full-sized avatar
:octocat:
WFM

Nishant Patel nishantkp

:octocat:
WFM
View GitHub Profile
@nishantkp
nishantkp / Network.java
Last active October 24, 2023 16:27
Find out application is connected to WIFI or cellular
/**
* Get reference to the connectivity manager
*/
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
/**
* Find out whether device is connected to wifi or cellular at the moment
*/
public NetworkType getNetworkType() {
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 22, 2024 08:35
crack activate Office on mac with license file
@lopspower
lopspower / README.md
Last active June 18, 2024 06:05
Android studio format code auto break line

Android studio format code auto break line

Twitter

To do this in Android Studio go to Preferences > Editor > Code Style

and set Right margin (columns) to 150 (or the line width you want)

Now go to File -> Settings > Editor > Code Style > Java > Wrapping and Braces

@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 22, 2024 13:05
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle