Skip to content

Instantly share code, notes, and snippets.

View dipendra-sharma's full-sized avatar

Dipendra Sharma dipendra-sharma

View GitHub Profile
@dipendra-sharma
dipendra-sharma / README.md
Created February 18, 2025 20:28 — forked from abelcallejo/README.md
Creating bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg

@dipendra-sharma
dipendra-sharma / custom_gesture_detector.dart
Created January 23, 2025 11:19 — forked from GAM3RG33K/custom_gesture_detector.dart
Advanced multi touch gesture detection in flutter
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'multi_drag_gestures.dart';
typedef GestureMultiDragUpdateCallback = void Function(
Offset initialPosition, Offset latestPosition, double delta);
typedef GestureMultiDragEndCallback = void Function(
Offset initialPosition, Offset latestPosition, double delta);
typedef GestureMultiDragCancelCallback = void Function();
@dipendra-sharma
dipendra-sharma / contemplative-llms.txt
Created January 8, 2025 13:08 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@dipendra-sharma
dipendra-sharma / docker-compose.yml
Created October 16, 2024 17:05 — forked from shinux/docker-compose.yml
mac m1 (Apple Silicon) docker kafka (include zookeeper)
version: "2"
services:
zookeeper:
image: docker.io/bitnami/zookeeper:3
ports:
- "2181:2181"
volumes:
- "zookeeper_data:/bitnami"
environment:
@dipendra-sharma
dipendra-sharma / app_initializer.dart
Created June 28, 2024 09:23
A lightweight, flexible Flutter widget for managing app initialisation with a customisable splash screen.
class AppInitializer extends StatefulWidget {
final Future Function() onAppInit;
final Widget Function(BuildContext) splashBuilder;
final Widget Function(BuildContext) appBuilder;
const AppInitializer(
{super.key,
required this.splashBuilder,
required this.appBuilder,
@dipendra-sharma
dipendra-sharma / osx_setup.md
Created March 13, 2024 10:22 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@dipendra-sharma
dipendra-sharma / rebuilder.dart
Last active March 14, 2024 09:14
A reusable Flutter widget that efficiently rebuilds when the underlying data changes, supporting various data sources like ValueListenable, Listenable.
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
typedef Selector<T, V> = V Function(T value);
typedef WidgetReBuilder<T> = Widget Function(
BuildContext context, T value, Widget? child);
class ReBuilder<T> extends StatefulWidget {
final WidgetReBuilder<T> builder;
final List<Selector<T, dynamic>> selectors;
@dipendra-sharma
dipendra-sharma / future_debouncer.dart
Last active March 13, 2024 10:14
This gist demonstrates how to implement debounce functionality in Dart using the `dart:async` library. Debounce is a technique used to delay the execution of an action until a certain amount of time has passed without any further invocations.
import 'dart:async';
class Debouncer {
final Duration delay;
Timer? _timer;
Debouncer({required this.delay});
Future<T> run<T>(Future<T> Function() action) async {
if (_timer != null) {
@dipendra-sharma
dipendra-sharma / service_locator.dart
Last active March 13, 2024 10:20
Discover a streamlined approach to dependency injection with this Dart Service Locator Gist, designed to enhance your Flutter or Dart applications. This robust pattern simplifies dependency management, promoting clean architecture and maintainable code. The ServiceLocator class empowers developers to register dependencies and retrieve service in…
class _ServiceLocator {
final Map<Type, dynamic> _singletons = <Type, dynamic>{};
final Map<Type, Function> _factories = <Type, Function>{};
// Private constructor
_ServiceLocator._();
// Public accessor
static final _ServiceLocator instance = _ServiceLocator._();
@dipendra-sharma
dipendra-sharma / interactive_viewer_with_rotation.dart
Created December 20, 2023 11:37
Implementing rotation functionality within InteractiveViewer would be highly beneficial. For those looking to incorporate similar features.
class InteractiveViewerWithRotation extends StatefulWidget {
final Widget child;
const InteractiveViewerWithRotation({super.key, required this.child});
@override
State<InteractiveViewerWithRotation> createState() =>
_InteractiveViewerWithRotationState();
}