Skip to content

Instantly share code, notes, and snippets.

View akashmishra242's full-sized avatar
:octocat:
building stuff

Akash Mishra akashmishra242

:octocat:
building stuff
View GitHub Profile
@akashmishra242
akashmishra242 / DartAsyncPipeLine.dart
Created January 30, 2025 15:46
/// Executes a list of async functions with error handling. /// /// - [tasks]: A list of async functions to execute. /// - [parallel]: If `true`, tasks are executed in parallel. If `false`, tasks are executed sequentially. /// /// Returns a list of [Result] objects containing either the success value or the error.
import 'dart:async';
void main() async {
// Example tasks
final tasks = [
() async {
print('Task 1: Started');
await Future.delayed(Duration(seconds: 2));
print('Task 1: Completed');
return 'Task 1 Completed';
@akashmishra242
akashmishra242 / ReachOut.txt
Created January 5, 2024 13:20
Reach Me Out.
Akash Mishra
LinkedIn: www.linkedin.com/in/akash-mishra09/
Github: https://github.com/akashmishra242
Email: akashmishra242@gmail.com
Website: mishraakash.me
Whatsapp/call: +91-9580608314
Dear Sir/Ma'am you can whatsapp me, for easy and effective communication an better delivery of services.
@akashmishra242
akashmishra242 / socket_programming.txt
Created September 15, 2023 16:03
socket_programming questions
perform this task in python and nodejs and explain each step:
Task Description: There is a server that has key-value storage. There can be multiple clients which can send requests like ‘GET’, ‘PUT’, and ‘DELETE’ to the server.
The key-value storage, server, and client code is written all from scratch. We were allowed to google anything like syntax, errors, etc. We were even given the option of choosing any language we were comfortable with, I went with Python.
The key-value storage is basically a dictionary in python. So I have written a class which has a dictionary in it and some functions to deal with the ‘GET’, ‘PUT’ and ‘DELETE’ operations.
I wrote code for the server which would be ready to accept clients and can start communicating over TCP protocol, similarly, I wrote code for the client which would be ready to take input from the user for the requests and send it to the server.
After I was done with the task, I still had some time left, I was asked to implement a TTL(Time to live) system for the stor
@akashmishra242
akashmishra242 / video_player.dart
Created July 30, 2023 20:43
flutter code to display video player UI with advanced options
// ignore_for_file: unused_local_variable
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
class VideoPlayerScreen extends StatefulWidget {
final String videoUrl; // Replace with your video URL
@akashmishra242
akashmishra242 / custom_pop_up_menu.dart
Created July 19, 2023 14:32
flutter code to show popup menu.
import 'package:flutter/material.dart';
class CustomPopupMenu extends StatelessWidget {
final List<PopupMenuItem> items;
final Function(int)? onItemSelected;
CustomPopupMenu({
required this.items,
this.onItemSelected,
});
@akashmishra242
akashmishra242 / shake_any_widget.dart
Last active October 10, 2023 14:56
flutter code to shake any given given widget.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class ShakeMyWidgetController {
late ShakeMyWidgetState _state;
void setState(ShakeMyWidgetState state) {
_state = state;
@akashmishra242
akashmishra242 / validator.dart
Created July 14, 2023 19:33
Regular expression for most commonly used validation.
class Constants {
// Email Validation Regex
static const String emailRegex =
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$';
// URL Validation Regex
static const String urlRegex =
r'^(https?|ftp)://[^\s/$.?#].[^\s]*$';
// Date Validation Regex
@akashmishra242
akashmishra242 / country_full_details.json
Created July 14, 2023 18:34
Country with full details
[
{
"name": "Afghanistan",
"code": "AF",
"capital": "Kabul",
"region": "AS",
"currency": {
"code": "AFN",
"name": "Afghan afghani",
"symbol": "؋"
@akashmishra242
akashmishra242 / wave_loading_animation.dart
Created July 14, 2023 15:26
flutter code to show wave type loading animation without using any external package.
import 'package:flutter/material.dart';
void main() {
runApp(TestApp());
}
class TestApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@akashmishra242
akashmishra242 / YOLO_face_detection.ipynb
Last active March 12, 2023 06:06
Implementation of Yolo to detect your face.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.