Skip to content

Instantly share code, notes, and snippets.

View NaserKhoshfetrat's full-sized avatar

Naser Khoshfetrat NaserKhoshfetrat

View GitHub Profile
@NaserKhoshfetrat
NaserKhoshfetrat / .txt
Created February 27, 2022 20:57
create db-first model from database
Scaffold-DbContext "Data Source=.\MSSQLSERVER; Initial Catalog=EshopApi_DB;Integrated Security=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
@NaserKhoshfetrat
NaserKhoshfetrat / .gitignore
Created February 23, 2022 13:56
android git ignore
# Gradle Cache for the project
.gradle
# Local Android SDK directory
local.properties
# Project build folder with Kotlin session data
build/
# Generated by Android Studio when running Layout Inspector or Method Tracing
@NaserKhoshfetrat
NaserKhoshfetrat / sshdl.sh
Created February 19, 2022 14:16
download file from linux to linux over ssh
scp [email protected]:~/todo.txt ~/downloads
putty.exe -ssh [email protected] -pw rootzpassword
@NaserKhoshfetrat
NaserKhoshfetrat / power_shell.txt
Last active March 3, 2022 16:31
donwload from linux to windows
pscp -pw <password> [email protected]:log.txt c:\download\
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-29
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
import android.app.Activity
import android.app.Application
import com.yandex.metrica.YandexMetrica
import com.yandex.metrica.YandexMetricaConfig
import com.yandex.metrica.profile.Attribute
import com.yandex.metrica.profile.UserProfile
class EventTrackerUtils {
fun initializeTracker(application: Application) {
import android.content.Context
import android.net.ConnectivityManager
class NetworkUtils {
fun isNetworkAvailable(context: Context): Boolean {
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetworkInfo = connectivityManager.activeNetworkInfo
return activeNetworkInfo != null && activeNetworkInfo.isConnected
}
import android.content.Context
import android.text.Editable
import android.text.TextWatcher
import android.widget.EditText
class TextWatcherUtils {
fun mobilePhoneRequired(context: Context, editText: EditText): TextWatcher {
val textWatcher = object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
import android.content.Context
import android.util.Base64
import android.widget.ImageView
import androidx.core.content.res.ResourcesCompat
import com.bumptech.glide.Glide
import timber.log.Timber
import java.util.*
class GlideUtils
constructor(val context: Context) {