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; | |
} |
find [Folder] -name "*.jpg" -exec du -ch {} +
find [Folder] -name "*.png" | grep -v build
(Slow)find [Folder] -name "*.png" | xargs -I {} cwebp -lossless {} -o {}.webp
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] | |
*/ |