This file contains hidden or 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
@JvmOverloads @Dimension(unit = Dimension.PX) fun Number.dpToPx( | |
metrics: DisplayMetrics = Resources.getSystem().displayMetrics | |
): Float { | |
return toFloat() * metrics.density | |
} | |
@JvmOverloads @Dimension(unit = Dimension.DP) fun Number.pxToDp( | |
metrics: DisplayMetrics = Resources.getSystem().displayMetrics | |
): Float { | |
return toFloat() / metrics.density |
This file contains hidden or 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 <T> unsafeLazy(initializer: () -> T) = lazy(LazyThreadSafetyMode.NONE, initializer) |
This file contains hidden or 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 sh | |
compress() { | |
while [ "$1" ]; do | |
if [ -d "$1" ]; then | |
compress "$1"/* | |
else | |
zopflipng -m -y $1 $1 | |
fi | |
shift |
This file contains hidden or 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 -i | |
### THIS IS A MODIFIED VERSION OF BEN GREEN'S SCRIPT LOCATED HERE: | |
### https://gist.githubusercontent.com/numtel/96dd51106f0e7e25c50dcf4a4f119499/raw/4d2cf0d17b26239b10050a0b35e6ed5646273a38/install_rai_node.sh | |
DATA_PATH="/home/$USER" # Change if desired, directory must exist! | |
DATA_DIRECTORY="RaiBlocks" # Determined by rai_node | |
sudo apt update | |
sudo apt upgrade |
NewerOlder