Skip to content

Instantly share code, notes, and snippets.

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

Mohsen Rezania LinX64

🏠
Working from home
View GitHub Profile
@LinX64
LinX64 / Publish.yaml
Last active April 5, 2024 00:26
Publish.yaml
name: Publish
on:
push:
tags:
- v*
branches:
- master
workflow_dispatch:
@LinX64
LinX64 / script.yaml
Created December 10, 2023 18:03
Create a file
- name: Export Currencies Data to JSON
run: |
for i in {1..3}; do
bonbast export > currencies.json && break || sleep 10
done
cat currencies.json
@LinX64
LinX64 / gist:f5e6ccaeccd8f32d5eb968cc63bb1486
Last active December 10, 2023 17:59
Installing Python Scraper
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Bonbast
run: pip install -U bonbast
@LinX64
LinX64 / SearchBar.kt
Last active December 24, 2022 02:55
SearchBar (Compose)
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
@LinX64
LinX64 / BaseListAdapter.kt
Created October 26, 2022 20:37
BaseListAdapter for ListAdapters
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.LinearLayout.LayoutParams
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
abstract class BaseListAdapter<T : Any, VB : ViewBinding> :
@LinX64
LinX64 / BaseFragment.kt
Last active November 10, 2022 10:40
BaseFragment - with ViewBinding
typealias Inflate<T> = (LayoutInflater, ViewGroup?, Boolean) -> T
abstract class BaseFragment<VB : ViewBinding>(private val inflate: Inflate<VB>) : Fragment() {
private var _binding: VB? = null
val binding: VB get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
@LinX64
LinX64 / Util.kt
Created February 9, 2021 22:22
Here's my Kotlin extension functions that I use for my Android applications.
package yourPackageName.utilities
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
import android.os.CountDownTimer
import android.text.Editable
import android.text.TextWatcher