This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:convert'; | |
void updateLocalizationKeyInLanguages( | |
List<String> filePaths, String key, Map<String, String> translations) { | |
try { | |
for (String filePath in filePaths) { | |
File file = File(filePath); | |
if (file.existsSync()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Main = () => { | |
const cuteReactionsRefs = useRef<React.RefObject<CuteReactionsRef>[]>([]); | |
// for show using ref | |
cuteReactionsRefs.current[message._id]?.current?.showReactions(); | |
const check = () => { | |
if (!cuteReactionsRefs.current[props.currentMessage?._id]) { | |
cuteReactionsRefs.current[props.currentMessage?._id] = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activate application "Finder" | |
tell application "System Events" | |
tell process "Finder" | |
set endTime to 5 | |
repeat while 8 is greater than endTime | |
click at {200 + endTime * 2, 5} | |
endTime - 1 | |
delay 10 | |
end repeat | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MaterialIcons } from "@expo/vector-icons"; | |
import React, { useCallback, useEffect, useMemo, useState } from "react"; | |
import { | |
FlatList, | |
Image, | |
Pressable, | |
StyleSheet, | |
Text, | |
TouchableOpacity, | |
View, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class State<T> { | |
class Loading<T> : State<T>() | |
data class Success<T>(val data: T) : State<T>() | |
data class Error<T>(val message: String) : State<T>() | |
companion object { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* usage fabMessages.toggle(Slide(Gravity.Bottom)) : Slide() & Fade() */ | |
fun View.toggle(transition: Transition) { | |
transition.duration = 500 | |
transition.addTarget(this) | |
TransitionManager.beginDelayedTransition(this.parent as ViewGroup, transition) | |
visibility = if (!isVisible) View.VISIBLE else View.GONE | |
} | |
// Usage extend any of your view with toggle, like (Button, FabButton, etc). | |
// use views Id. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class DemoData( | |
val email: String, | |
val name: String, | |
val username: String | |
) | |
// Usage For getting saved data. | |
var userData = getModelPref(getPreferences, localUserData, DemoData::class.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
import androidx.recyclerview.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.AsyncListDiffer | |
import androidx.recyclerview.widget.DiffUtil | |
#parse("File Header.java") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Remember: The method needs to be public static and the first parameter will be the view. This is very important. | |
// this is for just for single loading. | |
companion object { | |
@JvmStatic | |
@BindingAdapter("profileImage") | |
fun loadImage(view: ImageView, profileImage: String) { | |
Glide.with(view.context) | |
.load(profileImage) | |
.into(view) |
NewerOlder