Skip to content

Instantly share code, notes, and snippets.

View vipulasri's full-sized avatar
👨‍💻
https://vipulasri.com/

Vipul Asri vipulasri

👨‍💻
https://vipulasri.com/
View GitHub Profile
@vipulasri
vipulasri / extractImagesFromFont.rb
Created June 21, 2021 06:27
Extract images from font
require 'ttfunk'
file = TTFunk::File.open(ARGV[0])
size = 200
output_dir = ARGV[2]
`mkdir #{output_dir}`
cmap = file.cmap
chars = {}
unicode_chars = []
@vipulasri
vipulasri / angry.gif
Last active October 19, 2020 13:40
Compose Reactions
angry.gif
@vipulasri
vipulasri / banner-sample.json
Created March 17, 2020 08:30
Banner Element Sample
{
"viewType":"bannerElement",
"imageUrl":"https://images.unsplash.com/photo-1478145046317-39f10e56b5e9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80",
"title":"Upto 30% Off",
"action":{
"type":1,
"value":"d43e24ca-3522-4106-91f6-09f0b80d1061"
}
}
@vipulasri
vipulasri / Banner.kt
Created March 12, 2020 12:55
JetDelivery-banner-text
@Composable
private fun showBannerText() {
Align(alignment = Alignment.BottomLeft) {
Container(
modifier = LayoutWidth.Fill, height = 50.dp,
alignment = Alignment.CenterLeft
) {
DrawShape(shape = RectangleShape, color = Color.Black.copy(alpha = 0.3f))
Text(
text = "Upto 30% off",
@vipulasri
vipulasri / Banner.kt
Created March 12, 2020 12:53
JetDelivery-banner-rounded-corner
@Composable
fun showBannerElement() {
Container(width = 150.dp, height = 178.dp) {
Clip(shape = RoundedCornerShape(5.dp)) {
DrawImage(image = imageResource(id = R.drawable.placeholder_banner))
}
}
}
@vipulasri
vipulasri / data-random.json
Last active March 7, 2024 07:40
JetDelivery
{
"data":[
{
"viewType":"horizontalScroll",
"data":[
{
"viewType":"categoryElement",
"imageUrl":"https://gist.githubusercontent.com/vipulasri/8bd2115e50fd73272ea8de08cd54b9d5/raw/c61e583eb588f711126cc72899739d4c9ac9cba6/hamburger.png",
"title":"Burgers",
"subTitle":"260 Places",
@vipulasri
vipulasri / Painting.dart
Created May 23, 2018 08:00
Painting Response
class PaintingResponse {
List<Painting> paintings;
PaintingResponse(this.paintings);
PaintingResponse.fromJson(Map<String, dynamic> json) {
if (json['Paintings'] != null) {
paintings = new List<Painting>();
json['Paintings'].forEach((v) {
paintings.add(new Painting.fromJson(v));
@vipulasri
vipulasri / CustomTabIndicator_Step3.dart
Created May 22, 2018 04:02
Flutter: Bubble Tab Indicator
//In this, we will create a variable to hold [indicatorHeight] i.e 15.0
//Now, we will create a new offset to set the x-axis position of tab according to the TabIndicatorSize i.e label or tab start.
//And set the y-axis to tab height center position and subtracting the value of indicatorHeight center value.
final Rect rect = Offset(offset.dx, (configuration.size.height/2) - indicatorHeight/2) & Size(configuration.size.width, indicatorHeight);
@vipulasri
vipulasri / CustomTabIndicator_Step2.dart
Last active May 22, 2018 03:46
Flutter: Bubble Tab Indicator
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
class CustomTabIndicator extends Decoration {
@override
_CustomPainter createBoxPainter([VoidCallback onChanged]) {
return new _CustomPainter(this, onChanged);
}
@vipulasri
vipulasri / CustomTabIndicator_Step1.dart
Last active May 22, 2018 03:35
Flutter: Bubble Tab Indicator
import 'package:flutter/widgets.dart';
class CustomTabIndicator extends Decoration {
@override
BoxPainter createBoxPainter([VoidCallback onChanged]) {
// TODO: implement createBoxPainter
}
}