Skip to content

Instantly share code, notes, and snippets.

@jaeho-flitto
jaeho-flitto / LinkNavigator_README_KR.md
Last active January 16, 2023 09:42
LinkNavigator README in Korean

- Concept

✨ LinkNavigator 는 SwiftUI 에서 화면을 자유롭게 이동할 수 있도록 도와주는 라이브러리입니다.

  • URL path 형식의 표현 방법을 통해, 화면 이동에 대한 직관적인 syntax 를 제공합니다.
  • 딥링크 처리 방식으로 어떤 화면이든 간편하게 이동할 수 있습니다.
  • 화면 이동과 함께 매개변수를 주입할 수 있습니다.
  • MVI 디자인 패턴, 혹은 pointfreeco 의 The Composable Architecture 와 같은 Uni-directional Architecture 에서 사용할 목적으로 디자인 되었지만, 그 외의 Architecture 에서도 사용하기 좋습니다.
@alexzaitsev
alexzaitsev / DefaultLinkMovementMethod.java
Last active January 17, 2024 08:45
How to display HTML using Android Compose
/**
* Set this on a textview and then you can potentially open links locally if applicable
*/
public class DefaultLinkMovementMethod extends LinkMovementMethod {
private OnLinkClickedListener mOnLinkClickedListener;
public DefaultLinkMovementMethod(OnLinkClickedListener onLinkClickedListener) {
mOnLinkClickedListener = onLinkClickedListener;
}
@brettohland
brettohland / 1.0 FormatStyle in Excruciating Detail.md
Last active May 4, 2024 08:11
FormatStyle in Excruciating Detail
@benigumocom
benigumocom / UiUtils.kt
Last active April 14, 2022 05:08
RepeatOnLifecycle in Fragment
/**
* Launches a new coroutine and repeats `block` every time the Fragment's viewLifecycleOwner
* is in and out of `minActiveState` lifecycle state.
*/
inline fun Fragment.launchAndRepeatWithViewLifecycle(
minActiveState: Lifecycle.State = Lifecycle.State.STARTED,
crossinline block: suspend CoroutineScope.() -> Unit
) {
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.lifecycle.repeatOnLifecycle(minActiveState) {
@milnak
milnak / ubuntu20-hyperv-enhanced-session.md
Last active May 20, 2024 09:01
[Enabling enhanced session in Hyper-V for Ubuntu 20] This works for me, although it seems that Hyper-V quick create now supports enhanced session by default. #ubuntu #hyperv

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20 desktop

DO NOT create the VM by choosing Quick Create in Hyper-V Manager. Follow these instructions exactly.

@gpeal
gpeal / BroadcastReceiver.kt
Last active February 21, 2023 11:07
Coroutine Broadcast Receivers
context.registerReceiverInScope(scope, WifiManager.WIFI_STATE_CHANGED_ACTION) { intent ->
val state = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED)
// Use wifi state here
}
/**
* Register a broadcast receiver in the given coroutine scope for any of the specified actions
* and call the callback when it is invoked.
*/
fun Context.registerReceiverInScope(

A guide for working with Android Studio 4.1 on two or more personal Linux(Ubuntu) workstations.

  • More specifically, this is an offline plug and play approach for when you want to switch computers but your code is not hosted on the web

What you'll need:

  • A large capacity external drive (250gb or higher should be more than enough)

  • A base workstation to copy your AS (Android Studio) settings and data from

@eduardoflorence
eduardoflorence / main.dart
Created December 24, 2020 20:03
GetX - Sample GetConnect
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@robksawyer
robksawyer / excludedActivityTypes.swift
Last active March 7, 2024 09:10
A list of UIActivity.ActivityType for modern apps.
let excludedActivityTypes = [
UIActivity.ActivityType.print,
UIActivity.ActivityType.openInIBooks,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.addToReadingList,
UIActivity.ActivityType.assignToContact,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.mail,
UIActivity.ActivityType.markupAsPDF,
UIActivity.ActivityType.postToFacebook,