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
#!/bin/bash | |
# Define the number of commits to reset | |
NUM_COMMITS=100 | |
PLATFORM=arm64 | |
ANDROID_EMULATOR_SERIAL="Pixel_3_API_21" # run `emulator -list-avds` to get the serial of the emulator | |
CHROMIUM_WEBVIEW_DIR="/Users/timo/Documents/ha/chromium-webview" | |
# Define color codes | |
RED='\033[0;31m' |
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
#!/bin/bash | |
sensors | |
find /dev/ -maxdepth 1 -regextype posix-extended -regex ".*sd[b-z]" -exec sudo hddtemp {} \; |
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
#!/bin/bash | |
# https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md#how-to-begin-a-bash-script | |
set -e # stop the script if any command has non-zero exit status | |
set -u # throws an error if a variable is not defined | |
set -o pipefail # returns an error if any command fails in a pipe | |
shopt -s nullglob globstar # enables empty glob results and recursive globbing | |
# list of disk where there are plots to replace |
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
[Unit] | |
Description=Chia Daemon | |
After=network-online.target multi-user.target | |
Requires=network-online.target | |
[Service] | |
Type=forking | |
TimeoutStartSec=infinity | |
User=chia | |
ExecStart=/bin/bash /home/chia/start_chia.sh |
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
import android.view.MotionEvent | |
import android.view.ScaleGestureDetector | |
import android.view.View | |
fun View.enableDragAndScale() { | |
val scaleGestureDetector = ScaleGestureDetector(context, object : ScaleGestureDetector.SimpleOnScaleGestureListener() { | |
var mScaleFactor = 1f | |
override fun onScale(detector: ScaleGestureDetector): Boolean { |
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
import android.graphics.Bitmap | |
import android.graphics.pdf.PdfRenderer | |
import androidx.recyclerview.widget.RecyclerView | |
import android.util.Log | |
import android.view.ViewGroup | |
import com.davemorrissey.labs.subscaleview.ImageSource | |
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView | |
/** | |
* Created by timothynibeaudeau on 25/11/2018. |
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
import android.view.View | |
/** | |
* Created by timoptr on 25/11/2018. | |
*/ | |
/** | |
* This class is an Helper to avoid double click (spam) on a view click listener | |
* It will avoid it by dismiss click which are not separate by at least [DOUBLE_CLICK_TIMEOUT] | |
* |
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
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.util.Log | |
import io.reactivex.Observable | |
import io.reactivex.ObservableEmitter | |
import io.reactivex.subjects.PublishSubject | |
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
import io.reactivex.Observable | |
import io.reactivex.subjects.PublishSubject | |
import org.junit.Assert.assertEquals | |
import org.junit.Test | |
import java.util.concurrent.TimeUnit | |
/** | |
* Rx sample demonstration of combination of operators | |
*/ | |
class RxSampleTest { |