Skip to content

Instantly share code, notes, and snippets.

View codebythura's full-sized avatar
🎯
Focusing

Thura Aung codebythura

🎯
Focusing
View GitHub Profile
@GabLeRoux
GabLeRoux / dynamicCoinChange.py
Last active April 20, 2020 07:40
Python Dynamic Coin Change Algorithm
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# T: an array containing the values of the coins
# L: integer wich is the total to give back
# Output: Minimal number of coins needed to make a total of L
def dynamicCoinChange( T, L ):
Opt = [0 for i in range(0, L+1)]
@titoaesj
titoaesj / .kt
Last active July 14, 2025 09:41
Android convert int to dp
OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics())
##KOTLIN
val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
val Float.dp: Int
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@mkiisoft
mkiisoft / Fancy Button - Flutter
Created June 22, 2019 03:44
Fancy Button made for Flutter Games and Apps
import 'package:flutter/material.dart';
class FancyButton extends StatefulWidget {
const FancyButton({
Key key,
@required this.child,
@required this.size,
@required this.color,
this.duration = const Duration(milliseconds: 160),
this.onPressed,
@Andrious
Andrious / alarm_manager.dart
Last active March 1, 2022 05:38
A Dart library file that works with the Flutter plugin, android_alarm_manager.
///
/// Copyright (C) 2020 Andrious Solutions
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
@flutter-clutter
flutter-clutter / overlay_with_hole.dart
Created June 27, 2020 12:08
Flutter overlay with a hole
import 'package:flutter/material.dart';
class OverlayWithHole extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Flutterclutter: Holes")),
body: _getExperimentOne()
);
}
@Maadhav
Maadhav / SABT.dart
Created July 29, 2020 04:07
Hide title in Flutter SliverAppBar on scroll
class SABT extends StatefulWidget {
final Widget child;
const SABT({
Key key,
@required this.child,
}) : super(key: key);
@override
_SABTState createState() {
return new _SABTState();
}
@eduardoflorence
eduardoflorence / main.dart
Created December 24, 2020 20:03
GetX - Sample GetConnect
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@tolo
tolo / nested_navigation_shell_route.dart
Last active March 23, 2024 07:49
Example showing how to use go_router to build persistent nested navigation (i.e. separate nested navigation trees) with a BottomNavigationBar.
// This temporary implementation is now obsolete, see instead:
// https://pub.dev/documentation/go_router/latest/go_router/StatefulShellRoute-class.html
@decodeandroid
decodeandroid / LineChartCompose.kt
Created May 23, 2024 06:41
Line Chart Jetpack Compose Canvas
@Preview(showBackground = true, showSystemUi = true)
@Composable
fun ShowLineChartPreview() {
val chartData = listOf(
Pair(1, 1.5),
Pair(2, 1.75),
Pair(3, 3.45),
Pair(4, 2.25),
Pair(5, 6.45),
Pair(6, 3.35),