Skip to content

Instantly share code, notes, and snippets.


polbins polbins

View GitHub Profile
mrk-han /
Last active Dec 22, 2021
Enable and Disable Android Accessibility Settings from the Command Line using ADB (Font scale, talkback, color blind)

Using ADB to control Accessbility settings for easier testing with Android Emulators + Real Devices

It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.

These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.

Credit to James Nitsch for inspiring this, and for figuring out the put commands to enable these settings.

Font Scale (Font Size -- Testing Dynamic Text)

XLNCs / AdobeFixAMD
Last active Dec 31, 2021
To fix adobe products crashes on AMD hackintosh
View AdobeFixAMD
View PureStateMachineWithEffects.kt
package statemachine
import debug
import fail
import io.reactivex.Observable
import kotlinx.coroutines.experimental.channels.Channel
import kotlinx.coroutines.experimental.channels.produce
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
import kotlinx.coroutines.experimental.runBlocking
ateucher /
Last active Dec 9, 2021
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global 'Firstname Lastname'
    git config --global ''
yangweigbh /
Last active Jan 18, 2021
Class to listen to network change
public interface NetworkEventProvider {
void setListener(Listener listener);
interface Listener {
* @param networkStatus {@link}
void onNetworkChange(@NetworkUtil.NetworkStatus int networkStatus);
ultraon / build.gradle
Last active Aug 19, 2020
Good example of the merged Jacoco code covarage Gradle configuration
View build.gradle
apply plugin: ''
apply from: "$rootDir/coverage.gradle"
android {
buildTypes {
debug {
nesquena /
Last active Dec 8, 2021
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
andymatuschak /
Last active Jan 4, 2022
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

mugifly /
Last active Nov 24, 2017
Build of Android Studio Project and Post the apk to Slack from Magnum CI

Build of Android Studio Project and Post the apk to Slack from Magnum CI

  • Build the Android Studio Project (Gradle Project) which exist on your Git repository.
  • Upload the generated apk file to Slack.

Basic Setup

  • Repository URL:
  • Provider: Github
  • Source control: Git
  • Project type: Generic
andkon /
Last active Sep 22, 2020
Toronto Outdoors

Spring/summer/fall (in order of distance)

  • Daytrip list
  • Tobermory swimming holes/grotto
  • Bruce Peninsula National Park - you can book backcountry sites here. Very chill hike, but really beautiful. I came from the east parking lot and then got a ride back to my car, but you could definitely just park at the main campground, camp at site HD6 (or thereabouts), and then hike back the next day, as it was only about 12km from there to the main camp.
  • Algonquin Provincial Park - I've only ever carcamped here, but there's a loo