Skip to content

Instantly share code, notes, and snippets.

View el-mubarok's full-sized avatar
💭
Still confuse ... :(

Dwi Arif el-mubarok

💭
Still confuse ... :(
View GitHub Profile
@anastr
anastr / FilesDownloader.kt
Last active September 30, 2024 03:16
multi-file downloader with progress event
import android.content.Context
import android.util.Log
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.schedulers.Schedulers
import io.reactivex.rxjava3.subjects.PublishSubject
import okhttp3.MediaType
import okhttp3.OkHttpClient
// imgLib -> Image package from https://pub.dartlang.org/packages/image
import 'package:image/image.dart' as imglib;
import 'package:camera/camera.dart';
Future<List<int>> convertImagetoPng(CameraImage image) async {
try {
imglib.Image img;
if (image.format.group == ImageFormatGroup.yuv420) {
img = _convertYUV420(image);
} else if (image.format.group == ImageFormatGroup.bgra8888) {
@lucasfeijo
lucasfeijo / FastImagePlaceholder.js
Created July 5, 2019 16:43
react-native-fast-image placeholder wrapper component
import React, { Component } from 'react';
import { Image, View, ViewPropTypes } from 'react-native';
import PropTypes from 'prop-types';
import FastImage from 'react-native-fast-image';
export default class FastImagePlaceholder extends Component {
constructor(props) {
super(props);
this.state = { loaded: false };
}
@tdreyno
tdreyno / airports.json
Created December 13, 2012 18:50
JSON data for airports and their locations
This file has been truncated, but you can view the full file.
[
{
"code": "AAA",
"lat": "-17.3595",
"lon": "-145.494",
"name": "Anaa Airport",
"city": "Anaa",
"state": "Tuamotu-Gambier",
"country": "French Polynesia",