Skip to content

Instantly share code, notes, and snippets.

View indyfromoz's full-sized avatar
🏠
Working from home

Indrajit Chakrabarty indyfromoz

🏠
Working from home
View GitHub Profile
@indyfromoz
indyfromoz / clean_android_studio.sh
Created April 21, 2023 02:52
Clean Android Studio installation
# Deletes the Android Studio application
rm -Rf /Applications/Android\ Studio.app
# Delete All Android Studio related preferences
# The asterisk here should target all folders/files beginning with the string before it
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/Google/AndroidStudio*
# Deletes Studio's plist file
rm -Rf ~/Library/Preferences/com.google.android.*
# Deletes Emulator's plist file
rm -Rf ~/Library/Preferences/com.android.*
@indyfromoz
indyfromoz / VNC_Server_On_Ubuntu_22.04LTS.md
Last active April 10, 2024 13:55
VNC Server setup on Ubuntu 22.04 LTS

Setup

Install TigerVNC -

$ sudo apt install tigervnc-standalone-server

Configure VNC Server by running

@indyfromoz
indyfromoz / LICENSE
Created June 26, 2022 01:36 — forked from zach-klippenstein/SegmentedControl.kt
iOS-style segmented control in Compose
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
@indyfromoz
indyfromoz / DotsLoaders.kt
Created March 19, 2021 08:15 — forked from EugeneTheDev/DotsLoaders.kt
Dots loading animations with Jetpack Compose
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@indyfromoz
indyfromoz / PreviewProviderModifier.swift
Created October 20, 2020 22:28 — forked from davidsteppenbeck/PreviewProviderModifier.swift
A SwiftUI view modifier for simple preview providers.
#if DEBUG
import SwiftUI
struct PreviewProviderModifier: ViewModifier {
/// Whether or not a basic light mode preview is included in the group.
var includeLightMode: Bool
/// Whether or not a basic dark mode preview is included in the group.
var includeDarkMode: Bool
import SwiftUI
import UIKit
private struct ColorConversionError: Swift.Error {
let reason: String
}
extension Color {
var uiColor: UIColor {
struct ContentView: View {
@State var tab = 0
@State var selections: [Int:Int] = [:]
var body: some View {
ZStack {
TabView(selection: $tab) {
NavigationView {
PageView(n: 0, selections: $selections)
}.navigationViewStyle(StackNavigationViewStyle()).tabItem { Text("Pages") }.tag(0)
import Cocoa
extension Collection {
func firstMap<T>(_ transform: @escaping (Element) -> T?) -> T? {
for element in self {
if let transformed = transform(element) {
return transformed
}
}
return nil
@indyfromoz
indyfromoz / Example_Complex.swift
Created July 30, 2020 09:32 — forked from IanKeen/Example_Complex.swift
PropertyWrapper: @transaction binding for SwiftUI to make changes to data supporting commit/rollback
struct User: Equatable {
var firstName: String
var lastName: String
}
@main
struct MyApp: App {
@State var value = User(firstName: "", lastName: "")
@State var showEdit = false
import SwiftUI
struct ConditionalContent<TrueContent: View, FalseContent: View>: View {
let value: Bool
let trueContent: () -> TrueContent
let falseContent: () -> FalseContent
var body: some View {
if value {
return AnyView(trueContent())