Skip to content

Instantly share code, notes, and snippets.

View Spikeysanju's full-sized avatar
:octocat:
Busy Innovating

Sanju S Spikeysanju

:octocat:
Busy Innovating
View GitHub Profile
@Spikeysanju
Spikeysanju / CenterZoomLayoutManager.java
Created January 4, 2020 07:41
Center Zoom Layout for Animation RecyclerView items Like (Centre Zoom)
public class CenterZoomLayoutManager extends LinearLayoutManager {
private final float mShrinkAmount = 0.15f;
private final float mShrinkDistance = 0.9f;
public CenterZoomLayoutManager(Context context) {
super(context);
}
public CenterZoomLayoutManager(Context context, int orientation, boolean reverseLayout) {
@Spikeysanju
Spikeysanju / ViewExt.kt
Created January 22, 2021 06:54
A useful extension function to transform EditText into DatePicker 💡
fun TextInputEditText.transformIntoDatePicker(
context: Context,
format: String,
maxDate: Date? = null
) {
isFocusableInTouchMode = false
isClickable = true
isFocusable = false
val myCalendar = Calendar.getInstance()
@Spikeysanju
Spikeysanju / GradientLogo.Kt
Created May 12, 2021 11:28
UI Tips ✅: You don't need multiple colours to make beautiful gradient!. Pick any vibrant colour & At One side reduce pass through to 0.4 - 0.7f. Now you will get Eye-Pleasing Gradients 😍
@Composable
fun GradientLogoWithText(source: String, color: Color) {
val gradientBrush = Brush.linearGradient(listOf(color, color.copy(.7f)))
Box(
modifier = Modifier
.size(80.dp)
.padding(start = 12.dp, top = 12.dp, end = 12.dp, bottom = 12.dp)
.clip(CircleShape)
.background(brush = gradientBrush)
) {
package dev.spikeysanju.jsoup
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.*
import { Dialog, Transition } from '@headlessui/react';
import {
LinkIcon,
PlusIcon,
QuestionMarkCircleIcon,
XMarkIcon
} from '@heroicons/react/24/solid';
import type { GetServerSideProps, NextPage } from 'next';
import { getSession } from 'next-auth/react';
import Head from 'next/head';
@Spikeysanju
Spikeysanju / streamlog.json
Created May 17, 2023 04:21
Whenever there's an event in the database, this is the response I receive.
{
"wrappers_": {
"2": {
"wrappers_": {
"1": [
{
"wrappers_": null,
"arrayIndexOffset_": -1,
"array": [null, null, 3],
"pivot_": 1.7976931348623157e308,
cache_max_map_size: 2147483648
connections:
- name: stic_conn
config: !Postgres
user: spikey
password: sticai123
host: localhost
port: 5432
database: postgres
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
▹▹▹▹▹ products: 0: 0/s
▹▹▹▹▹ carts: 0: 0/s
▹▹▹▹▹ products: 0: 0/s
▹▹▹▹▹ carts: 0: 0/s
▹▹▹▹▹ products: 0: 0/s
▹▹▹▹▹ carts: 0: 0/s
▹▹▹▹▹ products: 0: 0/s
▹▹▹▹▹ carts: 0: 0/s
▹▹▹▹▹ reader: bd36d8d6-5e03-454b-ab7b-2ed11fca98cd: 0: 0/s
▹▹▹▹▹ reader: 74fecd34-712f-4ec3-aa0b-0b91519aa31f: 0: 0/s
<script lang="ts">
import type { NewSubscriberSchema } from '$lib/schema/form-schema';
import type { SuperValidated } from 'sveltekit-superforms';
import { superForm } from 'sveltekit-superforms/client';
import TextInput from '$lib/components/TextInput.svelte';
import { toast } from 'svelte-sonner';
import SuperDebug from 'sveltekit-superforms/client/SuperDebug.svelte';
export let data: SuperValidated<NewSubscriberSchema>;