Skip to content

Instantly share code, notes, and snippets.

View pavi2410's full-sized avatar
:octocat:
Githubbing

Pavitra Golchha pavi2410

:octocat:
Githubbing
View GitHub Profile
Press the black button😉
<⚫> 👈🏻 ‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎ ‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎ ‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎ ‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎ ‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎‏‎ ‎‏‎‏
@pavi2410
pavi2410 / OdeMessagesRegex
Last active August 1, 2018 12:39
Regex to find and format methods for OdeMessages.java. Use https://regexr.com/
// Find
symbol: +method (.+)
// Format
@DefaultMessage("")\n@Description("")\nString $1;\n\n
------------------------------------------------------
// or much powerful (but still needs to set component description manually)
// find
@pavi2410
pavi2410 / PayTM.java
Last active October 27, 2021 01:42
PayTM payments extenstion for App Inventor
package com.pavitra;
import android.app.Activity;
import android.util.Log;
import android.content.Context;
import android.widget.Toast;
import com.paytm.pgsdk.PaytmOrder;
import com.paytm.pgsdk.PaytmPGService;
import com.paytm.pgsdk.PaytmPaymentTransactionCallback;
@pavi2410
pavi2410 / java2jar.bat
Last active January 24, 2018 19:15
This script compiles java files from java folder and puts class files into classes folder which are then compiled into a jar file in build folder.
:: This script compiles java files from
:: java folder and puts class files into
:: classes folder which are then compiled
:: into a jar file in build folder.
:: FILES HEIRARCHY
:: example
:: |_ build
:: | |_ compiled.jar (generated - Final packaged jar file)
:: |_ classes (generated - Contains compiled class files)
@pavi2410
pavi2410 / forloop.bat
Created January 13, 2018 18:57
Some useful batch codes examples
setlocal EnableDelayedExpansion
echo Searching for java files...
set JAVA_FILES=
for %%i in (java\*.java) do set JAVA_FILES=!JAVA_FILES! %%i && echo %%i
echo Found Java Files:%JAVA_FILES%
@pavi2410
pavi2410 / Android.java
Created December 29, 2017 20:22
Get the value of android:name attribute of all activities of an app.
public String getParentPackageName() {
PackageManager pm = context.getPackageManager();
String packageName = context.getApplicationContext().getPackageName();
PackageInfo pi;
try {
pi = pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
@pavi2410
pavi2410 / Blockly.js
Last active June 5, 2021 13:07
Some useful codes
var ws = Blockly.getMainWorkspace() // Get workspace
var backpack = Blockly.getMainWorkspace().getBackpack() // get backpack
var yail = Blockly.Yail // Access yail generator
var repl = Blockly.ReplMgr // Access REPL
ws.getAllBlocks // Get all blocks
@pavi2410
pavi2410 / jartf.bat
Last active December 24, 2017 16:21
Prints classes in a JAR file to *.jar.txt file
@echo off
for %%f in (*.jar) do echo %%f && jar tf %%f > %%f.txt
@pavi2410
pavi2410 / aar2jar.py
Last active January 20, 2021 05:21
Extract JAR from AAR
import zipfile, os
for file in os.listdir():
if file.endswith('.aar'):
print('aar:', file)
with zipfile.ZipFile(file) as aar:
aar.extract('classes.jar')
os.rename('classes.jar', os.path.splitext(file)[0] + '.jar')
@pavi2410
pavi2410 / SimpleMaths.java
Last active August 6, 2021 19:34
Create an extension for Kodular
package io.kodular; // package of the extension will be "com.kodular.SimpleMaths"
// Only these imports are required to interact with Kodular
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.*;
@DesignerComponent(version = 1, // Update version here, You must do for each new release to upgrade your extension
description = "Simple Maths extension created by you",
category = ComponentCategory.EXTENSION,