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
| sudo su | |
| #create jvm directory | |
| mkdir /usr/lib/jvm | |
| #uncompress, change to your file name | |
| tar -zxf jdk-8u211-linux-x64.tar.gz -C /usr/lib/jvm | |
| #check if files are there | |
| #ls /usr/lib/jvm |
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
| import java.util.Scanner; | |
| /** | |
| * Display the calendar of any year | |
| * | |
| * @author LongClipeus | |
| * | |
| */ | |
| public class Date { |
- You will need Java 8 to run Signaling Server. If you have multiple Java versions installed on the server you can change the default version using the
update-alternativestool as shown below:
sudo update-alternatives --config java
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 python3 | |
| version= '3.0' | |
| title = ''' | |
| _ \ __ \ __ \ ___| _) | | |
| | | | | | | | | _ \ __| \___ \ __| __| | __ \ __| | |
| ___/ | | | | | | ( |\__ \ | ( | | | | | | |
| _| \__, |____/ ____/ \___/ ____/ _____/ \___|_| _| .__/ \__| | |
| ____/ _| |
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 showToastGreen(context: Context, message: String) { | |
| val toast: Toast = Toast.makeText(context, "", Toast.LENGTH_LONG) | |
| val view = toast.view | |
| view.background.setColorFilter( | |
| ContextCompat.getColor(context, R.color.green_dark), | |
| PorterDuff.Mode.SRC_IN | |
| ) | |
| val text = view.findViewById<TextView>(android.R.id.message) | |
| text.setTextColor(ContextCompat.getColor(context, R.color.white)) | |
| text.text = message |
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
| import StringUtils.encodeHex | |
| import java.io.File | |
| import java.io.FileInputStream | |
| import java.io.InputStream | |
| import java.security.MessageDigest | |
| object HashUtils { | |
| const val STREAM_BUFFER_LENGTH = 1024 |
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
| import android.os.Parcel | |
| import android.os.Parcelable | |
| enum class TrafficLightStatus(val id: Int) : Parcelable { | |
| RED(1), | |
| YELLOW(2), | |
| GREEN(3); | |
| constructor(parcel: Parcel) : this(parcel.readInt()) |
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
| const val ACTION_PIP_SETTING = "android.settings.PICTURE_IN_PICTURE_SETTINGS" | |
| @RequiresApi(Build.VERSION_CODES.O) | |
| fun AppCompatActivity.hasPictureInPicturePermission(): Boolean { | |
| val appOps = getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager | |
| val uid = android.os.Process.myUid() | |
| val mode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | |
| appOps.unsafeCheckOpNoThrow(AppOpsManager.OPSTR_PICTURE_IN_PICTURE, uid, packageName) | |
| } else { | |
| @Suppress("DEPRECATION") |
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
| import android.content.Context | |
| import androidx.annotation.RawRes | |
| import com.tech.melait.common.utils.ResourceUtils.readRawFile | |
| import kotlinx.coroutines.Dispatchers | |
| import kotlinx.coroutines.withContext | |
| suspend fun readRawFile(context: Context, @RawRes res: Int) = withContext(Dispatchers.Default) { | |
| context.resources.readRawFile(res) | |
| } |