Skip to content

Instantly share code, notes, and snippets.

View ajilo297's full-sized avatar
:octocat:
Working

Ajil Oommen ajilo297

:octocat:
Working
  • Bangalore, India
View GitHub Profile
@ajilo297
ajilo297 / combine_coverage.sh
Created May 22, 2023 16:29
Combine coverage for a melos monorepo for flutter
#!/usr/bin/env bash
escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"
if grep flutter pubspec.yaml > /dev/null; then
if [ -d "coverage" ]; then
# combine line coverage info from package tests to a common file
if [ ! -d "$MELOS_ROOT_PATH/coverage_report" ]; then
mkdir "$MELOS_ROOT_PATH/coverage_report"
fi
<!DOCTYPE html>
<html lang="en">
<head>
<style>
select {
appearance: none;
outline: 0;
background: white;
background-image: none;
@ajilo297
ajilo297 / streamed_list.dart
Created February 7, 2020 07:42
A utility class that can hold values from Stream<List>
import 'dart:async';
class StreamedList<T> {
StreamController<List<T>> _controller = StreamController.broadcast();
Stream<List<T>> get stream => _controller.stream;
List<T> get dataList => this._list;
List<T> _list = [];
@ajilo297
ajilo297 / main.dart
Last active January 16, 2020 08:29
Binary Clock
import 'package:flutter/material.dart';
import 'dart:async';
void main() {
runApp(MainApplication());
}
class MainApplication extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ajilo297
ajilo297 / chip_selection.dart
Last active July 12, 2021 17:39
Dynamically adding chips
import 'package:flutter/material.dart';
void main() => runApp(MainApplication());
class MainApplication extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(home: HomePage());
}
}
var convertINR = (currency) => {
var a = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
var b = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];
if ((currency = currency.toString()).length > 9) return 'overflow';
n = ('000000000' + currency).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/);
if (!n) return;
var str = '';
@ajilo297
ajilo297 / list.py
Last active September 17, 2017 17:23
Ordering List in Python
a = [0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1]
a = [0] * a.count(0) + [1] * a.count(1)