Skip to content

Instantly share code, notes, and snippets.

Avatar
🦉
Can't sleep

Aravind Chowdary kamaravichow

🦉
Can't sleep
View GitHub Profile
@kamaravichow
kamaravichow / CircularProgressView.swift
Created Mar 7, 2022
iOS version of gradient circular progress bar SwiftUI
View CircularProgressView.swift
import SwiftUI
struct CircularProgressView: View {
var progress = 10.0
var body: some View {
ZStack {
@kamaravichow
kamaravichow / circular-progress.kt
Created Mar 7, 2022
Composable function for circular progress bar with gradience and animation in Jetpack Compose
View circular-progress.kt
@Composable
fun CircularProgressBar(
percentage: Float,
radius: Dp = 80.dp,
animationDuration: Int = 1000,
) {
var animFinished by remember {
mutableStateOf(false)
}
View gist:a8f2f2a7975eb76445a22b00a5367572
import 'package:flutter/material.dart';
import 'package:flutter_blocks_site/pages/side_bar.dart';
class HomePage extends StatefulWidget {
static GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
const HomePage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
View sample-response.json
{
"status": 200,
"message": "success",
"formats": [
{
"url":"",
"title" : "",
"resolution":"",
"thumbnail":"",
"duration":""
View validity-rules.js
function isValidNewPost() {
let post = request.resource.data;
let isOwner = post.uid request.auth.uid;
let isNotFromPastOrFuture = request.time == request.resource.data.timestamp;
let hasMandatoryFields = post.keys().hasAll(['caption', 'uid', 'timestamp', 'published']);
return isOwner && hasMandatoryFields && isNotFromPastorFuture;
}
View firestore-rules-role-check.js
function hasAnyRole(roles) {
return isLoggedIn() && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.roles.hasAny(roles)
}
View firestore-rules.js
function isValidUpdatedPost(){
let post = request.resource.data;
let hasMandatoryFeilds = post.keys().hasAny(['caption','timestamp','published']);
let isValid = post.content is string && post.content.size() > 2000;
return hasMandatoryFeilds && isValid;
}
@kamaravichow
kamaravichow / lucky-find-repo.json
Last active Mar 24, 2021
List of activities for LuckyFind App
View lucky-find-repo.json
[
{
"title": "Lite Mode",
"description": "Bigger icons, large text, less visual clutter",
"package_name": "com.xiaomi.misettings",
"activity_name": "com.xiaomi.easymode.EasyModeActivity"
},
{
"title": "Anti-Flickering Mode",
"description": "Reduce Flickering & Eye strain in low light conditions",
View ads_adapter.java
package com.aravi.popularly.adapter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Paint;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;