Skip to content

Instantly share code, notes, and snippets.

View Maverick-I0's full-sized avatar
:shipit:
Conductor at the bits orchestra.

Adithya Shetty Maverick-I0

:shipit:
Conductor at the bits orchestra.
View GitHub Profile
@Maverick-I0
Maverick-I0 / TableSelectDialogValueHelp.fragment.xml
Last active May 18, 2025 13:51
A value help that loads all the data on call, with a basic search functionality, all on the TableSelectDialog from SAP UI5 framework
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
>
<TableSelectDialog
id="ValueHelpTableWithSearch-dialog"
noDataText="No items found. You also may close and reopen the dialog to refresh the data."
showClearButton="true"
class="sapUiResponsivePadding--header sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer"
busyIndicatorSize="Auto"
@Maverick-I0
Maverick-I0 / sinppets.js
Last active May 18, 2025 07:35
A simple odata v4 CRUD operations in UI5 development
try {
this.getView().setBusy(true);
let oModel = this.getOwnerComponent().getModel("oDataV4Model");
// data is an object containing the properties for the new entry
const data = {key_1: "value_1", property_1: "value_2"};
const oModelListBinding = oModel.bindList("/entity");
// Create:
oModelListBinding.create({
@Maverick-I0
Maverick-I0 / TechLines.dart
Created June 6, 2021 04:52
Creates a connected tech lines with random loction of connections
import 'dart:math' show Random;
import 'dart:ui' as ui show Gradient;
import 'package:flutter/material.dart';
class TechnologicalLinesAnimation extends StatefulWidget {
_TechnologicalLinesAnimationState createState() => _TechnologicalLinesAnimationState();
}
class _TechnologicalLinesAnimationState extends State<TechnologicalLinesAnimation> {
@Maverick-I0
Maverick-I0 / char2hex.cpp
Last active January 23, 2021 13:10
A simple function to converts characters to its ASCII hex value. The function takes in the character and returns the ASCII HEX value for the character as string.
static string char2Hex(unsigned char _char) {
string hex;
int ascii_int = int(_char);
char hex_array[20];
int i = 0;
while (ascii_int != 0) {
int temp = 0;
temp = ascii_int % 16;
if (temp < 10) {
@Maverick-I0
Maverick-I0 / main.dart
Last active April 30, 2021 12:08
The App gets the result HTTP request and then writes it to a local JSON file.
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:path_provider/path_provider.dart';
void main() {
runApp(MyApp());
}
@Maverick-I0
Maverick-I0 / download.dart
Created October 29, 2020 11:21
Simple Http get request using HTTP plugin and writing the file to a local file in app support directory.
downloadFile() async {
// Your stored url.
String url =
"add url";
// Getting the http response
Response response = await get(url);
int statusCode = response.statusCode;
print(statusCode); // for debugging purpose
@Maverick-I0
Maverick-I0 / VegNonVegIcon.dart
Last active April 30, 2021 12:13
Code renders veg or non veg icon inside your app.
/// Renders veg or Non veg icon according t0 [vegOrNonVeg].
/// [height], [width] specifies size of the icon.
class VegNonVegIcon extends StatefulWidget {
final double height;
final double width;
final bool vegOrNonVeg;
VegNonVegIcon({
@required this.width =1.5,
@required this.height =1 ,
@Maverick-I0
Maverick-I0 / getDistance.dart
Last active April 25, 2021 09:02
Shortest distance Between Geo-Coordinates In Dart using Haversine formula
import 'dart:math' show pi, pow;
void main() {
final double lat1=50.06638889;
final double lat2=58.64388889;
final double lng1=5.71472222;
final double lng2=3.06777778;
/// Calculates the minimum distance between ([lat1],[lng1]) and ([lat2],[lng2]).
/// The function returns the distance in meters.
@Maverick-I0
Maverick-I0 / main.dart
Last active April 30, 2021 12:15
Gist to find the total elevation gained in a trek or other use case.
void main() {
// This jut stimulates elevations in a small trip
// instead of this list call the functions whenever you record a elevation.
// and on the end of the trip call the [onStopTrip] function.
List<double> listOfDemoElevations = [
200.0,
300.0,
400.0,
1000.0,
800.0,
@Maverick-I0
Maverick-I0 / topMenu.dart
Created August 25, 2020 08:07
Top menu bar in Flutter with menu icon and Profile Icon
class TopMenu extends StatefulWidget {
_TopMenuState createState() => _TopMenuState();
}
class _TopMenuState extends State<TopMenu> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(0.0, 35.0, 0.0, 0.0),