we can use extra.apply to set bunch of properties rather than using many by extra.
For example,
// in top of build.gradle.kts
extra.apply {
set("openApiVersion", "123")
set("ktorVersion", "3.0")| /** | |
| * Exports file to the given target folder on Android. | |
| * | |
| * ref: https://stackoverflow.com/questions/75055593/access-images-in-external-storage-created-by-my-app | |
| */ | |
| @Throws(IOException::class) | |
| suspend fun exportImage( | |
| contentResolver: ContentResolver, | |
| file: File, | |
| targetFolder: String, |
| $remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" | |
| $found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
| if( $found ){ | |
| $remoteport = $matches[0]; | |
| } else{ | |
| echo "The Script Exited, the ip address of WSL 2 cannot be found"; | |
| exit; | |
| } |
| fun countingLambda(): () -> Int { | |
| var counter = 0 | |
| val incrementalCounter: () -> Int = { | |
| counter += 1 | |
| counter | |
| } | |
| return incrementalCounter | |
| } | |
| // decompiled java |
| # For 32G+ memory and JDK11+ | |
| -Xss2m | |
| -Xms1g | |
| -Xmx8g | |
| -XX:PermSize=512m | |
| -XX:MaxPermSize=1024m | |
| -XX:ReservedCodeCacheSize=256m |
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations] | |
| ".tif"="PhotoViewer.FileAssoc.Tiff" | |
| ".tiff"="PhotoViewer.FileAssoc.Tiff" | |
| ".gif"="PhotoViewer.FileAssoc.Tiff" | |
| ".jpg"="PhotoViewer.FileAssoc.Tiff" | |
| ".jpeg"="PhotoViewer.FileAssoc.Tiff" | |
| ".webp"="PhotoViewer.FileAssoc.Tiff" | |
| ".png"="PhotoViewer.FileAssoc.Tiff" |
| #!/bin/bash | |
| INDEX=1 | |
| for file in `ls | sort -g` | |
| do | |
| filename=$(basename "$file") | |
| extension=${filename##*.} | |
| filename=$(printf "%03d\n" $INDEX) | |
| mv "$file" "$filename.$extension" |
| /* open up chrome dev tools (Menu > More tools > Developer tools) | |
| * go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading) | |
| * right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR | |
| * open up JS console and enter: var har = [paste] | |
| * (pasting could take a while if there's a lot of requests) | |
| * paste the following JS code into the console | |
| * copy the output, paste into a text file | |
| * open up a terminal in same directory as text file, then: wget -i [that file] | |
| */ |
| fun dispatch(block: Runnable, taskContext: TaskContext = NonBlockingContext, fair: Boolean = false) { | |
| trackTask() // this is needed for virtual time support | |
| val task = createTask(block, taskContext) | |
| // try to submit the task to the local queue and act depending on the result | |
| val notAdded = submitToLocalQueue(task, fair) | |
| if (notAdded != null) { | |
| if (!addToGlobalQueue(notAdded)) { | |
| // Global queue is closed in the last step of close/shutdown -- no more tasks should be accepted | |
| throw RejectedExecutionException("$schedulerName was terminated") | |
| } |