Skip to content

Instantly share code, notes, and snippets.

View pt2121's full-sized avatar

Prat pt2121

View GitHub Profile
@pt2121
pt2121 / joy.kt
Last active October 23, 2022 19:22
@Composable
fun JoyAnim(
color: Color = Color(245, 198, 189, 128),
modifier: Modifier = Modifier.fillMaxSize().background(Color.Black)
) {
var lines by remember {
mutableStateOf(generateLines(0f, 0f))
}
var paths by remember {
mutableStateOf(listOf<Path>())
@pt2121
pt2121 / gist:e8b06fd9fec0036b29b64295981856ed
Created June 12, 2021 16:06 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
package com.pt.treemap
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Rect
import android.util.AttributeSet
import android.view.View
import com.pt.treemap.TreeMapView.Orientation.HORIZONTAL
module HttpClient
import Control.App
import Network.Socket
import Types
public export
interface Has [Exception IOError] e => NetworkIO e where
getResponse : Request -> App e String
@pt2121
pt2121 / ExpandCollapseButton.kt
Last active December 22, 2023 11:28
Android Jetpack Compose caret animation
/*
* Copyright 2020 Prat Tana. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
@pt2121
pt2121 / MainActivity.kt
Created February 2, 2020 04:41
compose 0.1.0-dev04
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.Composable
import androidx.compose.state
import androidx.ui.core.Text
import androidx.ui.core.setContent
import androidx.ui.foundation.HorizontalScroller
import androidx.ui.foundation.ScrollerPosition
import androidx.ui.foundation.shape.DrawShape
import androidx.ui.foundation.shape.RectangleShape

find.patch Test

---
title: test.u
---
hey = "yello"

find.patch Test

hey = "yello"
.> add
@pt2121
pt2121 / Fresh macOS Setup.md
Created May 5, 2019 20:00 — forked from ashfurrow/Fresh macOS Setup.md
All the stuff I do on a fresh macOS Installation

Apps to install from macOS App Store:

  • Pastebot
  • GIF Brewery
  • Slack
  • Keynote/Pages/Numbers
  • 1Password
  • OmniFocus 2
  • Airmail 3
  • iA Writer
SELECT device_model, COUNT(user_id) AS USERS
FROM app.data
WHERE user_id IN (SELECT user_id FROM app.data WHERE created_at BETWEEN TO_TIMESTAMP('01-01-2018', 'dd-mm-yyyy') AND TO_TIMESTAMP('01-07-2018', 'dd-mm-yyyy'))
AND user_id NOT IN (SELECT user_id FROM app.data WHERE created_at > TO_TIMESTAMP('01-07-2018', 'dd-mm-yyyy'))
GROUP BY device_model