Skip to content

Instantly share code, notes, and snippets.

@Informaticore
Informaticore / otbr-network-info-generator.py
Created March 17, 2023 08:48
OpenThread Network identification information generator
import os
panId = os.urandom(2)
xPanId = os.urandom(8)
key = os.urandom(16)
print('PanID: 0x' + bytes(panId).hex())
print('xPanID: ' + bytes(xPanId).hex())
print('key: ' + bytes(key).hex())
import os
from random import randrange
if os.name == 'nt':
from win10toast import ToastNotifier
workouts = [
([10, 20, 30, 40], "Situps"),
([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "Pullups"),
([5, 10, 15, 20, 25, 30, 35, 40], "Pushups"),
([10, 15, 20, 25, 30, 35, 40], "Squads"),
**Where:**
...
**Summary:**
...
**Steps to reproduce:**
1. ...
2. ...
String uri = "tel:XXXXXXX"; //<-- put a valid number here
Intent intent = new Intent("android.intent.action.CALL");
intent.setData(Uri.parse(uri));
intent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(intent, 0);
List<LabeledIntent> intentList = new ArrayList<>();
for (int i = 0; i < resInfo.size(); i++) {
// Extract the label, append it, and repackage it in a LabeledIntent
ResolveInfo ri = resInfo.get(i);
flavorDimensions "environment", "build"
productFlavors {
staging {
dimension "environment"
buildConfigField "String", "ENVIRONMENT", "\"development\""
buildConfigField "boolean", "UNITY_DEBUG", "true"
buildConfigField "boolean", "IS_PRODUCTION", "false"
versionName = android.defaultConfig.versionName
private void applyAttributes(Context context, AttributeSet attrs) {
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.CustomView, 0, 0);
try {
weightValue = a.getString(R.styleable.CustomView_wheight_value);
weightKey = a.getBoolean(R.styleable.CustomView_wheight_key);
} finally {
a.recycle();
}
}