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 / 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));
package com.application.freadom.activity.home;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSnapHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SnapHelper;
@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 / 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-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 / angry.gif
Last active October 19, 2020 13:40
Compose Reactions
angry.gif
@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 / Elements.java
Created November 18, 2016 07:03
RecyclerView-Grid-with-Load-More
/**
* Created by Vipul on 18/11/16.
*/
public class Elements {
private int icon;
private String name;
public int getIcon() {
@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 / ImageCompression
Created December 19, 2015 06:01
Whatsapp Like Image Compression
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.media.ExifInterface;
import android.os.AsyncTask;
import android.os.Environment;