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
package se.hellsoft.markdowncomposer | |
import android.util.Log | |
import androidx.compose.foundation.Box | |
import androidx.compose.foundation.ContentGravity | |
import androidx.compose.foundation.Text | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.text.InlineTextContent | |
import androidx.compose.foundation.text.appendInlineContent | |
import androidx.compose.material.Colors |
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 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
package se.hellsoft.jetpackcomposeintro | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.compose.Composable | |
import androidx.compose.Model | |
import androidx.compose.state | |
import androidx.compose.unaryPlus | |
import androidx.ui.core.* | |
import androidx.ui.foundation.shape.border.Border |
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
/* | |
Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
This is a tiny log utility for Android Logcat. It allows logs to be used in code that is unit | |
tested on host (without Android framework available). | |
The only advantage with this utility above Timber is that it doesn't require any setup. | |
For real-world, production application I strongly recommend using Timber (see https://github.com/JakeWharton/timber/) instead. | |
*/ | |
@file:Suppress("unused") |
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
@file:Suppress("unused") | |
package se.hellsoft.coroutineantipatterns | |
import android.util.Log | |
internal const val TAG = "KittyLog" | |
fun logi(message: String, throwable: Throwable? = null) { | |
try { |
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
package se.hellsoft.nonblocking.echo | |
import java.net.InetSocketAddress | |
import java.nio.ByteBuffer | |
import java.nio.channels.SelectionKey | |
import java.nio.channels.Selector | |
import java.nio.channels.ServerSocketChannel | |
import java.nio.channels.SocketChannel | |
/** |
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
fun imageFormatName(format: Int): String = when (format) { | |
ImageFormat.DEPTH16 -> "DEPTH16" | |
ImageFormat.DEPTH_JPEG -> "DEPTH_JPEG" | |
ImageFormat.DEPTH_POINT_CLOUD -> "DEPTH_POINT_CLOUD" | |
ImageFormat.FLEX_RGBA_8888 -> "FLEX_RGBA_8888" | |
ImageFormat.FLEX_RGB_888 -> "FLEX_RGB_888" | |
ImageFormat.HEIC -> "HEIC" | |
ImageFormat.JPEG -> "JPEG" | |
ImageFormat.NV16 -> "NV16" | |
ImageFormat.NV21 -> "NV21" |
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
/* | |
MIT License | |
Copyright (c) 2019 Erik Hellman | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
@file:Suppress("unused") | |
package se.hellsoft.webviewserver | |
import android.content.res.AssetManager | |
import android.net.Uri | |
import android.webkit.WebResourceRequest | |
import android.webkit.WebResourceResponse | |
import java.io.ByteArrayInputStream | |
import java.io.File |
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
// Create a path to an element of the form 2/1/1/34 (index of each child) | |
function getDomPath(el) { | |
const stack = []; | |
while (el.parentNode != null) { | |
console.log(el.nodeName); | |
let sibCount = 0; | |
let sibIndex = 0; | |
for (let i = 0; i < el.parentNode.childNodes.length; i++) { | |
const sib = el.parentNode.childNodes[i]; | |
if (sib === el) { |
NewerOlder