Skip to content

Instantly share code, notes, and snippets.

Coding in the MultiVerse

Nishant Srivastava nisrulz

Coding in the MultiVerse
View GitHub Profile
nisrulz / build_buildtypes.gradle
Created Jul 18, 2015
Standard build.gradle configurations for a gradle based android app, with build flavours
View build_buildtypes.gradle
buildTypes {
debug {
minifyEnabled false
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''
nisrulz / ellipsis.css
Created Aug 1, 2015
Truncate text if it overflows and put ellipsis
View ellipsis.css
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; // IE 6+, FF 7+, Op 11+, Saf 1.3+, Chr 1+
-o-text-overflow: ellipsis; // for Opera 9 & 10
nisrulz /
Created Aug 3, 2015
Use gunplot in terminal to plot a graph
#For more info check :
#Install GnuPLot
brew install gnuplot
#Before ploting a graph, set the terminal into dumb mode
set terminal dumb
#To Plot a graph
plot cos(x+2) #for a function
#for a data set
nisrulz /
Last active Aug 29, 2015
Using Google's Battery Historian 2.0
#Start battery historian
cd $GOPATH/src/
go run cmd/battery-historian/battery-historian.go
#Setup device for data collection
./adb shell dumpsys batterystats --enable full-wake-history
./adb shell dumpsys batterystats --reset
#Capture bugreport
./adb bugreport > ./bugreports/android_device_bugreport.txt
nisrulz /
Last active Jun 18, 2020
Creating a maven repository
### Create Maven Repository
#Create a directory named mavenrepo
mkdir mavenrepo
#Move into the dir
cd mavenrepo
#Initialise with git
git init
View regex-weburl.js
// Regular Expression for URL validation
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
// Copyright (c) 2010-2013 Diego Perini (
// Permission is hereby granted, free of charge, to any person
nisrulz /
Created Aug 16, 2015
Test gist to showcase on satckoverflow
# This is a test shell script
echo "Hello World"
nisrulz / convert-png-to-webp
Last active Aug 29, 2015 — forked from jonjensen/convert-png-to-webp
Batch convert PNG files to WebP in 1 directory
View convert-png-to-webp
# cd to the directory of the image so we can work with just filenames
dir="$(dirname "$1")"
cd "$dir" || exit 1
base="$(basename "$1" .png)"
# create a WebP version of the PNG
nisrulz / task_gen_jar.gradle
Created Oct 2, 2015
Task to generate a JAR from an android library module
View task_gen_jar.gradle
// Place this in the 'build.gradle' of the library module
// Task : Generate a JAR
// Usage : In the terminal, run './gradlew jar'
// Output : Get the jar at 'build/libs'
task jar(type: Jar, dependsOn: 'assembleRelease') {
from fileTree(dir: 'build/intermediates/classes/release')
nisrulz / build.gradle
Created Oct 30, 2015 — forked from ph0b/build.gradle
sample build.gradle for generating split APKs per ABI
View build.gradle
apply plugin: ''
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
minSdkVersion 14
targetSdkVersion 21
versionCode 101