Skip to content

Instantly share code, notes, and snippets.

@SatyaSnehith
SatyaSnehith / colors.xml
Created April 1, 2021 11:34
Material colors for android studio
<color name="red_50">#ffebee</color>
<color name="red_100">#ffcdd2</color>
<color name="red_200">#ef9a9a</color>
<color name="red_300">#e57373</color>
<color name="red_400">#ef5350</color>
<color name="red_500">#f44336</color>
<color name="red_600">#e53935</color>
<color name="red_700">#d32f2f</color>
<color name="red_800">#c62828</color>
<color name="red_900">#b71c1c</color>
@SatyaSnehith
SatyaSnehith / MainActivity.java
Last active April 19, 2021 18:41
Progress Bar with drawable in Andorid
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@SatyaSnehith
SatyaSnehith / App.js
Last active May 7, 2021 12:14
Doughnut chart in react native
import React, {Component, useState} from 'react';
import {View, TouchableWithoutFeedback, StyleSheet, Animated, Easing} from 'react-native';
import Svg, {Path} from 'react-native-svg';
function getPos(x, y, radius, angle) {
let radians = (angle + 90.0) * Math.PI / 180.0;
return {
x: (radius * Math.sin(radians)) + x,
y: (radius * Math.cos(radians)) + y
};
@SatyaSnehith
SatyaSnehith / HasNull.kt
Created March 21, 2022 10:57
if any one of the variables has null return true
fun hasNull(vararg list: Any?) = null in list
@SatyaSnehith
SatyaSnehith / size_converter.c
Last active June 17, 2023 19:13
Convert Bytes to KB, MB, GB, TB, PB, EB- C
// execution
// gcc size_converter.c -o size_converter && ./size_converter 512
#include<stdio.h>
#include<stdlib.h>
typedef unsigned long long ULL;
char *types[] = {"Bytes", "KB", "MB", "GB", "TB", "PB", "EB"};
@SatyaSnehith
SatyaSnehith / TwitterDatePicker.kt
Last active May 22, 2024 16:00 — forked from bagus2x/TwitterDatePicker.kt
Jetpack compose twitter date picker (dob). Jetpack Compose scrollable date picker.
package com.satyasnehith.wpd
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.pager.VerticalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.MaterialTheme
@SatyaSnehith
SatyaSnehith / gist:54cf4ce68d3e4afc0febb31db3d8a1ef
Created June 20, 2024 15:44
automatic creation of fonts values in compose
fun printFont() {
for (fontWeight in listOf(
"Thin",
"Light",
"Normal",
"Medium",
"Bold",
"Black"
)) {
for (fontSize in 12..24) {