Skip to content

Instantly share code, notes, and snippets.

View Chullian's full-sized avatar
🎯
Focusing

Chullian

🎯
Focusing
View GitHub Profile
@Chullian
Chullian / fix_exfat_drive.md
Created November 14, 2019 07:32 — forked from scottopell/fix_exfat_drive.md
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
fun calculateIroningPrice(serviceQuantity: Int, isAdd: Boolean) {
var priceF = 0.0f
if (isAdd) {
priceF = App.instance.priceDetails.price + ironingPrice
} else {
if (App.instance.priceDetails.price > 0.0f)
priceF = App.instance.priceDetails.price - ironingPrice
}
App.instance.priceDetails.apply {
price = priceF
class HomeFragment : BaseFragment<HomeVm>(), OnItemClickedListener<ItemsListContent> {
override val layoutId = R.layout.fr_home
override val viewModelClass = HomeVm::class.java
private val eateryObserver = Observer<List<ItemsListContent>> { list ->
recyclerEatery.adapter = context?.let { context -> HomeitemsAdapter(context, list, this) }
}
private val drinksObserver = Observer<List<ItemsListContent>> { list ->
abstract class BaseFragment<T : BaseViewModel> : Fragment(), BaseView {
override fun createViewModelFactory(): ViewModelProvider.NewInstanceFactory? {
return null
}
override fun isNeedProgress() = true
private val errorObserver = Observer<Throwable> { error ->
baseView?.showSnack(error.localizedMessage)
abstract class BaseActivity<T : BaseViewModel> : AppCompatActivity(), BaseView {
protected abstract val layoutId: Int
protected abstract val containerId: Int
protected abstract val viewModelClass: Class<T>
protected val viewModel: T by lazy(LazyThreadSafetyMode.NONE) { ViewModelProviders.of(this).get(viewModelClass) }
@Chullian
Chullian / flutter.md
Created June 16, 2019 10:04 — forked from matteocrippa/flutter.md
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like: