Skip to content

Instantly share code, notes, and snippets.

View PramodGarg's full-sized avatar

Pramod Garg PramodGarg

  • Pune. India
View GitHub Profile
# Created by https://www.gitignore.io/api/androidstudio
### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
@PramodGarg
PramodGarg / message.py
Last active November 5, 2019 18:25
Populate messages in android emulator from csv
import csv
import telnetlib
def get_auth_code() :
with open('/Users/<username>/.emulator_console_auth_token', 'r') as file: # file is in root directory, replace username
return file.read()
def send_message(session, sender, msg):
session.write(bytes("sms send {} {}\n".format(sender, msg), encoding='utf-8'))
# Search filename in stash
function gitsearch()
{
searchCrit='stash\|'$1
git stash list | while IFS=: read STASH ETC; do echo "$STASH: $ETC"; git diff --stat $STASH~..$STASH --; done | grep -e $searchCrit
}
alias githunt=gitsearch
fun addAlphaToColor(originalColor: String, alpha: Float): String {
val alphaFixed = (alpha * 255).roundToLong()
var alphaHex = java.lang.Long.toHexString(alphaFixed)
if (alphaHex.length == 1) {
alphaHex = "0$alphaHex"
}
return originalColor.replace("#", "#$alphaHex")
}
fun getColorPalletWithAlpha(color: String, numberOfColors: Int, minAlpha: Float = 0.15f,