Verify Permissions
diskutil verifyPermissions /
Repair Permissions
diskutil repairPermissions /
| # Derived from this: https://github.com/gashton/bambustudio_tools/blob/master/bambudiscovery.sh | |
| # Python implementation without need for linux | |
| # Send the IP address of your BambuLab printer to port 2021/udp, which BambuStudio is listens on. | |
| # Ensure your PC has firewall pot 2021/udp open. This is required as the proper response would usually go to the ephemeral source port that the M-SEARCH ssdp:discover message. | |
| # But we are are blindly sending a response directly to the BambuStudio listening service port (2021/udp). | |
| # Temporary solution to BambuStudio not allowing you to manually specify the Printer IP. | |
| # Usage: |
| import androidx.lifecycle.LiveData | |
| import androidx.lifecycle.MediatorLiveData | |
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.Job | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld -> | |
| val source = this |
| fun <A, B, R> zipMergeLiveData(a: LiveData<A>, b: LiveData<B>, zipper: (A, B) -> R): LiveData<R> { | |
| return MediatorLiveData<R>().apply { | |
| var lastA: A? = null | |
| var lastB: B? = null | |
| fun update() { | |
| val localLastA = lastA | |
| val localLastB = lastB | |
| if (localLastA != null && localLastB != null) { | |
| val foo = zipper.invoke(localLastA, localLastB) |
| /** | |
| * List of modules that don't require Jacoco | |
| */ | |
| def ignoredByJacoco = [ | |
| 'presentation' | |
| ] | |
| /** | |
| * module class dirs | |
| * */ |
| #!/bin/bash | |
| # Install sleepwatcher | |
| cd /tmp | |
| curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz | |
| tar -zxvf sleepwatcher_2.2.tgz | |
| cd sleepwatcher_2.2 | |
| sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8 | |
| sudo cp sleepwatcher /usr/local/sbin | |
| sudo cp sleepwatcher.8 /usr/local/share/man/man8 | |
| sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents |
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2014 Matthieu Harlé | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <color name="red_50">#fde0dc</color> | |
| <color name="red_100">#f9bdbb</color> | |
| <color name="red_200">#f69988</color> | |
| <color name="red_300">#f36c60</color> | |
| <color name="red_400">#e84e40</color> | |
| <color name="red_500">#e51c23</color> | |
| <color name="red_600">#dd191d</color> | |
| <color name="red_700">#d01716</color> |
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
#Quick and sexy String encrypt / decrypt for Android
Sometimes you find yourself wanted to use SharedPrefs to hold something precious? Want to prevent those pesky rooted hackz0rs from looking in your SharedPreds? Here is a quick and sexy no-external-libs-required solution.
Notes;
I have declared everything static so you can create your own utility class and throw the following straight in.
3rd party imports are not required. Use import android.util.Base64; for Base64, and import javax.crypto.*; for Cipher.