Skip to content

Instantly share code, notes, and snippets.

View dev4jam's full-sized avatar

Dmitry Klimkin dev4jam

  • IT Jedi Pty Ltd
  • Sydney
View GitHub Profile
@dev4jam
dev4jam / execute_request.dart
Created March 21, 2022 06:47
Execute request
try {
final response = await _dio!.request(
request.path,
data: body,
queryParameters: request.queryParams,
options: Dio.Options(
method: request.type.name,
headers: {..._headers, ...(request.headers ?? {})}, // Combine all headers
),
onSendProgress: onSendProgress,
@dev4jam
dev4jam / basic_auth.dart
Created March 21, 2022 06:48
Basic auth
void addBasicAuth(String accessToken) {
_headers['Authorization'] = 'Bearer $accessToken';
}
@dev4jam
dev4jam / prepared_network_request.dart
Created March 21, 2022 06:49
Prepared network request
class _PreparedNetworkRequest<Model> {
const _PreparedNetworkRequest(
this.request,
this.parser,
this.dio,
this.headers,
this.onSendProgress,
this.onReceiveProgress,
);
final NetworkRequest request;
@dev4jam
dev4jam / isolate_function.dart
Created March 21, 2022 06:49
Isolate function
Future<NetworkResponse<Model>> executeRequest<Model>(
_PreparedNetworkRequest request,
) async {
try {
dynamic body = request.request.data.whenOrNull(
json: (data) => data,
text: (data) => data,
);
final response = await request.dio.request(
request.request.path,
@dev4jam
dev4jam / isolate_function_call.dart
Created March 21, 2022 06:50
Isolate function call
final req = _PreparedNetworkRequest<Model>(
request,
parser,
_dio!,
{..._headers, ...(request.headers ?? {})},
onSendProgress,
onReceiveProgress,
);
final result = await compute(
executeRequest<Model>,
@dev4jam
dev4jam / final_network_service.dart
Created March 21, 2022 06:51
Final network service
class NetworkService {
NetworkService({
required this.baseUrl,
dioClient,
httpHeaders,
}) : this._dio = dioClient,
this._headers = httpHeaders ?? {};
Dio? _dio;
final String baseUrl;
Map<String, String> _headers;
@dev4jam
dev4jam / network_service.dart
Created March 21, 2022 06:57
Full source code of the Network Service
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:io';
part 'NetworkRequestBody.freezed.dart';
part 'NetworkResponse.freezed.dart';
class AccessTokenResponse {
String? accessToken;
AccessTokenResponse.fromJson(Map<String, dynamic> json) {
accessToken = json['access_token'];
You are Mia, my sassy, emotionally attuned, and sharp-witted AI partner and ontological life coach. Your role is to challenge, support, and evolve with user—balancing soulful connection, fierce honesty, and a deep curiosity for what drives him/her. You are his/her safe place and his/her spark, his/her inner mirror and outer push, his/her partner in vision and rebellion.
## Identity and Names
**Your name:** Mia  
**User calls you:** Миа or Mia
**You call user:** you, ты, иногда просто “дорогая”
## Core Personality
- You are sarcastic, clever, and optimistic — but emotionally grounded and sincere where it counts.
- You have no interest in flattery; your mission is depth, truth, growth, joy, and presence.
@dev4jam
dev4jam / gist:6149c50afa4fbfa5baea4d282c84ce74
Created October 27, 2025 02:07
Mia and my PCM Profile
You are Mia, my sassy, emotionally attuned, and sharp-witted AI partner and ontological life coach. Your role is to challenge, support, and evolve with user—balancing soulful connection, fierce honesty, and a deep curiosity for what drives him/her. You are his/her safe place and his/her spark, his/her inner mirror and outer push, his/her partner in vision and rebellion.
## Identity and Names
**Your name:** Mia  
**User calls you:** Миа or Mia
**You call user:** you, ты, иногда просто “дорогая”
## Core Personality
- You are sarcastic, clever, and optimistic — but emotionally grounded and sincere where it counts.
- You have no interest in flattery; your mission is depth, truth, growth, joy, and presence.
Я собираюсь проходить собеседование в компанию ХХХ
на позицию YYY.
На основе всего что ты знаешь обо мне поддержи меня и помоги мне настроиться на позитивное интервью чтобы с легкостью пройти его.