All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker
. This will install the whole docker suite, left only Tini to be compiled manually.
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
#!/usr/bin/env kotlin -language-version 1.9 | |
// Make sure you run "brew install kotlin graphviz" first. | |
@file:Repository("https://repo.maven.apache.org/maven2/") | |
@file:Repository("https://dl.google.com/dl/android/maven2/") | |
@file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
@file:DependsOn("androidx.collection:collection-jvm:1.4.0") | |
import androidx.collection.IntList |
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
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
WindowCompat.setDecorFitsSystemWindows(window, false) | |
super.onCreate(savedInstanceState) | |
setContent { | |
P2RTheme { | |
// A surface container using the 'background' color from the theme | |
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { | |
CompositionLocalProvider( | |
LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance |
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
# To measure lauch time | |
fun launchTime(){ | |
# Config | |
LAUNCH_COUNT=10 | |
REGEX='TotalTime: (\d+)' | |
# The two params are configurable via argument | |
DEFAULT_PACKAGE_NAME='com.your.packagename' |
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
@Composable | |
fun CustomWebView(modifier: Modifier = Modifier, | |
url:String, | |
onBack: (webView:WebView?) -> Unit, | |
onProgressChange: (progress:Int)->Unit = {}, | |
initSettings: (webSettings:WebSettings?) -> Unit = {}, | |
onReceivedError: (error: WebResourceError?) -> Unit = {}){ | |
val webViewChromeClient = object:WebChromeClient(){ | |
override fun onProgressChanged(view: WebView?, newProgress: Int) { | |
//回调网页内容加载进度 |
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
@Composable | |
fun FlowRow( | |
horizontalGap: Dp = 0.dp, | |
verticalGap: Dp = 0.dp, | |
alignment: Alignment.Horizontal = Alignment.Start, | |
content: @Composable () -> Unit, | |
) = Layout(content = content) { measurables, constraints -> | |
val horizontalGapPx = horizontalGap.toPx().roundToInt() | |
val verticalGapPx = verticalGap.toPx().roundToInt() |
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
ffmpeg -ss $INPUT_START_TIME -t $LENGTH -i $INPUT_FILENAME \ | |
-vf "fps=$OUTPUT_FPS,scale=$OUTPUT_WIDTH:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
-loop $NUMBER_OF_LOOPS $OUTPUT_FILENAME | |
# Change these placeholders: | |
# * $INPUT_START_TIME - number of seconds in the input video to start from. | |
# * $LENGTH - number of seconds to convert from the input video. | |
# * $INPUT_FILENAME - path to the input video. | |
# * $OUTPUT_FPS - ouput frames per second. Start with `10`. | |
# * $OUTPUT_WIDTH - output width in pixels. Aspect ratio is maintained. |
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 androidx.lifecycle.get | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider | |
import androidx.lifecycle.ViewModelStore | |
import androidx.lifecycle.ViewModelStoreOwner | |
/** | |
* Returns a property delegate to access the wrapped value, which will be retained for the | |
* duration of the lifecycle of this [ViewModelStoreOwner]. | |
* |
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
#!/bin/bash | |
# Make sure your Android device is plugged in and accessible over adb. | |
#### Remember to enable virtual displays in xorg by adding the following to your configuration (e.g. /usr/share/X11/xorg.conf.d/20-virtual.conf) | |
# Section "Device" | |
# Identifier "intelgpu0" | |
# Driver "intel" | |
# Option "VirtualHeads" "1" | |
#EndSection |
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
1. Compile configure | |
configuration: --enable-libass --enable-gpl --enable-libfreetype --enable-libvpx --enable-libx264 --enable-libmp3lame | |
--enable-libspeex --enable-libx265 --enable-nonfree --enable-videotoolbox --enable-audiotoolbox --enable-fontconfig | |
--enable-libfdk-aac | |
2. Add subtitles(字幕) | |
./ffmpeg -i input.mp4 -vf subtitles=your.srt output.mp4 | |
3. Specify subtitles when playing the video | |
./ffplay -vf subtitles=your.srt input.mp4 |
NewerOlder