registry=localhost:32000
repositories=$(curl ${registry}/v2/_catalog)
for repo in $(echo "${repositories}" | jq -r '.repositories[]'); do
echo $repo
tags=$(curl -sSL "http://${registry}/v2/${repo}/tags/list" | jq -r '.tags[]')
for tag in $tags; do
echo $tag
curl -v -sSL -X DELETE "http://${registry}/v2/${repo}/manifests/$(
curl -sSL -I \
View clean.md
View intentChooser.kt
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 Intent.createChooserFiltered(context: Context, filter: (ResolveInfo) -> Boolean): Intent { | |
val results = context.packageManager.queryIntentActivities(this, 0) | |
.filter { filter(it) } | |
.toMutableList() | |
if (results.isNotEmpty()) { | |
val intents = results.map { | |
(this.clone() as Intent).apply { | |
`package` = it.activityInfo.packageName | |
setClassName( |
View combinatorics.kt
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 main(args: Array<String>) { | |
val result = combine(arrayOf(3, 2, 3, 5)) | |
// Print result | |
result.forEach { | |
it.forEach { System.out.print("$it ") } | |
System.out.println() | |
} | |
} |
View SnappingLinearLayoutManager.kt
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
class SnappingLinearLayoutManager(val context: Context) : LinearLayoutManager(context) { | |
override fun smoothScrollToPosition(recyclerView: RecyclerView?, state: RecyclerView.State?, position: Int) { | |
val smoothScroller = object : LinearSmoothScroller(context) { | |
override fun getVerticalSnapPreference(): Int = SNAP_TO_START | |
override fun computeScrollVectorForPosition(targetPosition: Int): PointF | |
= this@SnappingLinearLayoutManager.computeScrollVectorForPosition(targetPosition) | |
} | |
smoothScroller.targetPosition = position | |
startSmoothScroll(smoothScroller) | |
} |
View PlayingCards.kt
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
enum class CardSymbol { | |
Hearts, Tiles, Clovers, Pikes | |
} | |
class Card(symbol: CardSymbol, value: Int) { | |
var symbol = symbol | |
protected set | |
var value = value | |
protected set |
View NoBugUrlTileProvider.java
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 NoBugUrlTileProvider implements TileProvider { | |
protected final UrlTileProvider mUrlTileProvider; | |
public static final byte[] TRANSPARENT_TILE; | |
static { | |
Bitmap.Config conf = Bitmap.Config.ARGB_8888; | |
Bitmap bmp = Bitmap.createBitmap(256, 256, conf); | |
Canvas canvas = new Canvas(bmp); | |
canvas.drawColor(0); |
View CustomTileProvider.java
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 CustomTileProvider implements TileProvider { | |
public static final byte[] TRANSPARENT_TILE; | |
static { | |
Bitmap.Config conf = Bitmap.Config.ARGB_8888; | |
Bitmap bmp = Bitmap.createBitmap(256, 256, conf); | |
Canvas canvas = new Canvas(bmp); | |
canvas.drawColor(0); |