Skip to content

Instantly share code, notes, and snippets.

View bluemix's full-sized avatar
🖐️
Hello There :D

Abdulmomen Bsruki bluemix

🖐️
Hello There :D
View GitHub Profile
@bluemix
bluemix / flutter_animated_counter.dart
Created October 26, 2021 14:08
Animated Counter Text for Flutter
class AnimatedCount extends ImplicitlyAnimatedWidget {
AnimatedCount({
Key? key,
required this.count,
Duration duration = const Duration(milliseconds: 600),
Curve curve = Curves.fastOutSlowIn,
}) : super(duration: duration, curve: curve, key: key);
final num count;
@bluemix
bluemix / number-to-arabic-words.kt
Last active August 24, 2023 19:15
Converts numbers to Arabic words
import java.lang.StringBuilder
import java.math.BigDecimal
import java.math.BigInteger
import java.math.RoundingMode
import java.util.ArrayList
object ArabicTools {
fun numberToArabicWords(n: String?): String {
return numberToArabicWords(n, false)
}
@bluemix
bluemix / album_thumbs.kt
Last active August 28, 2021 13:49
playground: jetpack compose album images thumbs
package com.example.playground_bottomnavbar_api
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.*
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
@bluemix
bluemix / ranslate-transition-flutter.dart
Created April 13, 2019 11:10
TranslateTransition for Flutter
class TranslateTransition extends AnimatedWidget {
const TranslateTransition({
Key key,
@required Animation<double> translate,
this.alignment = Alignment.center,
this.child,
}) : super(key: key, listenable: translate);
Animation<double> get translate => listenable;
@bluemix
bluemix / gradient-text-flutter.dart
Last active June 29, 2020 05:56
Creating text gradient in Flutter
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Shader linearGradient = LinearGradient(
@bluemix
bluemix / Odoo-RPC-Backup.py
Created December 3, 2017 10:09
A Python script to make a database backup for Odoo 9, 10, and 11
import base64
import xmlrpclib
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/db')
# backup will be saved to backup.dump file
backup_file = open('backup.dump', 'wb')
# database name: auc_odoo_db
# database master password: admin
@bluemix
bluemix / CommonExtensions.kt
Last active June 6, 2017 22:16 — forked from adavis/CommonExtensions.kt
Common Android Extensions in Kotlin
fun View.visible() {
visibility = View.VISIBLE
}
fun View.invisible() {
visibility = View.INVISIBLE
}
fun View.gone() {
visibility = View.GONE
@bluemix
bluemix / rxjava_rxandroid_retrolambda_event_bus.md
Last active December 22, 2016 07:54
RxAndroid and Retrolambda as an EventBus

RxBus.Java

public class RxBus {
    private static RxBus myInstance = new RxBus();
    private final Subject<Object, Object> _bus = new SerializedSubject<>(PublishSubject.create());
    ...
    
    public static RxBus singleton() {
 if (myInstance == null) {
@bluemix
bluemix / retrofit_rxjava_retrolambda_android.md
Created December 21, 2016 06:24
Retrofit with RxAndroid and Retrolambda

FooService.java

public interface FooService {
    ...
    
    @GET("allVideoInfo/id/{videoid}")
    Observable<VideoModel> getAllVideoInfo(@Path("videoid") String videoId);
    
    ...