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
{ | |
"builder": { | |
"gc": { | |
"defaultKeepStorage": "20GB", | |
"enabled": true | |
} | |
}, | |
"experimental": false, | |
"features": { | |
"buildkit": true |
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
/** List of extension file paths */ | |
override fun scan(folders: List<Uri>, extensions: Regex): List<DocumentFile> { | |
val result = mutableListOf<DocumentFile>() | |
fun scan(root: DocumentFile?, extensions: Regex, outputUris: MutableList<DocumentFile>) { | |
if (root == null) return | |
val name = root.name | |
if (root.isFile && name != null && name.contains(extensions)) { | |
outputUris.add(root) | |
return |
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
package au.suby.data.api.youtube.wrappers | |
import org.w3c.dom.Document | |
import org.w3c.dom.Element | |
import org.w3c.dom.Node | |
import org.w3c.dom.NodeList | |
@Suppress("unused") | |
class XmlParser { |
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
fun String.cmd(workingDir: File): String? { | |
try { | |
val parts = this.split("\\s".toRegex()) | |
val proc = ProcessBuilder(*parts.toTypedArray()) | |
.directory(workingDir) | |
.redirectOutput(ProcessBuilder.Redirect.PIPE) | |
.redirectError(ProcessBuilder.Redirect.PIPE) | |
.start() | |
proc.waitFor(60, TimeUnit.MINUTES) |
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
/\*\n.*Copyright[\s\S]*(\*/)\n\n | |
/\*\n[\s\S]*\n\npackage | |
/\*\n[\s\S]*/\n*import | |
/\*[\s\S]*Copyright[\s\S]*\*/ |
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
private inline fun drawBadgeSquirqle(canvas: Canvas) { | |
val badgeText = badge.toString() | |
badgeTextPaint.textScaleX = absCos(animFloat.value * Math.PI) | |
badgeTextPaint.getTextBounds(badgeText, 0, badgeText.length, badge.drawRect) | |
val cx = centerX + iconHalf | |
val cy = centerY - iconHalf | |
val w = badge.drawRect.width() * 0.9f |
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
override fun getAllocatedMemoryMb(): Int { | |
val pids = intArrayOf(android.os.Process.myPid()) | |
return activityManager.getProcessMemoryInfo(pids)[0].totalPss / 1000 | |
} |
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
package XXX | |
import android.content.Intent | |
import android.os.Bundle | |
import au.sjowl.base.basex.BaseActivity | |
import com.google.android.gms.auth.api.signin.GoogleSignIn | |
import com.google.android.gms.auth.api.signin.GoogleSignInClient | |
import io.michaelrocks.lightsaber.getInstance | |
import kotlinx.android.synthetic.main.activity_auth.* | |
import kotlinx.coroutines.GlobalScope |
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
package au.sjowl.coroutinesplay | |
import kotlinx.coroutines.CoroutineExceptionHandler | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.GlobalScope | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.runBlocking | |
import java.lang.Exception | |
import kotlin.coroutines.CoroutineContext |
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
# create user on remote machine | |
scp remote_machine_setup.sh root@remote-machine:~/ | |
ssh remoteMachine | |
sudo bash remote_machine_setup.sh sj_1 "new_user_ssh_public_key" | |
# From local machine | |
# [email protected] - remote machine | |
# press enters | |
ssh-keygen -t rsa |
NewerOlder