Skip to content

Instantly share code, notes, and snippets.

:octocat:
Githubbing

Pavitra Golchha pavi2410

:octocat:
Githubbing
View GitHub Profile
@pavi2410
pavi2410 / androidstats.ps1
Created May 4, 2020
Get Android API Distribution Stats right from PowerShell
View androidstats.ps1
Invoke-RestMethod https://dl.google.com/android/studio/metadata/distributions.json | Format-Table name, version, apiLevel, @{ Label = 'distribution'; Expression = { "$([math]::Round($_.distributionPercentage * 100, 1))%" }; Align = "right" }
View ppsassignmentunit5.c
#include <stdio.h>
#include <string.h>
#include <time.h>
struct Book {
int BookNumber;
char BookTitle[100];
char Author[100];
char Publisher[100];
int YearOfPublication;
@pavi2410
pavi2410 / Replace template
Last active Apr 22, 2020
IntelliJ Structural Replace for changing annotation value
View Replace template
@UsesPermissions({
$LList$
})
@pavi2410
pavi2410 / SimpleLabel.java
Created Mar 30, 2020
GSOC Proposal for Visible Component Extensions in App Inventor
View SimpleLabel.java
package test;
import android.view.View;
import android.widget.TextView;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidViewComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
View SadnessOfArray.c
#include <stdio.h>
int main() {
int n;scanf("%d", &n);
int arr[n];
int i, j;
for(i=0;i<n;i++)
scanf("%d", &arr[i]);
int res[n];
@pavi2410
pavi2410 / pizza.kt
Created Jan 26, 2020
Pizza Hashcode
View pizza.kt
val max = 17
val numTypes = 4
val types = listOf(2, 5, 6, 8)
fun main() {
val r = types.mapIndexed { i, t -> i to t }
.sortedByDescending { (i, t) -> t }
val f = mutableListOf<Int>()
View macros.h
/* STMT, useful for creating multiple statements macros */
#define STMT( stuff ) do { stuff } while (0)
/* Loops */
#define FOREVER for(;;)
#define FOR(i,a,b) for(i=(a);(i<=(b));((i)++))
#define FOREACH(i, A) for(int _keep=1, \
_count=0,\
@pavi2410
pavi2410 / KeyStore.java
Last active Jan 28, 2019
Get Keystore SHA1 from a keystore file programmatically in Java
View KeyStore.java
package tk.pavi2410;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
View Android_Display.bsh
import android.graphics.*;
import android.view.*;
import android.util.*;
round(n) {
return Math.round(n*100.0)/100.0;
}
WindowManager wm = (WindowManager) ctx.getSystemService("window");
dm = new DisplayMetrics();
You can’t perform that action at this time.