Skip to content

Instantly share code, notes, and snippets.

View Taosif7's full-sized avatar
🎯
Focusing

Taosif Jamal Taosif7

🎯
Focusing
View GitHub Profile
@Taosif7
Taosif7 / travel_filter_criteria_simplified.dart
Created December 1, 2025 19:13
A simplified example of how travel filter criteria would plug into domains
// Shared enum for all verticals
enum TravelDomain { stay, flight, bus, train, store }
// Domain-specific implementation
TravelFilterCriteria buildStayFilterCriteria({
required MasterFilters masterFilters,
required int totalCount,
required StaySearchRequest initialRequest,
required StayService stayService,
}) {
@Taosif7
Taosif7 / travel_filter_controller_concept.dart
Created December 1, 2025 18:45
Conceptual implementation of Travel filter controller
class TravelFilterController {
MasterFilters? masterFilters;
MasterFilters? userSelectedFilters;
MasterFilters? lastAppliedFilters;
bool get hasAnyFilterApplied =>
userSelectedFilters?.selectionFilters?.isFilterApplied ?? false;
void onFilterOptionTapped(String filterId, String optionId) {
// delegate to selection/slider/toggle controller managing their state
@Taosif7
Taosif7 / master_filter_example.json
Created December 1, 2025 08:10
Sample json showing how master filters are formed using JSON
{
"sortInfo": {
"sortOptions": [
{
"id": "PRICE_LOW_TO_HIGH",
"isApplied": false,
"presentation": {
"title": "Price: Low to High"
}
}
@Taosif7
Taosif7 / flcp.sh
Last active October 20, 2024 12:07
A Bash Script to Copy flutter generated build outputs in a proper format
#!/bin/bash
# Check if pubspec.yaml file exists
if [ ! -f "pubspec.yaml" ]; then
echo "⚠️ Please run command in a Flutter project"
exit 1
fi
# Get the value of "name: value"
projectName=$(awk '/name:/ {print $2}' pubspec.yaml)
@Taosif7
Taosif7 / SampleCode.dart
Created October 16, 2022 09:09
TempFile
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
var empResponse = await getEmployeeById(256);
if(empResponse.employee != null){
print("EMPLOYEE NAME: "+empResponse.employee.name);
}else{
print("EMPLOYEE DOES NOT EXIST");
}
@Taosif7
Taosif7 / resume.json
Last active August 31, 2022 04:44
Taosif Jamal Resume
{
"basics": {
"name": "Taosif Jamal",
"label": "Software Engineer",
"image": "",
"email": "[email protected]",
"phone": "(91) 9638804660",
"summary": "A summary of John Doe…",
"location": {
"address": "6th Block, Kormangala",
@Taosif7
Taosif7 / ListValueNotifier.dart
Last active August 21, 2022 18:17
A List implementation, that notifies on every change
import 'dart:math';
import 'package:flutter/foundation.dart';
class ListValueNotifier<T> extends ChangeNotifier implements ValueListenable<Iterable<T>>, List<T> {
ListValueNotifier(this._value);
List<T> _value;
@override
@Taosif7
Taosif7 / git-diff-zip.bat
Last active February 7, 2022 08:42
A batch script that zips the changed files from provided commit with folder stucture
@echo off
setlocal EnableDelayedExpansion
REM ## Remove diff file if exists
if exist diff-filelist.txt del /f diff-filelist.txt
REM ## set output file name
set "outputFileName=%2"
IF "%~2" == "" ( SET "outputFileName=output.zip" )
@Taosif7
Taosif7 / RoundToPrecisionMultiple.php
Created November 6, 2021 18:41
A functon to round a float number to particular float multiple.
/**
* Function to round a number to a precision multiple
*
* @param float $number original number
* @param float $pointMultiple the point multiple to which it needs to be rounded
* @param bool $roundDown whether to round up or down
* @param int $precision precision for rounding
* @return float rounded float number
*/
function roundToPrecisionMultiple(float $number,
@Taosif7
Taosif7 / transpose_list.dart
Created August 27, 2021 22:27
Transpose a 2D rectangle Dart list
List<List<R>> transposeList<R>(List<List<R>> input) {
List<List<R>> output = [];
// Check for rectangle matrix
if (input.any((element) => element.length != input[0].length)) {
throw FormatException('Not a rectangle Matrix');
}
for (int i = 0; i < input[0].length; i++) {
output.add(List<R>.generate(input.length, (idx) => null));