Skip to content

Instantly share code, notes, and snippets.

View LOG-TAG's full-sized avatar

Subrahmanya S M LOG-TAG

View GitHub Profile
@slightfoot
slightfoot / ascii_to_bin.dart
Last active February 22, 2021 16:16
Functions that convert ascii text strings of integers and floats/doubles to binary values computers use - by Simon Lightfoot - 22/01/2021
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@rodydavis
rodydavis / flutter_device_utils.dart
Created June 7, 2020 21:20
Flutter Device Utils
import 'package:flutter/foundation.dart';
import 'dart:io';
bool get isWeb => kIsWeb;
bool get isMobile => !isWeb && (Platform.isIOS || Platform.isAndroid);
bool get isDesktop =>
!isWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux);
bool get isApple => !isWeb && (Platform.isIOS || Platform.isMacOS);
bool get isGoogle => !isWeb && (Platform.isAndroid || Platform.isFuchsia);
@slightfoot
slightfoot / main.dart
Last active April 16, 2020 16:07
Animated Button: Animates is size and content after being pressed - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@PeterHdd
PeterHdd / main.dart
Last active October 16, 2020 08:11
article
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:firebase_test/home.dart';
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/painting.dart';
// sample code
/*
class CornerDecorationTest extends StatefulWidget {
@override
_CornerDecorationTestState createState() => _CornerDecorationTestState();
}
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
const kMainColor = Color(0xFF573851);
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@lukepighetti
lukepighetti / extents_page_view.dart
Last active January 3, 2023 13:48
Flutter PageView that loads the next/previous page off-screen
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart' hide PageView;
/// This is copy-pasted from the Flutter framework with a support added for building
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder]
///
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev
// Having this global (mutable) page controller is a bit of a hack. We need it
import 'package:firebase_messaging/firebase_messaging.dart';
class PushNotificationsManager {
PushNotificationsManager._();
factory PushNotificationsManager() => _instance;
static final PushNotificationsManager _instance = PushNotificationsManager._();
@Timtech4u
Timtech4u / Dockerfile
Last active July 9, 2019 13:10
Source Codes for Google Cloud Run Article
# Use the official Node.js 10 image.
# https://hub.docker.com/_/node
FROM node:10
# Create and change to the app directory.
WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
public String[] getSplitNames(Context context){
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return packageInfo.splitNames;
}
}catch (Exception e ){
e.printStackTrace();