Skip to content

Instantly share code, notes, and snippets.

Avatar

Ferri Sutanto ghprod

  • Purwokerto, Indonesia
View GitHub Profile
@ghprod
ghprod / bmi.dart
Created Sep 25, 2020 — forked from roipeker/bmi.dart
BMI Calculator clone with GetX (+ Theme modes)
View bmi.dart
import 'dart:async';
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:get/get.dart';
@ghprod
ghprod / README.md
Created Aug 3, 2020 — forked from CodingDoug/README.md
Patterns for security with Firebase Authentication: offload work to Cloud Functions
View README.md

This is the runnable sample code from the blog post [Patterns for security with Firebase Authentication: offload work to Cloud Functions][1]. It discusses offloading work from a client app to Cloud Functions using an authentication trigger.

  1. Create a new Firebase project
  2. Enable email/password authentication
  3. Provision Cloud Firestore and apply the rules given in this gist
  4. Use the Firebase CLI to create a workspace for Functions using TypeScript
  5. Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work).
  6. Deploy the function code to Cloud Functions using the Firebase CLI
@ghprod
ghprod / main.dart
Last active Jul 31, 2020
GetX Debug Template
View main.dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
initialRoute: '/',
@ghprod
ghprod / fade_on_scroll.dart
Created Jul 29, 2020 — forked from smkhalsa/fade_on_scroll.dart
A Widget that automatically fades its child based on scroll position
View fade_on_scroll.dart
import 'package:flutter/material.dart';
class FadeOnScroll extends StatefulWidget {
final ScrollController scrollController;
final double zeroOpacityOffset;
final double fullOpacityOffset;
final Widget child;
FadeOnScroll(
{Key key,
@ghprod
ghprod / main.dart
Created Jun 28, 2020 — forked from PetreaLoredana/main.dart
This code generates a screen with a custom bidirectional and infinite scrollable PageView in Flutter. Replace your own assets names. More details can be found on Medium. https://medium.com/p/dfff43649c23/edit
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(CustomPageViewApp());
class CustomPageViewApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
@ghprod
ghprod / main.dart
Created Jun 8, 2020
flutter bug floatingLabelBehavior not obey InputDecorationTheme
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
inputDecorationTheme: InputDecorationTheme(
@ghprod
ghprod / main.dart
Created Jun 8, 2020
flutter bug floatingLabelBehavior not obey InputDecorationTheme
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
inputDecorationTheme: InputDecorationTheme(
@ghprod
ghprod / main.dart
Created May 14, 2020 — forked from MarcinusX/main.dart
Ripple effect transition
View main.dart
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fab overlay transition',
@ghprod
ghprod / random-readable-word.php
Created Jan 29, 2019
Generate random readable word by length
View random-readable-word.php
<?php
/**
* Generates human-readable string.
*
* @param string $length Desired length of random string.
*
* retuen string Random string.
*/
function readable_random_string($length = 6)
{
@ghprod
ghprod / freenom.js
Created Jan 26, 2019
Helper to set Period and NameServer
View freenom.js
$('select.select_period').val('12M').trigger('change');
$('.freenomBtn.useDNS').click();
$('.freenomBtn.useOwnDNS').click();
$('input[id*="_dn1"]').val('');
$('input[id*="_dn2"]').val('');