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 | |
| #using shebang with -i to enable interactive mode (auto load .bashrc) | |
| set -e #stop immediately if any error happens | |
| # Install Open SDK | |
| apt update | |
| apt install openjdk-8-jdk -y | |
| update-java-alternatives --set java-1.8.0-openjdk-amd64 | |
| java -version |
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
| package com.liam.amin | |
| import android.content.Context | |
| import android.content.res.ColorStateList | |
| import android.util.AttributeSet | |
| import android.util.TypedValue | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import android.widget.LinearLayout | |
| import android.widget.TextView |
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
| package dk.im2b | |
| import java.io.OutputStream | |
| import java.net.ServerSocket | |
| import java.net.Socket | |
| import java.nio.charset.Charset | |
| import java.util.* | |
| import kotlin.concurrent.thread | |
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
| launch(UI) { | |
| editText.onTextChanged() | |
| .debounce(1, TimeUnit.SECONDS) | |
| .consumeEach { | |
| Log.d("DebounceTest", "value: $it") | |
| } | |
| } | |
| } | |
| fun EditText.onTextChanged(): ReceiveChannel<String> = |
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
| /** | |
| * Apache 2.0 | |
| * | |
| * @see <a href="https://github.com/stablekernel/EspressoLib/blob/master/src/main/java/com/stablekernel/espressolib/DrawableMatcher.java">Source1</a> | |
| * @see <a href="http://stackoverflow.com/questions/33696488/getting-bitmap-from-vector-drawable">Source2</a> | |
| */ | |
| @SuppressWarnings("SimplifiableIfStatement") | |
| public class DrawableMatcher extends TypeSafeMatcher<View> { | |
| private final int expectedResourceId; |
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
| <?php | |
| function my_rest_prepare_post( $data, $post, $request ) { | |
| $_data = $data->data; | |
| $thumbnail_id = get_post_thumbnail_id( $post->ID ); | |
| $thumbnail = wp_get_attachment_image_src( $thumbnail_id ); | |
| $_data['featured_image_thumbnail_url'] = $thumbnail[0]; | |
| $data->data = $_data; |