Skip to content

Instantly share code, notes, and snippets.

View TekExplorer's full-sized avatar
👀
Looking for work

Omar Kamel TekExplorer

👀
Looking for work
  • USA
View GitHub Profile
@TekExplorer
TekExplorer / ptero.sh.ideas.md
Created June 9, 2021 16:40
What do i do with ptero.sh?

Give me some Ideas!

@TekExplorer
TekExplorer / featherdactyl.md
Last active August 20, 2023 08:40
Featherdactyl Info and Discussion/Brainstorming

Featherdactyl

What is Featherdactyl?

Featherdactyl is intended to be an app for Pterodactyl Panel made in Flutter. More than that, its intended to add features to any panel without modifications, and for those features that need modifications; it will be done sanely.

Current ideas

  • How should logging in to Feather work?
    • url + api key? url + user + pass?
  • save session as api key or cookies?
@TekExplorer
TekExplorer / main.dart
Created June 12, 2022 18:16
Infinite Plus Buttons
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@TekExplorer
TekExplorer / main.dart
Last active November 29, 2022 22:35
Forever Call
void main() {
C()()()()()()()()()()()()();
}
class C {
const C([this.cnt=1]);
final int cnt;
void main() {
final isIdentical = identical(Singleton(), Singleton());
print(isIdentical);
assert(isIdentical == true);
}
class Singleton {
static final Singleton _instance = Singleton._();
const Singleton._();
@TekExplorer
TekExplorer / copy_with_examples.dart
Last active February 19, 2023 08:43
A gist containing examples for copyWith code that can allow passing in null to a copy.
void main() {
print('Wont pass null into a copy');
final e1 = Example1(id: 1, name: 'hello 1');
final e1Copy = e1.copyWith(name: null);
print('e1: ${e1.id}, ${e1.name}');
print('e1Copy: ${e1Copy.id}, ${e1Copy.name}');
print('\nSubclassing method');
@TekExplorer
TekExplorer / riverpod_mutation_provider.dart
Last active February 21, 2023 22:40
A potential mutation provider for riverpod
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'mutation_provider.g.dart';
class ExampleWidget extends ConsumerWidget {
const ExampleWidget({super.key});
@TekExplorer
TekExplorer / mutation_value_riverpod.dart
Created February 22, 2023 06:35
an AsyncValue clone for mutations, i think.
import 'package:meta/meta.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:stack_trace/stack_trace.dart';
part 'mutation_provider.g.dart';
// generic mutation
@riverpod
MutationState<void> mutation(MutationRef ref, Object mutationKey) {
return MutationState._initial(ref);
@TekExplorer
TekExplorer / main.dart
Last active February 24, 2023 21:34
My best riverpod mutation setup yet!
import 'dart:math';
import 'package:flutter/material.dart';
// could use flutter_riverpod
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'mutation_state.dart';
part 'main.g.dart';
@TekExplorer
TekExplorer / example_websocket.dart
Last active June 4, 2024 03:44
Example websocket handler
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
final _wsProvider = FutureProvider((ref) async {
final ws = YourWebsocket(Uri(/** ... */));
ref.onDispose(ws.dispose);
await ws.connect();