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
// ==UserScript== | |
// @name Github status check sort | |
// @namespace https://github.com/ | |
// @version 1.1.2 | |
// @description Sort the status checks on a PR by status and then by name | |
// @author Skjnldsv | |
// @match https://github.com/*/*/pull/* | |
// @icon https://github.githubassets.com/favicons/favicon.svg | |
// @grant none | |
// @updateURL https://gist.github.com/skjnldsv/eb7b894ae996affde4a7d0e00e0d80a1/raw/github-status-check-sort.user.js |
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
USER = pket | |
KEYBOARDS = lily58 kyria | |
PATH_lily58 = lily58 | |
PATH_kyria = splitkb/kyria | |
all: $(KEYBOARDS) | |
.PHONY: $(KEYBOARDS) | |
$(KEYBOARDS): |
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 | |
EMULATOR=~/Library/Android/sdk/tools/emulator | |
if [ $# -ne 1 ]; then | |
echo "ERROR: Please specify the target AVD from the list below" 1>&2 | |
$EMULATOR -list-avds 1>&2 | |
exit 1 | |
fi | |
$EMULATOR -avd $1 -dns-server "8.8.8.8,8.8.4.4" |
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
fun RecyclerView.setupParallaxScrollListener() { | |
addOnScrollListener(object : OnScrollListener() { | |
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { | |
val layoutManager = layoutManager as? LinearLayoutManager ?: return | |
val scrollOffset = recyclerView.computeHorizontalScrollOffset() | |
val offsetFactor = (scrollOffset % measuredWidth) / measuredWidth.toFloat() | |
val firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition() | |
findViewHolderForAdapterPosition(firstVisibleItemPosition)?.let { |
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
recyclerView.apply { | |
// Create and attach the adapter | |
adapter = ShowAdapter(tvShows) | |
// Configure to be a horizontal list | |
layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) | |
// Attach a snap helper, more on that below | |
PagerSnapHelper().attachToRecyclerView(this) | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
... > | |
<ImageView | |
android:id="@+id/poster" | |
android:layout_width="match_parent" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:clipChildren="false" | |
> |
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
class ShowViewHolder(view: View) : ViewHolder(view) { | |
private val title = itemView.title | |
private val description = itemView.description | |
private val thumbnail = itemView.thumbnail | |
private val poster = itemView.poster | |
private val interpolator = FastOutLinearInInterpolator() | |
/** | |
* Offset the thumb and text with a factor [-1.0..1.0] of the total width |
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
data class Show( | |
@StringRes val title: Int, | |
@StringRes val description: Int, | |
@DrawableRes val image: Int | |
) |
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
class ShowAdapter(private val items: List<Show>) : RecyclerView.Adapter<ShowViewHolder>() { | |
init { | |
setHasStableIds(true) | |
} | |
override fun getItemCount() = items.size | |
override fun getItemId(position: Int) = items[position].hashCode().toLong() | |
override fun onCreateViewHolder(parent: ViewGroup, vt: Int) = ShowViewHolder(parent.inflate(R.layout.item_show)) | |
override fun onBindViewHolder(holder: ShowViewHolder, position: Int) = holder.bind(items[position]) | |
} |
NewerOlder