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 EditText.setAutoSizing() { | |
initialTextSize = textSize | |
afterTextChanged { autoSizeText() } | |
} | |
private fun EditText.autoSizeText() { | |
if(text.isEmpty()) { | |
setTextSize(TypedValue.COMPLEX_UNIT_PX, initialTextSize) | |
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
#!/bin/sh | |
git log --shortstat | grep -E "(Author: )(\b\s*([A-Z]\w+)){2}|fil(e|es) changed" | awk ' | |
{ | |
if($1 ~ /Author/) { | |
author = $2" "$3 | |
} else { | |
files[author]+=$1 | |
inserted[author]+=$4 | |
deleted[author]+=$6 | |
} |
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
public class DoubleXLabelAxisRenderer extends XAxisRenderer { | |
private IAxisValueFormatter topValueFormatter; | |
public DoubleXLabelAxisRenderer(ViewPortHandler viewPortHandler, XAxis xAxis, Transformer transformer, IAxisValueFormatter topValueFormatter) { | |
super(viewPortHandler, xAxis, transformer); | |
this.topValueFormatter = topValueFormatter; | |
} | |
@Override |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/card" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginEnd="16dp" | |
android:layout_marginStart="16dp" | |
android:layout_marginTop="16dp" |
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
01-04 12:02:45.251 5973-5973/com.example.ernest.myapplication E/AndroidRuntime: FATAL EXCEPTION: main | |
Process: com.example.ernest.myapplication, PID: 5973 | |
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ernest.myapplication/com.example.ernest.myapplication.MainActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter args | |
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817) | |
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) | |
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
const readline = require('readline'); | |
const readInterface = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
function getLastMondayMonths(startYear, endYear) { | |
if(!endYear) { | |
endYear = startYear; |
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.location.Location; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.util.Log; | |
import com.google.android.gms.common.ConnectionResult; | |
import com.google.android.gms.common.api.GoogleApiClient; | |
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; | |
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; | |
import com.google.android.gms.location.LocationListener; |
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
.marquee { | |
width: 30vw; | |
height: 10vh; | |
position: relative; | |
background-color: #222; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; |