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
## Useful Commands | |
Get kubectl version | |
kubectl version | |
Get cluster info: |
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.Color; | |
public final class ColorsHelper { | |
/** | |
* Contrast constant as defined by W3C for the sRGB color space where white and black are used | |
* as the light and dark colors. | |
* <p> | |
* For more info, see https://www.w3.org/TR/WCAG20/#contrast-ratiodef | |
* </p> | |
*/ |
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.support.v7.widget.LinearSnapHelper | |
import android.support.v7.widget.OrientationHelper | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
open class StartLinearSnapHelper : LinearSnapHelper() { | |
protected var _verticalHelper: OrientationHelper? = null | |
protected var _horizontalHelper: OrientationHelper? = null |
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
cb() { | |
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m' | |
# Check that xclip is installed. | |
if ! type xclip > /dev/null 2>&1; then | |
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m" | |
# Check user is not root (root doesn't have access to user xorg server) | |
elif [[ "$USER" == "root" ]]; then | |
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m" | |
else | |
# If no tty, data should be available on stdin |
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
loadExternalProperties('version.properties') | |
def loadExternalProperties(fileName) { | |
def Properties props = new Properties() | |
file(fileName).withInputStream { stream -> | |
props.load stream | |
props.each { prop -> | |
project.ext[prop.key] = prop.value | |
} | |
stream.close() |
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.Context | |
import android.location.Location | |
import com.google.android.gms.location.* | |
/** | |
* A default implementation using the fused location provider to supply the application with locations | |
*<p> | |
* You should ensure you have the correct permissions in the manifest, that the permissions have | |
* been granted, and location services are enabled. |
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.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkInfo | |
import android.os.Handler | |
import android.os.Looper | |
import java.net.URL | |
import java.net.UnknownHostException | |
import java.util.concurrent.Executors | |
import javax.net.ssl.HttpsURLConnection |
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.Context | |
import android.graphics.Canvas | |
import android.graphics.Path | |
import android.graphics.Rect | |
import android.util.AttributeSet | |
import android.widget.TextView | |
public class VerticalTextView extends TextView { | |
private Rect _textBounds = new Rect(); |
NewerOlder