Skip to content

Instantly share code, notes, and snippets.

View saileshbro's full-sized avatar
🇳🇵
Working from home

Sailesh Dahal saileshbro

🇳🇵
Working from home
View GitHub Profile
@saileshbro
saileshbro / setup_firebase.sh
Created January 11, 2024 05:41
This is a Bash script that configures FlutterFire for Android and iOS platforms by looping through each flavor and build mode and running the flutterfire configure command with the specified arguments.
#!/bin/sh
CONFIG_DIR="lib/app/config/firebase"
FLAVORS=("development" "production")
for FLAVOR in "${FLAVORS[@]}"; do
PROJECT="example-prod"
BUNDLE_ID="com.example"
if [ "$FLAVOR" = "development" ]; then
PROJECT="example-dev"
{
"Freezed model Json": {
"prefix": "frzjs",
"scope": "dart",
"isFileTemplate": true,
"body": [
"import 'package:flutter/foundation.dart';",
"import 'package:freezed_annotation/freezed_annotation.dart';",
"",
"part '${TM_FILENAME_BASE/(.*)/${1:/lowercase}/g}.freezed.dart';",
import { firestore, messaging } from 'firebase-admin';
import AppDb from '../enums/app_db.enum';
import { INotification } from '../interfaces/notification.interface';
import { Notification } from '../models/notification/notification.model';
import UserDetails from '../models/user/user_details.model';
import { pathToRef } from './path_to_id';
interface SendNotificationInterface
extends Omit<INotification, 'badge' | 'created_at' | 'notification_ref'> {
@saileshbro
saileshbro / README.md
Created February 28, 2023 16:49 — forked from coolaj86/README.md
/Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

PC Keyboard Hack on OS X 10.8 Mountain Lion

TL;DR

sudo curl \
    -L https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh \
    -o /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

Instructions

environment="default"
# Regex to extract the scheme name from the Build Configuration
# We have named our Build Configurations as Debug-dev, Debug-prod etc.
# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.
# We are using the $CONFIGURATION variable available in the XCode build environment to extract
# the environment (or flavor)
# For eg.
# If CONFIGURATION="Debug-prod", then environment will get set to "prod".
if [[ $CONFIGURATION =~ -([^-]*)$ ]]; then
const _updateStreamFeed = async (
prediction: Prediction,
toUpdate: Record<string, unknown>,
) => {
try {
const streamClient = getStreamClient();
const ref: firestore.DocumentReference = prediction.ref;
const time = new Date().toISOString();
const activity: ActivityPartialChanges<DefaultGenerics> = {
foreign_id: ref.id,
/// Primary key type for a Todo.
typedef TodoId = int;
void main() {
const baseUrl = 'https://weather.com';
const path = '/find';
final uri = Uri.parse(baseUrl + path).replace(
queryParameters: {
'key': 'value',
'q': 'location',
'aqi': 'no',
},
);
@saileshbro
saileshbro / app_test.dart
Created December 4, 2022 13:04 — forked from antonkrasov/app_test.dart
Flutter Automation tutorial files. Dart script to run flutter integration tests on multiple iOs simulators and Android emulators and integration test file itself.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:taskezdev/main.dart' as app;
import 'package:taskezdev/main.dart';
import 'helpers.dart';
void main() {
@saileshbro
saileshbro / main.dart
Created November 15, 2022 11:29
concurrent modification
void main() {
List<int> array = [1,2,3];
array.addAll(array);
print(array);
}