We will install OpenJDK for anything Java 8 and later. Anything prior is probably Oracle JDK.
Prerequisite: Install Homebrew.
Remember to update your formulas.
$ brew update
import { BitBuilder, BitReader, Cell, beginCell } from "@ton/ton"; | |
const OFFCHAIN_CONTENT_PREFIX = 0x01; | |
export function encodeOffChainContent(content: string) { | |
let data = Buffer.from(content); | |
let offChainPrefix = Buffer.from([OFFCHAIN_CONTENT_PREFIX]); | |
data = Buffer.concat([offChainPrefix, data]); | |
return makeSnakeCell(data); | |
} |
import androidx.compose.animation.* | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.material.MaterialTheme | |
import androidx.compose.material.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.collectAsState | |
import androidx.compose.runtime.getValue |
inline fun <reified T> Flow<T>.observeWithLifecycle( | |
lifecycleOwner: LifecycleOwner, | |
minActiveState: Lifecycle.State = Lifecycle.State.STARTED, | |
noinline action: suspend (T) -> Unit | |
): Job = lifecycleOwner.lifecycleScope.launch { | |
flowWithLifecycle(lifecycleOwner.lifecycle, minActiveState).collect(action) | |
} | |
inline fun <reified T> Flow<T>.observeWithLifecycle( | |
fragment: Fragment, |
--- | |
version: "2.1" | |
volumes: | |
firefox: | |
services: | |
firefox: | |
image: ghcr.io/linuxserver/firefox | |
container_name: firefox |
package com.thomaskuenneth.sandbox | |
import android.graphics.Bitmap | |
import android.graphics.Canvas | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material.MaterialTheme |
#https://twitter.com/officialmcafee/status/1397568860082122752 | |
#https://twitter.com/ahakcil/status/1397888724936105987 | |
import random | |
import copy | |
RST = '\033[0m' | |
def rand_data(size): | |
d = [] |
class LocationActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// Listen to one flow in a lifecycle-aware manner using flowWithLifecycle | |
lifecycleScope.launch { | |
locationProvider.locationFlow() | |
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED) | |
.collect { | |
// New location! Update the map |
/** | |
* Starts collecting a flow when the lifecycle is started, and **cancels** the collection on stop. | |
* This is different from `lifecycleScope.launchWhenStarted { flow.collect{...} }`, in which case | |
* the coroutine is just suspended on stop. | |
*/ | |
inline fun <reified T> Flow<T>.collectWhileStarted( | |
lifecycleOwner: LifecycleOwner, | |
noinline action: suspend (T) -> Unit | |
) { | |
object : DefaultLifecycleObserver { |
# This manifest assumes 'wordpress' namespace is already present: | |
# | |
# kubectl create namespace wordpress | |
# | |
# Apply the manifest with: | |
# | |
# kubectl apply -f mariadb.yml | |
--- | |
apiVersion: v1 | |
kind: Secret |
We will install OpenJDK for anything Java 8 and later. Anything prior is probably Oracle JDK.
Prerequisite: Install Homebrew.
Remember to update your formulas.
$ brew update