Skip to content

Instantly share code, notes, and snippets.

🐢

polbins polbins

🐢
Block or report user

Report or block polbins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View countdown-timer.markdown
@polbins
polbins / VisibilityAwarePagerFragment.kt
Last active Jan 30, 2019
Base class to check if a ViewPager Fragment is visible to the user
View VisibilityAwarePagerFragment.kt
abstract class VisibilityAwarePagerFragment : Fragment() {
private var currentIndex: Int = 0
private var isFragmentVisibleToUser = false
set(value) {
if (field != value) {
onVisibilityChanged(value)
}
field = value
}
View RoundedBottomSheetDialogFragment.kt
package com.your.package
import android.app.Dialog
import android.os.Bundle
import com.your.package.R
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
/**
* BottomSheetDialog fragment that uses a custom
@polbins
polbins / README.md
Created Aug 30, 2018
Automator Script for scrpcpy
View README.md

Install scrcpy

brew install scrcpy

Add scrcpy.workflow to Automator Services

@polbins
polbins / pre-push
Last active Oct 3, 2018
Pre-push to run your lint and tests
View pre-push
#!/bin/bash
# Installation
# ============
# 1. Add this snippet to: `<REPO>/.git/hooks/pre-push`
# 2. Make sure to `chmod a+x <REPO>/.git/hooks/pre-push` to make the code executable
# Check if we actually have commits to push
commits=`git log @{u}..`
if [ -z "$commits" ]; then
@polbins
polbins / prepare-commit-msg
Last active Oct 3, 2018 — forked from andrei-dragusanu/prepare-commit-msg
prepare-commit-msg that gets JIRA ID from git branch name
View prepare-commit-msg
#!/bin/sh
# Jira ID Extraction
# =================================
# Extract Jira ID from branch name and prepend to commit message.
#
# Takes a commit message like: "A commit comment" for branch "feature/SUM-1234-hello"
# and changes it to: "SUM-1234: A commit comment" for easier commit updates.
#
# Installation
View .tmux.conf
# Tmux settings
# Set XTerm key bindings
setw -g xterm-keys on
# Set colors
set-option -g default-terminal "screen-256color"
# Set reload key to r
bind r source-file ~/.tmux.conf
@polbins
polbins / Fastfile
Created Oct 3, 2017
Fastlane script for Uploading to Slack and Play Store Alpha
View Fastfile
default_platform :android
platform :android do
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABC/123/XYZ"
end
######################### PUBLIC LANES #########################
desc "Deploy a new Prod APK version to Play Store Alpha"
@polbins
polbins / JsonTestUtil.java
Last active Mar 7, 2019
Android Unit Test Utility Classes
View JsonTestUtil.java
public class JsonTestUtil {
private static ObjectMapper mObjectMapper;
private static ObjectMapper getObjectMapper() {
if (mObjectMapper == null) {
mObjectMapper = new ObjectMapper();
}
return mObjectMapper;
}
@polbins
polbins / ClearableEditText.java
Created Dec 27, 2016
Clearable EditText Custom View
View ClearableEditText.java
public class ClearableEditText extends EditText {
@BindDrawable(R.drawable.ic_clear_dark_gray)
Drawable mClearDrawable;
public ClearableEditText(Context context) {
super(context);
init();
}
public ClearableEditText(Context context, AttributeSet attrs) {
You can’t perform that action at this time.